0006-Remove-hostapd-and-mac80211-packages.patch 548 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sat, 11 Jan 2014 17:28:18 +0100
  3. Subject: Remove hostapd and mac80211 packages
  4. diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
  5. deleted file mode 100644
  6. index 810c5a0..0000000
  7. --- a/package/hostapd/Config.in
  8. +++ /dev/null
  9. @@ -1,47 +0,0 @@
  10. -# wpa_supplicant config
  11. -config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
  12. - bool "Disable timestamp check"
  13. - depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini
  14. - default n
  15. - help
  16. - This disables the timestamp check for certificates in wpa_supplicant
  17. - Useful for devices without RTC that cannot reliably get the real date/time
  18. -
  19. -choice
  20. - prompt "Choose TLS provider"
  21. - default WPA_SUPPLICANT_INTERNAL
  22. - depends PACKAGE_wpa-supplicant || PACKAGE_wpad
  23. -
  24. -config WPA_SUPPLICANT_INTERNAL
  25. - bool "internal"
  26. -
  27. -config WPA_SUPPLICANT_OPENSSL
  28. - bool "openssl"
  29. - select PACKAGE_libopenssl
  30. -
  31. -endchoice
  32. -
  33. -config WPA_RFKILL_SUPPORT
  34. - bool "Add rfkill support"
  35. - depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini
  36. - default n
  37. -
  38. -config WPA_MSG_MIN_PRIORITY
  39. - int "Minimum debug message priority"
  40. - default 3
  41. - help
  42. - Useful values are:
  43. - 0 = all messages
  44. - 1 = raw message dumps
  45. - 2 = most debugging messages
  46. - 3 = info messages
  47. - 4 = warnings
  48. - 5 = errors
  49. -
  50. -config DRIVER_WEXT_SUPPORT
  51. - bool
  52. - default n
  53. -
  54. -config DRIVER_11N_SUPPORT
  55. - bool
  56. - default n
  57. diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
  58. deleted file mode 100644
  59. index 485a8fa..0000000
  60. --- a/package/hostapd/Makefile
  61. +++ /dev/null
  62. @@ -1,346 +0,0 @@
  63. -#
  64. -# Copyright (C) 2006-2012 OpenWrt.org
  65. -#
  66. -# This is free software, licensed under the GNU General Public License v2.
  67. -# See /LICENSE for more information.
  68. -#
  69. -
  70. -include $(TOPDIR)/rules.mk
  71. -
  72. -PKG_NAME:=hostapd
  73. -PKG_VERSION:=20130405
  74. -PKG_RELEASE:=1
  75. -PKG_REV:=f2f66ad7e805218468aa041985dccaf8719c296e
  76. -
  77. -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  78. -PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
  79. -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  80. -PKG_SOURCE_VERSION:=$(PKG_REV)
  81. -PKG_SOURCE_PROTO:=git
  82. -PKG_MIRROR_MD5SUM:=5dff9bc3b8fbd9ef8a66273d5adee5a3
  83. -
  84. -PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  85. -
  86. -PKG_BUILD_PARALLEL:=1
  87. -
  88. -PKG_BUILD_DEPENDS:= \
  89. - PACKAGE_kmod-madwifi:madwifi \
  90. -
  91. -PKG_CONFIG_DEPENDS:= \
  92. - CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
  93. - CONFIG_PACKAGE_kmod-ath9k \
  94. - CONFIG_PACKAGE_kmod-mac80211 \
  95. - CONFIG_PACKAGE_kmod-madwifi \
  96. - CONFIG_PACKAGE_hostapd \
  97. - CONFIG_PACKAGE_hostapd-mini \
  98. - CONFIG_PACKAGE_kmod-hostap \
  99. - CONFIG_WPA_RFKILL_SUPPORT \
  100. - CONFIG_DRIVER_WEXT_SUPPORT \
  101. - CONFIG_DRIVER_11N_SUPPORT
  102. -
  103. -LOCAL_TYPE=$(strip \
  104. - $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
  105. - $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
  106. - hostapd \
  107. - )))
  108. -LOCAL_VARIANT=$(patsubst wpad-%,%,$(patsubst supplicant-%,%,$(BUILD_VARIANT)))
  109. -
  110. -ifeq ($(LOCAL_TYPE),supplicant)
  111. - ifeq ($(LOCAL_VARIANT),full)
  112. - PKG_CONFIG_DEPENDS += \
  113. - CONFIG_WPA_SUPPLICANT_INTERNAL \
  114. - CONFIG_WPA_SUPPLICANT_OPENSSL
  115. - endif
  116. -endif
  117. -
  118. -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  119. -
  120. -include $(INCLUDE_DIR)/package.mk
  121. -
  122. -STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
  123. -
  124. -ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
  125. - HOSTAPD_IEEE80211N:=y
  126. -endif
  127. -
  128. -DRIVER_MAKEOPTS= \
  129. - CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
  130. - CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
  131. - CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
  132. - CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
  133. - CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \
  134. - CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
  135. - $(if $(CONFIG_WPA_RFKILL_SUPPORT),NEED_RFKILL=y)
  136. -
  137. -ifneq ($(LOCAL_TYPE),hostapd)
  138. - ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
  139. - ifeq ($(LOCAL_VARIANT),full)
  140. - DRIVER_MAKEOPTS += CONFIG_TLS=openssl
  141. - TARGET_LDFLAGS += -lcrypto -lssl
  142. - endif
  143. - endif
  144. - ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
  145. - TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
  146. - endif
  147. - DRIVER_MAKEOPTS += \
  148. - CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
  149. -endif
  150. -
  151. -DRV_DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny @(!TARGET_avr32||BROKEN)
  152. -
  153. -define Package/hostapd/Default
  154. - SECTION:=net
  155. - CATEGORY:=Network
  156. - TITLE:=IEEE 802.1x Authenticator
  157. - URL:=http://hostap.epitest.fi/
  158. - DEPENDS:=$(DRV_DEPENDS) +libubus
  159. -endef
  160. -
  161. -define Package/hostapd
  162. -$(call Package/hostapd/Default)
  163. - TITLE+= (full)
  164. - VARIANT:=full
  165. -endef
  166. -
  167. -define Package/hostapd/description
  168. - This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
  169. - Authenticator.
  170. -endef
  171. -
  172. -define Package/hostapd-mini
  173. -$(call Package/hostapd/Default)
  174. - TITLE+= (WPA-PSK only)
  175. - VARIANT:=mini
  176. -endef
  177. -
  178. -define Package/hostapd-mini/description
  179. - This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
  180. -endef
  181. -
  182. -define Package/hostapd-utils
  183. - $(call Package/hostapd/Default)
  184. - TITLE+= (utils)
  185. - DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
  186. -endef
  187. -
  188. -define Package/hostapd-utils/description
  189. - This package contains a command line utility to control the
  190. - IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
  191. -endef
  192. -
  193. -define Package/wpad/Default
  194. - SECTION:=net
  195. - CATEGORY:=Network
  196. - TITLE:=IEEE 802.1x Authenticator/Supplicant
  197. - URL:=http://hostap.epitest.fi/
  198. -endef
  199. -
  200. -define Package/wpad
  201. -$(call Package/wpad/Default)
  202. - TITLE+= (full)
  203. - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +libubus
  204. - VARIANT:=wpad-full
  205. -endef
  206. -
  207. -define Package/wpad/description
  208. - This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
  209. - Authenticator and Supplicant
  210. -endef
  211. -
  212. -define Package/wpad-mini
  213. -$(call Package/wpad/Default)
  214. - TITLE+= (WPA-PSK only)
  215. - DEPENDS:=$(DRV_DEPENDS) +libubus
  216. - VARIANT:=wpad-mini
  217. -endef
  218. -
  219. -define Package/wpad-mini/description
  220. - This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
  221. -endef
  222. -
  223. -define Package/wpa-supplicant
  224. - SECTION:=net
  225. - CATEGORY:=Network
  226. - TITLE:=WPA Supplicant
  227. - URL:=http://hostap.epitest.fi/wpa_supplicant/
  228. - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
  229. - VARIANT:=supplicant-full
  230. -endef
  231. -
  232. -define Package/wpa-supplicant/Description
  233. - WPA Supplicant
  234. -endef
  235. -
  236. -define Package/wpa-supplicant/config
  237. - source "$(SOURCE)/Config.in"
  238. -endef
  239. -
  240. -define Package/wpa-supplicant-mini
  241. - $(Package/wpa-supplicant)
  242. - TITLE:=WPA Supplicant (minimal version)
  243. - DEPENDS:=$(DRV_DEPENDS)
  244. - VARIANT:=supplicant-mini
  245. -endef
  246. -
  247. -define Package/wpa-supplicant-mini/Description
  248. - WPA Supplicant (minimal version)
  249. -endef
  250. -
  251. -define Package/wpa-cli
  252. - SECTION:=net
  253. - CATEGORY:=Network
  254. - DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad
  255. - TITLE:=WPA Supplicant command line interface
  256. -endef
  257. -
  258. -define Package/wpa-cli/Description
  259. - WPA Supplicant control utility
  260. -endef
  261. -
  262. -
  263. -ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
  264. - define Build/Configure/rebuild
  265. - $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
  266. - rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
  267. - rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
  268. - rm -f $(PKG_BUILD_DIR)/.config_*
  269. - touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
  270. - endef
  271. -endif
  272. -
  273. -define Build/Configure
  274. - $(Build/Configure/rebuild)
  275. - $(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config
  276. - $(CP) ./files/wpa_supplicant-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
  277. -endef
  278. -
  279. -TARGET_CPPFLAGS := \
  280. - -I$(STAGING_DIR)/usr/include/libnl-tiny \
  281. - -I$(PKG_BUILD_DIR)/src/crypto \
  282. - $(TARGET_CPPFLAGS) \
  283. - -I$(CURDIR)/madwifi \
  284. - -DCONFIG_LIBNL20 \
  285. - -D_GNU_SOURCE \
  286. - $(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
  287. -
  288. -TARGET_CFLAGS += -ffunction-sections -fdata-sections
  289. -TARGET_LDFLAGS += -Wl,--gc-sections
  290. -ifeq ($(findstring supplicant,$(BUILD_VARIANT)),)
  291. - TARGET_LDFLAGS += -lubox -lubus
  292. -endif
  293. -
  294. -ifdef CONFIG_PACKAGE_kmod-mac80211
  295. - TARGET_LDFLAGS += -lm -lnl-tiny
  296. -endif
  297. -
  298. -define Build/RunMake
  299. - CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  300. - $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
  301. - $(TARGET_CONFIGURE_OPTS) \
  302. - $(DRIVER_MAKEOPTS) \
  303. - LIBS="$(TARGET_LDFLAGS)" \
  304. - BCHECK= \
  305. - $(2)
  306. -endef
  307. -
  308. -define Build/Compile/wpad
  309. - echo ` \
  310. - $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
  311. - $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
  312. - sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
  313. - ` > $(PKG_BUILD_DIR)/.cflags
  314. - +$(call Build/RunMake,hostapd, \
  315. - CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
  316. - MULTICALL=1 \
  317. - hostapd_cli hostapd_multi.a \
  318. - )
  319. - +$(call Build/RunMake,wpa_supplicant, \
  320. - CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
  321. - MULTICALL=1 \
  322. - wpa_cli wpa_supplicant_multi.a \
  323. - )
  324. - $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
  325. - $(TARGET_CFLAGS) \
  326. - ./files/multicall.c \
  327. - $(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
  328. - $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
  329. - $(TARGET_LDFLAGS)
  330. -endef
  331. -
  332. -define Build/Compile/hostapd
  333. - $(call Build/RunMake,hostapd, \
  334. - hostapd hostapd_cli \
  335. - )
  336. -endef
  337. -
  338. -define Build/Compile/supplicant
  339. - $(call Build/RunMake,wpa_supplicant, \
  340. - wpa_cli wpa_supplicant \
  341. - )
  342. -endef
  343. -
  344. -define Build/Compile
  345. - $(Build/Compile/$(LOCAL_TYPE))
  346. -endef
  347. -
  348. -define Install/hostapd
  349. - $(INSTALL_DIR) $(1)/lib/wifi
  350. - $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
  351. - $(INSTALL_DIR) $(1)/usr/sbin
  352. -endef
  353. -
  354. -define Install/supplicant
  355. - $(INSTALL_DIR) $(1)/lib/wifi
  356. - $(INSTALL_DATA) ./files/wpa_supplicant.sh $(1)/lib/wifi/wpa_supplicant.sh
  357. - $(INSTALL_DIR) $(1)/usr/sbin
  358. -endef
  359. -
  360. -define Package/hostapd/install
  361. - $(call Install/hostapd,$(1))
  362. - $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
  363. -endef
  364. -Package/hostapd-mini/install = $(Package/hostapd/install)
  365. -
  366. -ifneq ($(LOCAL_TYPE),supplicant)
  367. - define Package/hostapd-utils/install
  368. - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/hotplug.d/button
  369. - $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
  370. - $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps
  371. - $(if $(CONFIG_PROCD_INIT),
  372. - $(INSTALL_DIR) $(1)/etc/rc.button/
  373. - $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps,
  374. - $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps
  375. - )
  376. - endef
  377. -endif
  378. -
  379. -define Package/wpad/install
  380. - $(call Install/hostapd,$(1))
  381. - $(call Install/supplicant,$(1))
  382. - $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
  383. - ln -sf wpad $(1)/usr/sbin/hostapd
  384. - ln -sf wpad $(1)/usr/sbin/wpa_supplicant
  385. -endef
  386. -Package/wpad-mini/install = $(Package/wpad/install)
  387. -
  388. -define Package/wpa-supplicant/install
  389. - $(call Install/supplicant,$(1))
  390. - $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
  391. -endef
  392. -Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
  393. -
  394. -ifneq ($(LOCAL_TYPE),hostapd)
  395. - define Package/wpa-cli/install
  396. - $(INSTALL_DIR) $(1)/usr/sbin
  397. - $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
  398. - endef
  399. -endif
  400. -
  401. -$(eval $(call BuildPackage,hostapd))
  402. -$(eval $(call BuildPackage,hostapd-mini))
  403. -$(eval $(call BuildPackage,wpad))
  404. -$(eval $(call BuildPackage,wpad-mini))
  405. -$(eval $(call BuildPackage,wpa-supplicant))
  406. -$(eval $(call BuildPackage,wpa-supplicant-mini))
  407. -$(eval $(call BuildPackage,wpa-cli))
  408. -$(eval $(call BuildPackage,hostapd-utils))
  409. diff --git a/package/hostapd/files/hostapd-full.config b/package/hostapd/files/hostapd-full.config
  410. deleted file mode 100644
  411. index d558736..0000000
  412. --- a/package/hostapd/files/hostapd-full.config
  413. +++ /dev/null
  414. @@ -1,164 +0,0 @@
  415. -# Example hostapd build time configuration
  416. -#
  417. -# This file lists the configuration options that are used when building the
  418. -# hostapd binary. All lines starting with # are ignored. Configuration option
  419. -# lines must be commented out complete, if they are not to be included, i.e.,
  420. -# just setting VARIABLE=n is not disabling that variable.
  421. -#
  422. -# This file is included in Makefile, so variables like CFLAGS and LIBS can also
  423. -# be modified from here. In most cass, these lines should use += in order not
  424. -# to override previous values of the variables.
  425. -
  426. -# Driver interface for Host AP driver
  427. -CONFIG_DRIVER_HOSTAP=y
  428. -
  429. -# Driver interface for wired authenticator
  430. -CONFIG_DRIVER_WIRED=y
  431. -
  432. -# Driver interface for madwifi driver
  433. -CONFIG_DRIVER_MADWIFI=y
  434. -#CFLAGS += -I../../madwifi # change to the madwifi source directory
  435. -
  436. -# Driver interface for Prism54 driver
  437. -#CONFIG_DRIVER_PRISM54=y
  438. -
  439. -# Driver interface for drivers using the nl80211 kernel interface
  440. -CONFIG_DRIVER_NL80211=y
  441. -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be
  442. -# shipped with your distribution yet. If that is the case, you need to build
  443. -# newer libnl version and point the hostapd build to use it.
  444. -#LIBNL=/usr/src/libnl
  445. -#CFLAGS += -I$(LIBNL)/include
  446. -#LIBS += -L$(LIBNL)/lib
  447. -
  448. -# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
  449. -#CONFIG_DRIVER_BSD=y
  450. -#CFLAGS += -I/usr/local/include
  451. -#LIBS += -L/usr/local/lib
  452. -
  453. -# Driver interface for no driver (e.g., RADIUS server only)
  454. -#CONFIG_DRIVER_NONE=y
  455. -
  456. -# IEEE 802.11F/IAPP
  457. -CONFIG_IAPP=y
  458. -
  459. -# WPA2/IEEE 802.11i RSN pre-authentication
  460. -CONFIG_RSN_PREAUTH=y
  461. -
  462. -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
  463. -CONFIG_PEERKEY=y
  464. -
  465. -# IEEE 802.11w (management frame protection)
  466. -# This version is an experimental implementation based on IEEE 802.11w/D1.0
  467. -# draft and is subject to change since the standard has not yet been finalized.
  468. -# Driver support is also needed for IEEE 802.11w.
  469. -#CONFIG_IEEE80211W=y
  470. -
  471. -# Integrated EAP server
  472. -CONFIG_EAP=y
  473. -
  474. -# EAP-MD5 for the integrated EAP server
  475. -CONFIG_EAP_MD5=y
  476. -
  477. -# EAP-TLS for the integrated EAP server
  478. -CONFIG_EAP_TLS=y
  479. -
  480. -# EAP-MSCHAPv2 for the integrated EAP server
  481. -CONFIG_EAP_MSCHAPV2=y
  482. -
  483. -# EAP-PEAP for the integrated EAP server
  484. -CONFIG_EAP_PEAP=y
  485. -
  486. -# EAP-GTC for the integrated EAP server
  487. -CONFIG_EAP_GTC=y
  488. -
  489. -# EAP-TTLS for the integrated EAP server
  490. -CONFIG_EAP_TTLS=y
  491. -
  492. -# EAP-SIM for the integrated EAP server
  493. -#CONFIG_EAP_SIM=y
  494. -
  495. -# EAP-AKA for the integrated EAP server
  496. -#CONFIG_EAP_AKA=y
  497. -
  498. -# EAP-AKA' for the integrated EAP server
  499. -# This requires CONFIG_EAP_AKA to be enabled, too.
  500. -#CONFIG_EAP_AKA_PRIME=y
  501. -
  502. -# EAP-PAX for the integrated EAP server
  503. -#CONFIG_EAP_PAX=y
  504. -
  505. -# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
  506. -#CONFIG_EAP_PSK=y
  507. -
  508. -# EAP-SAKE for the integrated EAP server
  509. -#CONFIG_EAP_SAKE=y
  510. -
  511. -# EAP-GPSK for the integrated EAP server
  512. -#CONFIG_EAP_GPSK=y
  513. -# Include support for optional SHA256 cipher suite in EAP-GPSK
  514. -#CONFIG_EAP_GPSK_SHA256=y
  515. -
  516. -# EAP-FAST for the integrated EAP server
  517. -# Note: Default OpenSSL package does not include support for all the
  518. -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
  519. -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch)
  520. -# to add the needed functions.
  521. -#CONFIG_EAP_FAST=y
  522. -
  523. -# Wi-Fi Protected Setup (WPS)
  524. -#CONFIG_WPS=y
  525. -# Enable UPnP support for external WPS Registrars
  526. -#CONFIG_WPS_UPNP=y
  527. -
  528. -# EAP-IKEv2
  529. -#CONFIG_EAP_IKEV2=y
  530. -
  531. -# Trusted Network Connect (EAP-TNC)
  532. -#CONFIG_EAP_TNC=y
  533. -
  534. -# PKCS#12 (PFX) support (used to read private key and certificate file from
  535. -# a file that usually has extension .p12 or .pfx)
  536. -CONFIG_PKCS12=y
  537. -
  538. -# RADIUS authentication server. This provides access to the integrated EAP
  539. -# server from external hosts using RADIUS.
  540. -#CONFIG_RADIUS_SERVER=y
  541. -
  542. -# Build IPv6 support for RADIUS operations
  543. -CONFIG_IPV6=y
  544. -
  545. -# IEEE Std 802.11r-2008 (Fast BSS Transition)
  546. -CONFIG_IEEE80211R=y
  547. -
  548. -# Use the hostapd's IEEE 802.11 authentication (ACL), but without
  549. -# the IEEE 802.11 Management capability (e.g., madwifi or FreeBSD/net80211)
  550. -#CONFIG_DRIVER_RADIUS_ACL=y
  551. -
  552. -# IEEE 802.11n (High Throughput) support
  553. -CONFIG_IEEE80211N=y
  554. -
  555. -# Remove debugging code that is printing out debug messages to stdout.
  556. -# This can be used to reduce the size of the hostapd considerably if debugging
  557. -# code is not needed.
  558. -#CONFIG_NO_STDOUT_DEBUG=y
  559. -
  560. -# Remove support for RADIUS accounting
  561. -#CONFIG_NO_ACCOUNTING=y
  562. -
  563. -# Remove support for RADIUS
  564. -#CONFIG_NO_RADIUS=y
  565. -
  566. -# Remove support for VLANs
  567. -#CONFIG_NO_VLAN=y
  568. -
  569. -CONFIG_TLS=internal
  570. -CONFIG_INTERNAL_LIBTOMMATH=y
  571. -CONFIG_INTERNAL_AES=y
  572. -NEED_AES_DEC=y
  573. -
  574. -CONFIG_NO_DUMP_STATE=y
  575. -
  576. -CONFIG_WPS=y
  577. -CONFIG_FULL_DYNAMIC_VLAN=y
  578. -
  579. diff --git a/package/hostapd/files/hostapd-mini.config b/package/hostapd/files/hostapd-mini.config
  580. deleted file mode 100644
  581. index 3e94a64..0000000
  582. --- a/package/hostapd/files/hostapd-mini.config
  583. +++ /dev/null
  584. @@ -1,157 +0,0 @@
  585. -# Example hostapd build time configuration
  586. -#
  587. -# This file lists the configuration options that are used when building the
  588. -# hostapd binary. All lines starting with # are ignored. Configuration option
  589. -# lines must be commented out complete, if they are not to be included, i.e.,
  590. -# just setting VARIABLE=n is not disabling that variable.
  591. -#
  592. -# This file is included in Makefile, so variables like CFLAGS and LIBS can also
  593. -# be modified from here. In most cass, these lines should use += in order not
  594. -# to override previous values of the variables.
  595. -
  596. -# Driver interface for Host AP driver
  597. -CONFIG_DRIVER_HOSTAP=y
  598. -
  599. -# Driver interface for wired authenticator
  600. -CONFIG_DRIVER_WIRED=y
  601. -
  602. -# Driver interface for madwifi driver
  603. -CONFIG_DRIVER_MADWIFI=y
  604. -#CFLAGS += -I../../madwifi # change to the madwifi source directory
  605. -
  606. -# Driver interface for Prism54 driver
  607. -#CONFIG_DRIVER_PRISM54=y
  608. -
  609. -# Driver interface for drivers using the nl80211 kernel interface
  610. -CONFIG_DRIVER_NL80211=y
  611. -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be
  612. -# shipped with your distribution yet. If that is the case, you need to build
  613. -# newer libnl version and point the hostapd build to use it.
  614. -#LIBNL=/usr/src/libnl
  615. -#CFLAGS += -I$(LIBNL)/include
  616. -#LIBS += -L$(LIBNL)/lib
  617. -
  618. -# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
  619. -#CONFIG_DRIVER_BSD=y
  620. -#CFLAGS += -I/usr/local/include
  621. -#LIBS += -L/usr/local/lib
  622. -
  623. -# Driver interface for no driver (e.g., RADIUS server only)
  624. -#CONFIG_DRIVER_NONE=y
  625. -
  626. -# IEEE 802.11F/IAPP
  627. -# CONFIG_IAPP=y
  628. -
  629. -# WPA2/IEEE 802.11i RSN pre-authentication
  630. -CONFIG_RSN_PREAUTH=y
  631. -
  632. -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
  633. -CONFIG_PEERKEY=y
  634. -
  635. -# IEEE 802.11w (management frame protection)
  636. -# This version is an experimental implementation based on IEEE 802.11w/D1.0
  637. -# draft and is subject to change since the standard has not yet been finalized.
  638. -# Driver support is also needed for IEEE 802.11w.
  639. -#CONFIG_IEEE80211W=y
  640. -
  641. -# Integrated EAP server
  642. -#CONFIG_EAP=y
  643. -
  644. -# EAP-MD5 for the integrated EAP server
  645. -#CONFIG_EAP_MD5=y
  646. -
  647. -# EAP-TLS for the integrated EAP server
  648. -#CONFIG_EAP_TLS=y
  649. -
  650. -# EAP-MSCHAPv2 for the integrated EAP server
  651. -#CONFIG_EAP_MSCHAPV2=y
  652. -
  653. -# EAP-PEAP for the integrated EAP server
  654. -#CONFIG_EAP_PEAP=y
  655. -
  656. -# EAP-GTC for the integrated EAP server
  657. -#CONFIG_EAP_GTC=y
  658. -
  659. -# EAP-TTLS for the integrated EAP server
  660. -#CONFIG_EAP_TTLS=y
  661. -
  662. -# EAP-SIM for the integrated EAP server
  663. -#CONFIG_EAP_SIM=y
  664. -
  665. -# EAP-AKA for the integrated EAP server
  666. -#CONFIG_EAP_AKA=y
  667. -
  668. -# EAP-AKA' for the integrated EAP server
  669. -# This requires CONFIG_EAP_AKA to be enabled, too.
  670. -#CONFIG_EAP_AKA_PRIME=y
  671. -
  672. -# EAP-PAX for the integrated EAP server
  673. -#CONFIG_EAP_PAX=y
  674. -
  675. -# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
  676. -#CONFIG_EAP_PSK=y
  677. -
  678. -# EAP-SAKE for the integrated EAP server
  679. -#CONFIG_EAP_SAKE=y
  680. -
  681. -# EAP-GPSK for the integrated EAP server
  682. -#CONFIG_EAP_GPSK=y
  683. -# Include support for optional SHA256 cipher suite in EAP-GPSK
  684. -#CONFIG_EAP_GPSK_SHA256=y
  685. -
  686. -# EAP-FAST for the integrated EAP server
  687. -# Note: Default OpenSSL package does not include support for all the
  688. -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
  689. -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch)
  690. -# to add the needed functions.
  691. -#CONFIG_EAP_FAST=y
  692. -
  693. -# Wi-Fi Protected Setup (WPS)
  694. -#CONFIG_WPS=y
  695. -# Enable UPnP support for external WPS Registrars
  696. -#CONFIG_WPS_UPNP=y
  697. -
  698. -# EAP-IKEv2
  699. -#CONFIG_EAP_IKEV2=y
  700. -
  701. -# Trusted Network Connect (EAP-TNC)
  702. -#CONFIG_EAP_TNC=y
  703. -
  704. -# PKCS#12 (PFX) support (used to read private key and certificate file from
  705. -# a file that usually has extension .p12 or .pfx)
  706. -#CONFIG_PKCS12=y
  707. -
  708. -# RADIUS authentication server. This provides access to the integrated EAP
  709. -# server from external hosts using RADIUS.
  710. -#CONFIG_RADIUS_SERVER=y
  711. -
  712. -# Build IPv6 support for RADIUS operations
  713. -#CONFIG_IPV6=y
  714. -
  715. -# IEEE Std 802.11r-2008 (Fast BSS Transition)
  716. -#CONFIG_IEEE80211R=y
  717. -
  718. -# Use the hostapd's IEEE 802.11 authentication (ACL), but without
  719. -# the IEEE 802.11 Management capability (e.g., madwifi or FreeBSD/net80211)
  720. -#CONFIG_DRIVER_RADIUS_ACL=y
  721. -
  722. -# IEEE 802.11n (High Throughput) support
  723. -CONFIG_IEEE80211N=y
  724. -
  725. -# Remove debugging code that is printing out debug messages to stdout.
  726. -# This can be used to reduce the size of the hostapd considerably if debugging
  727. -# code is not needed.
  728. -#CONFIG_NO_STDOUT_DEBUG=y
  729. -
  730. -# Remove support for RADIUS accounting
  731. -CONFIG_NO_ACCOUNTING=y
  732. -
  733. -# Remove support for RADIUS
  734. -CONFIG_NO_RADIUS=y
  735. -
  736. -# Remove support for VLANs
  737. -#CONFIG_NO_VLAN=y
  738. -
  739. -CONFIG_TLS=internal
  740. -
  741. -CONFIG_NO_DUMP_STATE=y
  742. diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
  743. deleted file mode 100644
  744. index 00c6a09..0000000
  745. --- a/package/hostapd/files/hostapd.sh
  746. +++ /dev/null
  747. @@ -1,301 +0,0 @@
  748. -hostapd_set_bss_options() {
  749. - local var="$1"
  750. - local vif="$2"
  751. - local enc wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wps_possible
  752. -
  753. - config_get enc "$vif" encryption
  754. - config_get wep_rekey "$vif" wep_rekey # 300
  755. - config_get wpa_group_rekey "$vif" wpa_group_rekey # 300
  756. - config_get wpa_pair_rekey "$vif" wpa_pair_rekey # 300
  757. - config_get wpa_master_rekey "$vif" wpa_master_rekey # 640
  758. - config_get_bool ap_isolate "$vif" isolate 0
  759. - config_get_bool disassoc_low_ack "$vif" disassoc_low_ack 1
  760. - config_get max_num_sta "$vif" max_num_sta 0
  761. - config_get max_inactivity "$vif" max_inactivity 0
  762. - config_get_bool preamble "$vif" short_preamble 1
  763. -
  764. - config_get device "$vif" device
  765. - config_get hwmode "$device" hwmode
  766. - config_get phy "$device" phy
  767. -
  768. - append "$var" "ctrl_interface=/var/run/hostapd-$phy" "$N"
  769. -
  770. - if [ "$ap_isolate" -gt 0 ]; then
  771. - append "$var" "ap_isolate=$ap_isolate" "$N"
  772. - fi
  773. - if [ "$max_num_sta" -gt 0 ]; then
  774. - append "$var" "max_num_sta=$max_num_sta" "$N"
  775. - fi
  776. - if [ "$max_inactivity" -gt 0 ]; then
  777. - append "$var" "ap_max_inactivity=$max_inactivity" "$N"
  778. - fi
  779. - append "$var" "disassoc_low_ack=$disassoc_low_ack" "$N"
  780. - if [ "$preamble" -gt 0 ]; then
  781. - append "$var" "preamble=$preamble" "$N"
  782. - fi
  783. -
  784. - # Examples:
  785. - # psk-mixed/tkip => WPA1+2 PSK, TKIP
  786. - # wpa-psk2/tkip+aes => WPA2 PSK, CCMP+TKIP
  787. - # wpa2/tkip+aes => WPA2 RADIUS, CCMP+TKIP
  788. - # ...
  789. -
  790. - # TODO: move this parsing function somewhere generic, so that
  791. - # later it can be reused by drivers that don't use hostapd
  792. -
  793. - # crypto defaults: WPA2 vs WPA1
  794. - case "$enc" in
  795. - wpa2*|*psk2*)
  796. - wpa=2
  797. - crypto="CCMP"
  798. - ;;
  799. - *mixed*)
  800. - wpa=3
  801. - crypto="CCMP TKIP"
  802. - ;;
  803. - *)
  804. - wpa=1
  805. - crypto="TKIP"
  806. - ;;
  807. - esac
  808. -
  809. - # explicit override for crypto setting
  810. - case "$enc" in
  811. - *tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) crypto="CCMP TKIP";;
  812. - *aes|*ccmp) crypto="CCMP";;
  813. - *tkip) crypto="TKIP";;
  814. - esac
  815. -
  816. - # enforce CCMP for 11ng and 11na
  817. - case "$hwmode:$crypto" in
  818. - *ng:TKIP|*na:TKIP) crypto="CCMP TKIP";;
  819. - esac
  820. -
  821. - # use crypto/auth settings for building the hostapd config
  822. - case "$enc" in
  823. - *psk*)
  824. - config_get psk "$vif" key
  825. - if [ ${#psk} -eq 64 ]; then
  826. - append "$var" "wpa_psk=$psk" "$N"
  827. - else
  828. - append "$var" "wpa_passphrase=$psk" "$N"
  829. - fi
  830. - wps_possible=1
  831. - [ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
  832. - [ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
  833. - [ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
  834. - ;;
  835. - *wpa*)
  836. - # required fields? formats?
  837. - # hostapd is particular, maybe a default configuration for failures
  838. - config_get auth_server "$vif" auth_server
  839. - [ -z "$auth_server" ] && config_get auth_server "$vif" server
  840. - append "$var" "auth_server_addr=$auth_server" "$N"
  841. - config_get auth_port "$vif" auth_port
  842. - [ -z "$auth_port" ] && config_get auth_port "$vif" port
  843. - auth_port=${auth_port:-1812}
  844. - append "$var" "auth_server_port=$auth_port" "$N"
  845. - config_get auth_secret "$vif" auth_secret
  846. - [ -z "$auth_secret" ] && config_get auth_secret "$vif" key
  847. - append "$var" "auth_server_shared_secret=$auth_secret" "$N"
  848. - config_get_bool auth_cache "$vif" auth_cache 0
  849. - [ "$auth_cache" -gt 0 ] || append "$var" "disable_pmksa_caching=1" "$N"
  850. - [ "$auth_cache" -gt 0 ] || append "$var" "okc=0" "$N"
  851. - config_get acct_server "$vif" acct_server
  852. - [ -n "$acct_server" ] && append "$var" "acct_server_addr=$acct_server" "$N"
  853. - config_get acct_port "$vif" acct_port
  854. - [ -n "$acct_port" ] && acct_port=${acct_port:-1813}
  855. - [ -n "$acct_port" ] && append "$var" "acct_server_port=$acct_port" "$N"
  856. - config_get acct_secret "$vif" acct_secret
  857. - [ -n "$acct_secret" ] && append "$var" "acct_server_shared_secret=$acct_secret" "$N"
  858. - config_get nasid "$vif" nasid
  859. - append "$var" "nas_identifier=$nasid" "$N"
  860. - append "$var" "eapol_key_index_workaround=1" "$N"
  861. - append "$var" "ieee8021x=1" "$N"
  862. - append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
  863. - [ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
  864. - [ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
  865. - [ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
  866. - ;;
  867. - *wep*)
  868. - config_get key "$vif" key
  869. - key="${key:-1}"
  870. - case "$key" in
  871. - [1234])
  872. - for idx in 1 2 3 4; do
  873. - local zidx
  874. - zidx=$(($idx - 1))
  875. - config_get ckey "$vif" "key${idx}"
  876. - [ -n "$ckey" ] && \
  877. - append "$var" "wep_key${zidx}=$(prepare_key_wep "$ckey")" "$N"
  878. - done
  879. - append "$var" "wep_default_key=$((key - 1))" "$N"
  880. - ;;
  881. - *)
  882. - append "$var" "wep_key0=$(prepare_key_wep "$key")" "$N"
  883. - append "$var" "wep_default_key=0" "$N"
  884. - [ -n "$wep_rekey" ] && append "$var" "wep_rekey_period=$wep_rekey" "$N"
  885. - ;;
  886. - esac
  887. - case "$enc" in
  888. - *shared*)
  889. - auth_algs=2
  890. - ;;
  891. - *mixed*)
  892. - auth_algs=3
  893. - ;;
  894. - esac
  895. - wpa=0
  896. - crypto=
  897. - ;;
  898. - *)
  899. - wpa=0
  900. - crypto=
  901. - ;;
  902. - esac
  903. - append "$var" "auth_algs=${auth_algs:-1}" "$N"
  904. - append "$var" "wpa=$wpa" "$N"
  905. - [ -n "$crypto" ] && append "$var" "wpa_pairwise=$crypto" "$N"
  906. - [ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
  907. -
  908. - config_get ssid "$vif" ssid
  909. - config_get bridge "$vif" bridge
  910. - config_get ieee80211d "$vif" ieee80211d
  911. - config_get iapp_interface "$vif" iapp_interface
  912. -
  913. - config_get_bool wps_pbc "$vif" wps_pushbutton 0
  914. - config_get_bool wps_label "$vif" wps_label 0
  915. -
  916. - config_get config_methods "$vif" wps_config
  917. - [ "$wps_pbc" -gt 0 ] && append config_methods push_button
  918. -
  919. - [ -n "$wps_possible" -a -n "$config_methods" ] && {
  920. - config_get device_type "$vif" wps_device_type "6-0050F204-1"
  921. - config_get device_name "$vif" wps_device_name "OpenWrt AP"
  922. - config_get manufacturer "$vif" wps_manufacturer "openwrt.org"
  923. -
  924. - append "$var" "eap_server=1" "$N"
  925. - append "$var" "wps_state=2" "$N"
  926. - append "$var" "ap_setup_locked=1" "$N"
  927. - append "$var" "device_type=$device_type" "$N"
  928. - append "$var" "device_name=$device_name" "$N"
  929. - append "$var" "manufacturer=$manufacturer" "$N"
  930. - append "$var" "config_methods=$config_methods" "$N"
  931. - }
  932. -
  933. - append "$var" "ssid=$ssid" "$N"
  934. - [ -n "$bridge" ] && append "$var" "bridge=$bridge" "$N"
  935. - [ -n "$ieee80211d" ] && append "$var" "ieee80211d=$ieee80211d" "$N"
  936. - [ -n "$iapp_interface" ] && append "$var" iapp_interface=$(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N"
  937. -
  938. - if [ "$wpa" -ge "2" ]
  939. - then
  940. - # RSN -> allow preauthentication
  941. - config_get_bool rsn_preauth "$vif" rsn_preauth "$auth_cache"
  942. - if [ -n "$bridge" -a "$rsn_preauth" = 1 ]
  943. - then
  944. - append "$var" "rsn_preauth=1" "$N"
  945. - append "$var" "rsn_preauth_interfaces=$bridge" "$N"
  946. - fi
  947. -
  948. - # RSN -> allow management frame protection
  949. - config_get ieee80211w "$vif" ieee80211w
  950. - case "$ieee80211w" in
  951. - [012])
  952. - append "$var" "ieee80211w=$ieee80211w" "$N"
  953. - [ "$ieee80211w" -gt "0" ] && {
  954. - config_get ieee80211w_max_timeout "$vif" ieee80211w_max_timeout
  955. - config_get ieee80211w_retry_timeout "$vif" ieee80211w_retry_timeout
  956. - [ -n "$ieee80211w_max_timeout" ] && \
  957. - append "$var" "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N"
  958. - [ -n "$ieee80211w_retry_timeout" ] && \
  959. - append "$var" "assoc_sa_query_retry_timeout=$ieee80211w_retry_timeout" "$N"
  960. - }
  961. - ;;
  962. - esac
  963. - fi
  964. -
  965. - config_get macfilter "$vif" macfilter
  966. - macfile="/var/run/hostapd-$ifname.maclist"
  967. - [ -e "$macfile" ] && rm -f "$macfile"
  968. -
  969. - case "$macfilter" in
  970. - allow)
  971. - append "$var" "macaddr_acl=1" "$N"
  972. - append "$var" "accept_mac_file=$macfile" "$N"
  973. - ;;
  974. - deny)
  975. - append "$var" "macaddr_acl=0" "$N"
  976. - append "$var" "deny_mac_file=$macfile" "$N"
  977. - ;;
  978. - esac
  979. - config_get maclist "$vif" maclist
  980. - [ -n "$maclist" ] && {
  981. - for mac in $maclist; do
  982. - echo "$mac" >> $macfile
  983. - done
  984. - }
  985. -}
  986. -
  987. -hostapd_set_log_options() {
  988. - local var="$1"
  989. - local cfg="$2"
  990. - local log_level log_80211 log_8021x log_radius log_wpa log_driver log_iapp log_mlme
  991. -
  992. - config_get log_level "$cfg" log_level 2
  993. -
  994. - config_get_bool log_80211 "$cfg" log_80211 1
  995. - config_get_bool log_8021x "$cfg" log_8021x 1
  996. - config_get_bool log_radius "$cfg" log_radius 1
  997. - config_get_bool log_wpa "$cfg" log_wpa 1
  998. - config_get_bool log_driver "$cfg" log_driver 1
  999. - config_get_bool log_iapp "$cfg" log_iapp 1
  1000. - config_get_bool log_mlme "$cfg" log_mlme 1
  1001. -
  1002. - local log_mask=$(( \
  1003. - ($log_80211 << 0) | \
  1004. - ($log_8021x << 1) | \
  1005. - ($log_radius << 2) | \
  1006. - ($log_wpa << 3) | \
  1007. - ($log_driver << 4) | \
  1008. - ($log_iapp << 5) | \
  1009. - ($log_mlme << 6) \
  1010. - ))
  1011. -
  1012. - append "$var" "logger_syslog=$log_mask" "$N"
  1013. - append "$var" "logger_syslog_level=$log_level" "$N"
  1014. - append "$var" "logger_stdout=$log_mask" "$N"
  1015. - append "$var" "logger_stdout_level=$log_level" "$N"
  1016. -}
  1017. -
  1018. -hostapd_setup_vif() {
  1019. - local vif="$1"
  1020. - local driver="$2"
  1021. - local ifname device channel hwmode
  1022. -
  1023. - hostapd_cfg=
  1024. -
  1025. - config_get ifname "$vif" ifname
  1026. - config_get device "$vif" device
  1027. - config_get channel "$device" channel
  1028. - config_get hwmode "$device" hwmode
  1029. -
  1030. - hostapd_set_log_options hostapd_cfg "$device"
  1031. - hostapd_set_bss_options hostapd_cfg "$vif"
  1032. -
  1033. - case "$hwmode" in
  1034. - *bg|*gdt|*gst|*fh) hwmode=g;;
  1035. - *adt|*ast) hwmode=a;;
  1036. - esac
  1037. - [ "$channel" = auto ] && channel=
  1038. - [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
  1039. - cat > /var/run/hostapd-$ifname.conf <<EOF
  1040. -driver=$driver
  1041. -interface=$ifname
  1042. -${hwmode:+hw_mode=${hwmode#11}}
  1043. -${channel:+channel=$channel}
  1044. -$hostapd_cfg
  1045. -EOF
  1046. - hostapd -P /var/run/wifi-$ifname.pid -B /var/run/hostapd-$ifname.conf
  1047. -}
  1048. -
  1049. diff --git a/package/hostapd/files/multicall.c b/package/hostapd/files/multicall.c
  1050. deleted file mode 100644
  1051. index c8e814b..0000000
  1052. --- a/package/hostapd/files/multicall.c
  1053. +++ /dev/null
  1054. @@ -1,28 +0,0 @@
  1055. -#include <stdio.h>
  1056. -#include <string.h>
  1057. -#include <stdbool.h>
  1058. -
  1059. -extern int hostapd_main(int argc, char **argv);
  1060. -extern int wpa_supplicant_main(int argc, char **argv);
  1061. -
  1062. -int main(int argc, char **argv)
  1063. -{
  1064. - bool restart = false;
  1065. - const char *prog = argv[0];
  1066. -
  1067. -restart:
  1068. - if (strstr(argv[0], "hostapd"))
  1069. - return hostapd_main(argc, argv);
  1070. - else if (strstr(argv[0], "wpa_supplicant"))
  1071. - return wpa_supplicant_main(argc, argv);
  1072. -
  1073. - if (!restart && argc > 1) {
  1074. - argv++;
  1075. - argc--;
  1076. - restart = true;
  1077. - goto restart;
  1078. - }
  1079. -
  1080. - fprintf(stderr, "Invalid command.\nUsage: %s wpa_supplicant|hostapd [<arguments>]\n", prog);
  1081. - return 255;
  1082. -}
  1083. diff --git a/package/hostapd/files/wpa_supplicant-full.config b/package/hostapd/files/wpa_supplicant-full.config
  1084. deleted file mode 100644
  1085. index f5abbad..0000000
  1086. --- a/package/hostapd/files/wpa_supplicant-full.config
  1087. +++ /dev/null
  1088. @@ -1,408 +0,0 @@
  1089. -# Example wpa_supplicant build time configuration
  1090. -#
  1091. -# This file lists the configuration options that are used when building the
  1092. -# hostapd binary. All lines starting with # are ignored. Configuration option
  1093. -# lines must be commented out complete, if they are not to be included, i.e.,
  1094. -# just setting VARIABLE=n is not disabling that variable.
  1095. -#
  1096. -# This file is included in Makefile, so variables like CFLAGS and LIBS can also
  1097. -# be modified from here. In most cases, these lines should use += in order not
  1098. -# to override previous values of the variables.
  1099. -
  1100. -
  1101. -# Uncomment following two lines and fix the paths if you have installed OpenSSL
  1102. -# or GnuTLS in non-default location
  1103. -#CFLAGS += -I/usr/local/openssl/include
  1104. -#LIBS += -L/usr/local/openssl/lib
  1105. -
  1106. -# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
  1107. -# the kerberos files are not in the default include path. Following line can be
  1108. -# used to fix build issues on such systems (krb5.h not found).
  1109. -#CFLAGS += -I/usr/include/kerberos
  1110. -
  1111. -# Example configuration for various cross-compilation platforms
  1112. -
  1113. -#### sveasoft (e.g., for Linksys WRT54G) ######################################
  1114. -#CC=mipsel-uclibc-gcc
  1115. -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
  1116. -#CFLAGS += -Os
  1117. -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
  1118. -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
  1119. -###############################################################################
  1120. -
  1121. -#### openwrt (e.g., for Linksys WRT54G) #######################################
  1122. -#CC=mipsel-uclibc-gcc
  1123. -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
  1124. -#CFLAGS += -Os
  1125. -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
  1126. -# -I../WRT54GS/release/src/include
  1127. -#LIBS = -lssl
  1128. -###############################################################################
  1129. -
  1130. -
  1131. -# Driver interface for Host AP driver
  1132. -CONFIG_DRIVER_HOSTAP=y
  1133. -
  1134. -# Driver interface for Agere driver
  1135. -#CONFIG_DRIVER_HERMES=y
  1136. -# Change include directories to match with the local setup
  1137. -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf
  1138. -#CFLAGS += -I../../include/wireless
  1139. -
  1140. -# Driver interface for madwifi driver
  1141. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1142. -#CONFIG_DRIVER_MADWIFI=y
  1143. -# Set include directory to the madwifi source tree
  1144. -#CFLAGS += -I../../madwifi
  1145. -
  1146. -# Driver interface for ndiswrapper
  1147. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1148. -#CONFIG_DRIVER_NDISWRAPPER=y
  1149. -
  1150. -# Driver interface for Atmel driver
  1151. -# CONFIG_DRIVER_ATMEL=y
  1152. -
  1153. -# Driver interface for old Broadcom driver
  1154. -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports
  1155. -# Linux wireless extensions and does not need (or even work) with the old
  1156. -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver.
  1157. -#CONFIG_DRIVER_BROADCOM=y
  1158. -# Example path for wlioctl.h; change to match your configuration
  1159. -#CFLAGS += -I/opt/WRT54GS/release/src/include
  1160. -
  1161. -# Driver interface for Intel ipw2100/2200 driver
  1162. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1163. -#CONFIG_DRIVER_IPW=y
  1164. -
  1165. -# Driver interface for Ralink driver
  1166. -#CONFIG_DRIVER_RALINK=y
  1167. -
  1168. -# Driver interface for generic Linux wireless extensions
  1169. -CONFIG_DRIVER_WEXT=y
  1170. -
  1171. -# Driver interface for Linux drivers using the nl80211 kernel interface
  1172. -CONFIG_DRIVER_NL80211=y
  1173. -
  1174. -# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
  1175. -#CONFIG_DRIVER_BSD=y
  1176. -#CFLAGS += -I/usr/local/include
  1177. -#LIBS += -L/usr/local/lib
  1178. -#LIBS_p += -L/usr/local/lib
  1179. -#LIBS_c += -L/usr/local/lib
  1180. -
  1181. -# Driver interface for Windows NDIS
  1182. -#CONFIG_DRIVER_NDIS=y
  1183. -#CFLAGS += -I/usr/include/w32api/ddk
  1184. -#LIBS += -L/usr/local/lib
  1185. -# For native build using mingw
  1186. -#CONFIG_NATIVE_WINDOWS=y
  1187. -# Additional directories for cross-compilation on Linux host for mingw target
  1188. -#CFLAGS += -I/opt/mingw/mingw32/include/ddk
  1189. -#LIBS += -L/opt/mingw/mingw32/lib
  1190. -#CC=mingw32-gcc
  1191. -# By default, driver_ndis uses WinPcap for low-level operations. This can be
  1192. -# replaced with the following option which replaces WinPcap calls with NDISUIO.
  1193. -# However, this requires that WZC is disabled (net stop wzcsvc) before starting
  1194. -# wpa_supplicant.
  1195. -# CONFIG_USE_NDISUIO=y
  1196. -
  1197. -# Driver interface for development testing
  1198. -#CONFIG_DRIVER_TEST=y
  1199. -
  1200. -# Include client MLME (management frame processing) for test driver
  1201. -# This can be used to test MLME operations in hostapd with the test interface.
  1202. -# space.
  1203. -#CONFIG_CLIENT_MLME=y
  1204. -
  1205. -# Driver interface for wired Ethernet drivers
  1206. -CONFIG_DRIVER_WIRED=y
  1207. -
  1208. -# Driver interface for the Broadcom RoboSwitch family
  1209. -#CONFIG_DRIVER_ROBOSWITCH=y
  1210. -
  1211. -# Driver interface for no driver (e.g., WPS ER only)
  1212. -#CONFIG_DRIVER_NONE=y
  1213. -
  1214. -# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
  1215. -# included)
  1216. -CONFIG_IEEE8021X_EAPOL=y
  1217. -
  1218. -# EAP-MD5
  1219. -CONFIG_EAP_MD5=y
  1220. -
  1221. -# EAP-MSCHAPv2
  1222. -CONFIG_EAP_MSCHAPV2=y
  1223. -
  1224. -# EAP-TLS
  1225. -CONFIG_EAP_TLS=y
  1226. -
  1227. -# EAL-PEAP
  1228. -CONFIG_EAP_PEAP=y
  1229. -
  1230. -# EAP-TTLS
  1231. -CONFIG_EAP_TTLS=y
  1232. -
  1233. -# EAP-FAST
  1234. -# Note: Default OpenSSL package does not include support for all the
  1235. -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
  1236. -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch)
  1237. -# to add the needed functions.
  1238. -#CONFIG_EAP_FAST=y
  1239. -
  1240. -# EAP-GTC
  1241. -CONFIG_EAP_GTC=y
  1242. -
  1243. -# EAP-OTP
  1244. -CONFIG_EAP_OTP=y
  1245. -
  1246. -# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
  1247. -#CONFIG_EAP_SIM=y
  1248. -
  1249. -# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
  1250. -#CONFIG_EAP_PSK=y
  1251. -
  1252. -# EAP-PAX
  1253. -#CONFIG_EAP_PAX=y
  1254. -
  1255. -# LEAP
  1256. -CONFIG_EAP_LEAP=y
  1257. -
  1258. -# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
  1259. -#CONFIG_EAP_AKA=y
  1260. -
  1261. -# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
  1262. -# This requires CONFIG_EAP_AKA to be enabled, too.
  1263. -#CONFIG_EAP_AKA_PRIME=y
  1264. -
  1265. -# Enable USIM simulator (Milenage) for EAP-AKA
  1266. -#CONFIG_USIM_SIMULATOR=y
  1267. -
  1268. -# EAP-SAKE
  1269. -#CONFIG_EAP_SAKE=y
  1270. -
  1271. -# EAP-GPSK
  1272. -#CONFIG_EAP_GPSK=y
  1273. -# Include support for optional SHA256 cipher suite in EAP-GPSK
  1274. -#CONFIG_EAP_GPSK_SHA256=y
  1275. -
  1276. -# EAP-TNC and related Trusted Network Connect support (experimental)
  1277. -#CONFIG_EAP_TNC=y
  1278. -
  1279. -# Wi-Fi Protected Setup (WPS)
  1280. -CONFIG_WPS=y
  1281. -
  1282. -# EAP-IKEv2
  1283. -#CONFIG_EAP_IKEV2=y
  1284. -
  1285. -# PKCS#12 (PFX) support (used to read private key and certificate file from
  1286. -# a file that usually has extension .p12 or .pfx)
  1287. -CONFIG_PKCS12=y
  1288. -
  1289. -# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
  1290. -# engine.
  1291. -CONFIG_SMARTCARD=y
  1292. -
  1293. -# PC/SC interface for smartcards (USIM, GSM SIM)
  1294. -# Enable this if EAP-SIM or EAP-AKA is included
  1295. -#CONFIG_PCSC=y
  1296. -
  1297. -# Development testing
  1298. -#CONFIG_EAPOL_TEST=y
  1299. -
  1300. -# Select control interface backend for external programs, e.g, wpa_cli:
  1301. -# unix = UNIX domain sockets (default for Linux/*BSD)
  1302. -# udp = UDP sockets using localhost (127.0.0.1)
  1303. -# named_pipe = Windows Named Pipe (default for Windows)
  1304. -# y = use default (backwards compatibility)
  1305. -# If this option is commented out, control interface is not included in the
  1306. -# build.
  1307. -CONFIG_CTRL_IFACE=y
  1308. -
  1309. -# Include support for GNU Readline and History Libraries in wpa_cli.
  1310. -# When building a wpa_cli binary for distribution, please note that these
  1311. -# libraries are licensed under GPL and as such, BSD license may not apply for
  1312. -# the resulting binary.
  1313. -#CONFIG_READLINE=y
  1314. -
  1315. -# Remove debugging code that is printing out debug message to stdout.
  1316. -# This can be used to reduce the size of the wpa_supplicant considerably
  1317. -# if debugging code is not needed. The size reduction can be around 35%
  1318. -# (e.g., 90 kB).
  1319. -#CONFIG_NO_STDOUT_DEBUG=y
  1320. -
  1321. -# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
  1322. -# 35-50 kB in code size.
  1323. -#CONFIG_NO_WPA=y
  1324. -
  1325. -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to
  1326. -# save about 1 kB in code size when building only WPA-Personal (no EAP support)
  1327. -# or 6 kB if building for WPA-Enterprise.
  1328. -#CONFIG_NO_WPA2=y
  1329. -
  1330. -# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
  1331. -# This option can be used to reduce code size by removing support for
  1332. -# converting ASCII passphrases into PSK. If this functionality is removed, the
  1333. -# PSK can only be configured as the 64-octet hexstring (e.g., from
  1334. -# wpa_passphrase). This saves about 0.5 kB in code size.
  1335. -#CONFIG_NO_WPA_PASSPHRASE=y
  1336. -
  1337. -# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
  1338. -# This can be used if ap_scan=1 mode is never enabled.
  1339. -#CONFIG_NO_SCAN_PROCESSING=y
  1340. -
  1341. -# Select configuration backend:
  1342. -# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
  1343. -# path is given on command line, not here; this option is just used to
  1344. -# select the backend that allows configuration files to be used)
  1345. -# winreg = Windows registry (see win_example.reg for an example)
  1346. -CONFIG_BACKEND=file
  1347. -
  1348. -# Remove configuration write functionality (i.e., to allow the configuration
  1349. -# file to be updated based on runtime configuration changes). The runtime
  1350. -# configuration can still be changed, the changes are just not going to be
  1351. -# persistent over restarts. This option can be used to reduce code size by
  1352. -# about 3.5 kB.
  1353. -#CONFIG_NO_CONFIG_WRITE=y
  1354. -
  1355. -# Remove support for configuration blobs to reduce code size by about 1.5 kB.
  1356. -#CONFIG_NO_CONFIG_BLOBS=y
  1357. -
  1358. -# Select program entry point implementation:
  1359. -# main = UNIX/POSIX like main() function (default)
  1360. -# main_winsvc = Windows service (read parameters from registry)
  1361. -# main_none = Very basic example (development use only)
  1362. -#CONFIG_MAIN=main
  1363. -
  1364. -# Select wrapper for operatins system and C library specific functions
  1365. -# unix = UNIX/POSIX like systems (default)
  1366. -# win32 = Windows systems
  1367. -# none = Empty template
  1368. -#CONFIG_OS=unix
  1369. -
  1370. -# Select event loop implementation
  1371. -# eloop = select() loop (default)
  1372. -# eloop_win = Windows events and WaitForMultipleObject() loop
  1373. -# eloop_none = Empty template
  1374. -#CONFIG_ELOOP=eloop
  1375. -
  1376. -# Select layer 2 packet implementation
  1377. -# linux = Linux packet socket (default)
  1378. -# pcap = libpcap/libdnet/WinPcap
  1379. -# freebsd = FreeBSD libpcap
  1380. -# winpcap = WinPcap with receive thread
  1381. -# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
  1382. -# none = Empty template
  1383. -#CONFIG_L2_PACKET=linux
  1384. -
  1385. -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
  1386. -CONFIG_PEERKEY=y
  1387. -
  1388. -# IEEE 802.11w (management frame protection)
  1389. -# This version is an experimental implementation based on IEEE 802.11w/D1.0
  1390. -# draft and is subject to change since the standard has not yet been finalized.
  1391. -# Driver support is also needed for IEEE 802.11w.
  1392. -CONFIG_IEEE80211W=y
  1393. -
  1394. -# Select TLS implementation
  1395. -# openssl = OpenSSL (default)
  1396. -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA)
  1397. -# internal = Internal TLSv1 implementation (experimental)
  1398. -# none = Empty template
  1399. -CONFIG_TLS=internal
  1400. -
  1401. -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1.
  1402. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that
  1403. -# even though the core GnuTLS library is released under LGPL, this extra
  1404. -# library uses GPL and as such, the terms of GPL apply to the combination
  1405. -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not
  1406. -# apply for distribution of the resulting binary.
  1407. -#CONFIG_GNUTLS_EXTRA=y
  1408. -
  1409. -# If CONFIG_TLS=internal is used, additional library and include paths are
  1410. -# needed for LibTomMath. Alternatively, an integrated, minimal version of
  1411. -# LibTomMath can be used. See beginning of libtommath.c for details on benefits
  1412. -# and drawbacks of this option.
  1413. -CONFIG_INTERNAL_LIBTOMMATH=y
  1414. -#ifndef CONFIG_INTERNAL_LIBTOMMATH
  1415. -#LTM_PATH=/usr/src/libtommath-0.39
  1416. -#CFLAGS += -I$(LTM_PATH)
  1417. -#LIBS += -L$(LTM_PATH)
  1418. -#LIBS_p += -L$(LTM_PATH)
  1419. -#endif
  1420. -# At the cost of about 4 kB of additional binary size, the internal LibTomMath
  1421. -# can be configured to include faster routines for exptmod, sqr, and div to
  1422. -# speed up DH and RSA calculation considerably
  1423. -CONFIG_INTERNAL_LIBTOMMATH_FAST=y
  1424. -
  1425. -# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
  1426. -# This is only for Windows builds and requires WMI-related header files and
  1427. -# WbemUuid.Lib from Platform SDK even when building with MinGW.
  1428. -#CONFIG_NDIS_EVENTS_INTEGRATED=y
  1429. -#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
  1430. -
  1431. -# Add support for old DBus control interface
  1432. -# (fi.epitest.hostap.WPASupplicant)
  1433. -#CONFIG_CTRL_IFACE_DBUS=y
  1434. -
  1435. -# Add support for new DBus control interface
  1436. -# (fi.w1.hostap.wpa_supplicant1)
  1437. -#CONFIG_CTRL_IFACE_DBUS_NEW=y
  1438. -
  1439. -# Add introspection support for new DBus control interface
  1440. -#CONFIG_CTRL_IFACE_DBUS_INTRO=y
  1441. -
  1442. -# Add support for loading EAP methods dynamically as shared libraries.
  1443. -# When this option is enabled, each EAP method can be either included
  1444. -# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
  1445. -# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
  1446. -# be loaded in the beginning of the wpa_supplicant configuration file
  1447. -# (see load_dynamic_eap parameter in the example file) before being used in
  1448. -# the network blocks.
  1449. -#
  1450. -# Note that some shared parts of EAP methods are included in the main program
  1451. -# and in order to be able to use dynamic EAP methods using these parts, the
  1452. -# main program must have been build with the EAP method enabled (=y or =dyn).
  1453. -# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
  1454. -# unless at least one of them was included in the main build to force inclusion
  1455. -# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
  1456. -# in the main build to be able to load these methods dynamically.
  1457. -#
  1458. -# Please also note that using dynamic libraries will increase the total binary
  1459. -# size. Thus, it may not be the best option for targets that have limited
  1460. -# amount of memory/flash.
  1461. -#CONFIG_DYNAMIC_EAP_METHODS=y
  1462. -
  1463. -# IEEE Std 802.11r-2008 (Fast BSS Transition)
  1464. -#CONFIG_IEEE80211R=y
  1465. -
  1466. -# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
  1467. -#CONFIG_DEBUG_FILE=y
  1468. -
  1469. -# Enable privilege separation (see README 'Privilege separation' for details)
  1470. -#CONFIG_PRIVSEP=y
  1471. -
  1472. -# Enable mitigation against certain attacks against TKIP by delaying Michael
  1473. -# MIC error reports by a random amount of time between 0 and 60 seconds
  1474. -#CONFIG_DELAYED_MIC_ERROR_REPORT=y
  1475. -
  1476. -# Enable tracing code for developer debugging
  1477. -# This tracks use of memory allocations and other registrations and reports
  1478. -# incorrect use with a backtrace of call (or allocation) location.
  1479. -#CONFIG_WPA_TRACE=y
  1480. -# For BSD, comment out these.
  1481. -#LIBS += -lexecinfo
  1482. -#LIBS_p += -lexecinfo
  1483. -#LIBS_c += -lexecinfo
  1484. -
  1485. -# Use libbfd to get more details for developer debugging
  1486. -# This enables use of libbfd to get more detailed symbols for the backtraces
  1487. -# generated by CONFIG_WPA_TRACE=y.
  1488. -#CONFIG_WPA_TRACE_BFD=y
  1489. -# For BSD, comment out these.
  1490. -#LIBS += -lbfd -liberty -lz
  1491. -#LIBS_p += -lbfd -liberty -lz
  1492. -#LIBS_c += -lbfd -liberty -lz
  1493. -
  1494. -NEED_80211_COMMON=y
  1495. -
  1496. -CONFIG_IBSS_RSN=y
  1497. diff --git a/package/hostapd/files/wpa_supplicant-mini.config b/package/hostapd/files/wpa_supplicant-mini.config
  1498. deleted file mode 100644
  1499. index 772e1d9..0000000
  1500. --- a/package/hostapd/files/wpa_supplicant-mini.config
  1501. +++ /dev/null
  1502. @@ -1,406 +0,0 @@
  1503. -# Example wpa_supplicant build time configuration
  1504. -#
  1505. -# This file lists the configuration options that are used when building the
  1506. -# hostapd binary. All lines starting with # are ignored. Configuration option
  1507. -# lines must be commented out complete, if they are not to be included, i.e.,
  1508. -# just setting VARIABLE=n is not disabling that variable.
  1509. -#
  1510. -# This file is included in Makefile, so variables like CFLAGS and LIBS can also
  1511. -# be modified from here. In most cases, these lines should use += in order not
  1512. -# to override previous values of the variables.
  1513. -
  1514. -
  1515. -# Uncomment following two lines and fix the paths if you have installed OpenSSL
  1516. -# or GnuTLS in non-default location
  1517. -#CFLAGS += -I/usr/local/openssl/include
  1518. -#LIBS += -L/usr/local/openssl/lib
  1519. -
  1520. -# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
  1521. -# the kerberos files are not in the default include path. Following line can be
  1522. -# used to fix build issues on such systems (krb5.h not found).
  1523. -#CFLAGS += -I/usr/include/kerberos
  1524. -
  1525. -# Example configuration for various cross-compilation platforms
  1526. -
  1527. -#### sveasoft (e.g., for Linksys WRT54G) ######################################
  1528. -#CC=mipsel-uclibc-gcc
  1529. -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
  1530. -#CFLAGS += -Os
  1531. -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
  1532. -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
  1533. -###############################################################################
  1534. -
  1535. -#### openwrt (e.g., for Linksys WRT54G) #######################################
  1536. -#CC=mipsel-uclibc-gcc
  1537. -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
  1538. -#CFLAGS += -Os
  1539. -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
  1540. -# -I../WRT54GS/release/src/include
  1541. -#LIBS = -lssl
  1542. -###############################################################################
  1543. -
  1544. -
  1545. -# Driver interface for Host AP driver
  1546. -CONFIG_DRIVER_HOSTAP=y
  1547. -
  1548. -# Driver interface for Agere driver
  1549. -#CONFIG_DRIVER_HERMES=y
  1550. -# Change include directories to match with the local setup
  1551. -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf
  1552. -#CFLAGS += -I../../include/wireless
  1553. -
  1554. -# Driver interface for madwifi driver
  1555. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1556. -#CONFIG_DRIVER_MADWIFI=y
  1557. -# Set include directory to the madwifi source tree
  1558. -#CFLAGS += -I../../madwifi
  1559. -
  1560. -# Driver interface for ndiswrapper
  1561. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1562. -#CONFIG_DRIVER_NDISWRAPPER=y
  1563. -
  1564. -# Driver interface for Atmel driver
  1565. -# CONFIG_DRIVER_ATMEL=y
  1566. -
  1567. -# Driver interface for old Broadcom driver
  1568. -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports
  1569. -# Linux wireless extensions and does not need (or even work) with the old
  1570. -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver.
  1571. -#CONFIG_DRIVER_BROADCOM=y
  1572. -# Example path for wlioctl.h; change to match your configuration
  1573. -#CFLAGS += -I/opt/WRT54GS/release/src/include
  1574. -
  1575. -# Driver interface for Intel ipw2100/2200 driver
  1576. -# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
  1577. -#CONFIG_DRIVER_IPW=y
  1578. -
  1579. -# Driver interface for Ralink driver
  1580. -#CONFIG_DRIVER_RALINK=y
  1581. -
  1582. -# Driver interface for generic Linux wireless extensions
  1583. -CONFIG_DRIVER_WEXT=y
  1584. -
  1585. -# Driver interface for Linux drivers using the nl80211 kernel interface
  1586. -CONFIG_DRIVER_NL80211=y
  1587. -
  1588. -# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
  1589. -#CONFIG_DRIVER_BSD=y
  1590. -#CFLAGS += -I/usr/local/include
  1591. -#LIBS += -L/usr/local/lib
  1592. -#LIBS_p += -L/usr/local/lib
  1593. -#LIBS_c += -L/usr/local/lib
  1594. -
  1595. -# Driver interface for Windows NDIS
  1596. -#CONFIG_DRIVER_NDIS=y
  1597. -#CFLAGS += -I/usr/include/w32api/ddk
  1598. -#LIBS += -L/usr/local/lib
  1599. -# For native build using mingw
  1600. -#CONFIG_NATIVE_WINDOWS=y
  1601. -# Additional directories for cross-compilation on Linux host for mingw target
  1602. -#CFLAGS += -I/opt/mingw/mingw32/include/ddk
  1603. -#LIBS += -L/opt/mingw/mingw32/lib
  1604. -#CC=mingw32-gcc
  1605. -# By default, driver_ndis uses WinPcap for low-level operations. This can be
  1606. -# replaced with the following option which replaces WinPcap calls with NDISUIO.
  1607. -# However, this requires that WZC is disabled (net stop wzcsvc) before starting
  1608. -# wpa_supplicant.
  1609. -# CONFIG_USE_NDISUIO=y
  1610. -
  1611. -# Driver interface for development testing
  1612. -#CONFIG_DRIVER_TEST=y
  1613. -
  1614. -# Include client MLME (management frame processing) for test driver
  1615. -# This can be used to test MLME operations in hostapd with the test interface.
  1616. -# space.
  1617. -#CONFIG_CLIENT_MLME=y
  1618. -
  1619. -# Driver interface for wired Ethernet drivers
  1620. -CONFIG_DRIVER_WIRED=y
  1621. -
  1622. -# Driver interface for the Broadcom RoboSwitch family
  1623. -#CONFIG_DRIVER_ROBOSWITCH=y
  1624. -
  1625. -# Driver interface for no driver (e.g., WPS ER only)
  1626. -#CONFIG_DRIVER_NONE=y
  1627. -
  1628. -# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
  1629. -# included)
  1630. -# CONFIG_IEEE8021X_EAPOL=y
  1631. -
  1632. -# EAP-MD5
  1633. -# CONFIG_EAP_MD5=y
  1634. -
  1635. -# EAP-MSCHAPv2
  1636. -# CONFIG_EAP_MSCHAPV2=y
  1637. -
  1638. -# EAP-TLS
  1639. -# CONFIG_EAP_TLS=y
  1640. -
  1641. -# EAL-PEAP
  1642. -# CONFIG_EAP_PEAP=y
  1643. -
  1644. -# EAP-TTLS
  1645. -# CONFIG_EAP_TTLS=y
  1646. -
  1647. -# EAP-FAST
  1648. -# Note: Default OpenSSL package does not include support for all the
  1649. -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
  1650. -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch)
  1651. -# to add the needed functions.
  1652. -#CONFIG_EAP_FAST=y
  1653. -
  1654. -# EAP-GTC
  1655. -# CONFIG_EAP_GTC=y
  1656. -
  1657. -# EAP-OTP
  1658. -# CONFIG_EAP_OTP=y
  1659. -
  1660. -# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
  1661. -#CONFIG_EAP_SIM=y
  1662. -
  1663. -# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
  1664. -#CONFIG_EAP_PSK=y
  1665. -
  1666. -# EAP-PAX
  1667. -#CONFIG_EAP_PAX=y
  1668. -
  1669. -# LEAP
  1670. -# CONFIG_EAP_LEAP=y
  1671. -
  1672. -# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
  1673. -#CONFIG_EAP_AKA=y
  1674. -
  1675. -# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
  1676. -# This requires CONFIG_EAP_AKA to be enabled, too.
  1677. -#CONFIG_EAP_AKA_PRIME=y
  1678. -
  1679. -# Enable USIM simulator (Milenage) for EAP-AKA
  1680. -#CONFIG_USIM_SIMULATOR=y
  1681. -
  1682. -# EAP-SAKE
  1683. -#CONFIG_EAP_SAKE=y
  1684. -
  1685. -# EAP-GPSK
  1686. -#CONFIG_EAP_GPSK=y
  1687. -# Include support for optional SHA256 cipher suite in EAP-GPSK
  1688. -#CONFIG_EAP_GPSK_SHA256=y
  1689. -
  1690. -# EAP-TNC and related Trusted Network Connect support (experimental)
  1691. -#CONFIG_EAP_TNC=y
  1692. -
  1693. -# Wi-Fi Protected Setup (WPS)
  1694. -#CONFIG_WPS=y
  1695. -
  1696. -# EAP-IKEv2
  1697. -#CONFIG_EAP_IKEV2=y
  1698. -
  1699. -# PKCS#12 (PFX) support (used to read private key and certificate file from
  1700. -# a file that usually has extension .p12 or .pfx)
  1701. -# CONFIG_PKCS12=y
  1702. -
  1703. -# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
  1704. -# engine.
  1705. -# CONFIG_SMARTCARD=y
  1706. -
  1707. -# PC/SC interface for smartcards (USIM, GSM SIM)
  1708. -# Enable this if EAP-SIM or EAP-AKA is included
  1709. -#CONFIG_PCSC=y
  1710. -
  1711. -# Development testing
  1712. -#CONFIG_EAPOL_TEST=y
  1713. -
  1714. -# Select control interface backend for external programs, e.g, wpa_cli:
  1715. -# unix = UNIX domain sockets (default for Linux/*BSD)
  1716. -# udp = UDP sockets using localhost (127.0.0.1)
  1717. -# named_pipe = Windows Named Pipe (default for Windows)
  1718. -# y = use default (backwards compatibility)
  1719. -# If this option is commented out, control interface is not included in the
  1720. -# build.
  1721. -CONFIG_CTRL_IFACE=y
  1722. -
  1723. -# Include support for GNU Readline and History Libraries in wpa_cli.
  1724. -# When building a wpa_cli binary for distribution, please note that these
  1725. -# libraries are licensed under GPL and as such, BSD license may not apply for
  1726. -# the resulting binary.
  1727. -#CONFIG_READLINE=y
  1728. -
  1729. -# Remove debugging code that is printing out debug message to stdout.
  1730. -# This can be used to reduce the size of the wpa_supplicant considerably
  1731. -# if debugging code is not needed. The size reduction can be around 35%
  1732. -# (e.g., 90 kB).
  1733. -#CONFIG_NO_STDOUT_DEBUG=y
  1734. -
  1735. -# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
  1736. -# 35-50 kB in code size.
  1737. -#CONFIG_NO_WPA=y
  1738. -
  1739. -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to
  1740. -# save about 1 kB in code size when building only WPA-Personal (no EAP support)
  1741. -# or 6 kB if building for WPA-Enterprise.
  1742. -#CONFIG_NO_WPA2=y
  1743. -
  1744. -# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
  1745. -# This option can be used to reduce code size by removing support for
  1746. -# converting ASCII passphrases into PSK. If this functionality is removed, the
  1747. -# PSK can only be configured as the 64-octet hexstring (e.g., from
  1748. -# wpa_passphrase). This saves about 0.5 kB in code size.
  1749. -#CONFIG_NO_WPA_PASSPHRASE=y
  1750. -
  1751. -# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
  1752. -# This can be used if ap_scan=1 mode is never enabled.
  1753. -#CONFIG_NO_SCAN_PROCESSING=y
  1754. -
  1755. -# Select configuration backend:
  1756. -# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
  1757. -# path is given on command line, not here; this option is just used to
  1758. -# select the backend that allows configuration files to be used)
  1759. -# winreg = Windows registry (see win_example.reg for an example)
  1760. -CONFIG_BACKEND=file
  1761. -
  1762. -# Remove configuration write functionality (i.e., to allow the configuration
  1763. -# file to be updated based on runtime configuration changes). The runtime
  1764. -# configuration can still be changed, the changes are just not going to be
  1765. -# persistent over restarts. This option can be used to reduce code size by
  1766. -# about 3.5 kB.
  1767. -#CONFIG_NO_CONFIG_WRITE=y
  1768. -
  1769. -# Remove support for configuration blobs to reduce code size by about 1.5 kB.
  1770. -#CONFIG_NO_CONFIG_BLOBS=y
  1771. -
  1772. -# Select program entry point implementation:
  1773. -# main = UNIX/POSIX like main() function (default)
  1774. -# main_winsvc = Windows service (read parameters from registry)
  1775. -# main_none = Very basic example (development use only)
  1776. -#CONFIG_MAIN=main
  1777. -
  1778. -# Select wrapper for operatins system and C library specific functions
  1779. -# unix = UNIX/POSIX like systems (default)
  1780. -# win32 = Windows systems
  1781. -# none = Empty template
  1782. -#CONFIG_OS=unix
  1783. -
  1784. -# Select event loop implementation
  1785. -# eloop = select() loop (default)
  1786. -# eloop_win = Windows events and WaitForMultipleObject() loop
  1787. -# eloop_none = Empty template
  1788. -#CONFIG_ELOOP=eloop
  1789. -
  1790. -# Select layer 2 packet implementation
  1791. -# linux = Linux packet socket (default)
  1792. -# pcap = libpcap/libdnet/WinPcap
  1793. -# freebsd = FreeBSD libpcap
  1794. -# winpcap = WinPcap with receive thread
  1795. -# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
  1796. -# none = Empty template
  1797. -#CONFIG_L2_PACKET=linux
  1798. -
  1799. -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
  1800. -# CONFIG_PEERKEY=y
  1801. -
  1802. -# IEEE 802.11w (management frame protection)
  1803. -# This version is an experimental implementation based on IEEE 802.11w/D1.0
  1804. -# draft and is subject to change since the standard has not yet been finalized.
  1805. -# Driver support is also needed for IEEE 802.11w.
  1806. -#CONFIG_IEEE80211W=y
  1807. -
  1808. -# Select TLS implementation
  1809. -# openssl = OpenSSL (default)
  1810. -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA)
  1811. -# internal = Internal TLSv1 implementation (experimental)
  1812. -# none = Empty template
  1813. -CONFIG_TLS=internal
  1814. -
  1815. -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1.
  1816. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that
  1817. -# even though the core GnuTLS library is released under LGPL, this extra
  1818. -# library uses GPL and as such, the terms of GPL apply to the combination
  1819. -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not
  1820. -# apply for distribution of the resulting binary.
  1821. -#CONFIG_GNUTLS_EXTRA=y
  1822. -
  1823. -# If CONFIG_TLS=internal is used, additional library and include paths are
  1824. -# needed for LibTomMath. Alternatively, an integrated, minimal version of
  1825. -# LibTomMath can be used. See beginning of libtommath.c for details on benefits
  1826. -# and drawbacks of this option.
  1827. -#CONFIG_INTERNAL_LIBTOMMATH=y
  1828. -#ifndef CONFIG_INTERNAL_LIBTOMMATH
  1829. -#LTM_PATH=/usr/src/libtommath-0.39
  1830. -#CFLAGS += -I$(LTM_PATH)
  1831. -#LIBS += -L$(LTM_PATH)
  1832. -#LIBS_p += -L$(LTM_PATH)
  1833. -#endif
  1834. -# At the cost of about 4 kB of additional binary size, the internal LibTomMath
  1835. -# can be configured to include faster routines for exptmod, sqr, and div to
  1836. -# speed up DH and RSA calculation considerably
  1837. -#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
  1838. -
  1839. -# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
  1840. -# This is only for Windows builds and requires WMI-related header files and
  1841. -# WbemUuid.Lib from Platform SDK even when building with MinGW.
  1842. -#CONFIG_NDIS_EVENTS_INTEGRATED=y
  1843. -#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
  1844. -
  1845. -# Add support for old DBus control interface
  1846. -# (fi.epitest.hostap.WPASupplicant)
  1847. -#CONFIG_CTRL_IFACE_DBUS=y
  1848. -
  1849. -# Add support for new DBus control interface
  1850. -# (fi.w1.hostap.wpa_supplicant1)
  1851. -#CONFIG_CTRL_IFACE_DBUS_NEW=y
  1852. -
  1853. -# Add introspection support for new DBus control interface
  1854. -#CONFIG_CTRL_IFACE_DBUS_INTRO=y
  1855. -
  1856. -# Add support for loading EAP methods dynamically as shared libraries.
  1857. -# When this option is enabled, each EAP method can be either included
  1858. -# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
  1859. -# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
  1860. -# be loaded in the beginning of the wpa_supplicant configuration file
  1861. -# (see load_dynamic_eap parameter in the example file) before being used in
  1862. -# the network blocks.
  1863. -#
  1864. -# Note that some shared parts of EAP methods are included in the main program
  1865. -# and in order to be able to use dynamic EAP methods using these parts, the
  1866. -# main program must have been build with the EAP method enabled (=y or =dyn).
  1867. -# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
  1868. -# unless at least one of them was included in the main build to force inclusion
  1869. -# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
  1870. -# in the main build to be able to load these methods dynamically.
  1871. -#
  1872. -# Please also note that using dynamic libraries will increase the total binary
  1873. -# size. Thus, it may not be the best option for targets that have limited
  1874. -# amount of memory/flash.
  1875. -#CONFIG_DYNAMIC_EAP_METHODS=y
  1876. -
  1877. -# IEEE Std 802.11r-2008 (Fast BSS Transition)
  1878. -#CONFIG_IEEE80211R=y
  1879. -
  1880. -# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
  1881. -#CONFIG_DEBUG_FILE=y
  1882. -
  1883. -# Enable privilege separation (see README 'Privilege separation' for details)
  1884. -#CONFIG_PRIVSEP=y
  1885. -
  1886. -# Enable mitigation against certain attacks against TKIP by delaying Michael
  1887. -# MIC error reports by a random amount of time between 0 and 60 seconds
  1888. -#CONFIG_DELAYED_MIC_ERROR_REPORT=y
  1889. -
  1890. -# Enable tracing code for developer debugging
  1891. -# This tracks use of memory allocations and other registrations and reports
  1892. -# incorrect use with a backtrace of call (or allocation) location.
  1893. -#CONFIG_WPA_TRACE=y
  1894. -# For BSD, comment out these.
  1895. -#LIBS += -lexecinfo
  1896. -#LIBS_p += -lexecinfo
  1897. -#LIBS_c += -lexecinfo
  1898. -
  1899. -# Use libbfd to get more details for developer debugging
  1900. -# This enables use of libbfd to get more detailed symbols for the backtraces
  1901. -# generated by CONFIG_WPA_TRACE=y.
  1902. -#CONFIG_WPA_TRACE_BFD=y
  1903. -# For BSD, comment out these.
  1904. -#LIBS += -lbfd -liberty -lz
  1905. -#LIBS_p += -lbfd -liberty -lz
  1906. -#LIBS_c += -lbfd -liberty -lz
  1907. -
  1908. -NEED_80211_COMMON=y
  1909. diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh
  1910. deleted file mode 100644
  1911. index 0b5e1d3..0000000
  1912. --- a/package/hostapd/files/wpa_supplicant.sh
  1913. +++ /dev/null
  1914. @@ -1,194 +0,0 @@
  1915. -wpa_supplicant_setup_vif() {
  1916. - local vif="$1"
  1917. - local driver="$2"
  1918. - local key="$key"
  1919. - local options="$3"
  1920. - local freq=""
  1921. - local ht="$5"
  1922. - local ap_scan=""
  1923. - local scan_ssid="1"
  1924. - [ -n "$4" ] && freq="frequency=$4"
  1925. -
  1926. - config_get enc "$vif" encryption
  1927. - config_get key "$vif" key
  1928. -
  1929. - local net_cfg bridge
  1930. - config_get bridge "$vif" bridge
  1931. - [ -z "$bridge" ] && {
  1932. - net_cfg="$(find_net_config "$vif")"
  1933. - [ -z "$net_cfg" ] || bridge="$(bridge_interface "$net_cfg")"
  1934. - config_set "$vif" bridge "$bridge"
  1935. - }
  1936. -
  1937. - local mode ifname wds modestr=""
  1938. - config_get mode "$vif" mode
  1939. - config_get ifname "$vif" ifname
  1940. - config_get_bool wds "$vif" wds 0
  1941. - [ -z "$bridge" ] || [ "$mode" = ap ] || [ "$mode" = sta -a $wds -eq 1 ] || {
  1942. - echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface"
  1943. - return 1
  1944. - }
  1945. - [ "$mode" = "adhoc" ] && {
  1946. - modestr="mode=1"
  1947. - scan_ssid="0"
  1948. - ap_scan="ap_scan=2"
  1949. - }
  1950. -
  1951. - key_mgmt='NONE'
  1952. - case "$enc" in
  1953. - *none*) ;;
  1954. - *wep*)
  1955. - config_get key "$vif" key
  1956. - key="${key:-1}"
  1957. - case "$key" in
  1958. - [1234])
  1959. - for idx in 1 2 3 4; do
  1960. - local zidx
  1961. - zidx=$(($idx - 1))
  1962. - config_get ckey "$vif" "key${idx}"
  1963. - [ -n "$ckey" ] && \
  1964. - append "wep_key${zidx}" "wep_key${zidx}=$(prepare_key_wep "$ckey")"
  1965. - done
  1966. - wep_tx_keyidx="wep_tx_keyidx=$((key - 1))"
  1967. - ;;
  1968. - *)
  1969. - wep_key0="wep_key0=$(prepare_key_wep "$key")"
  1970. - wep_tx_keyidx="wep_tx_keyidx=0"
  1971. - ;;
  1972. - esac
  1973. - ;;
  1974. - *psk*)
  1975. - key_mgmt='WPA-PSK'
  1976. - # if you want to use PSK with a non-nl80211 driver you
  1977. - # have to use WPA-NONE and wext driver for wpa_s
  1978. - [ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && {
  1979. - key_mgmt='WPA-NONE'
  1980. - driver='wext'
  1981. - }
  1982. - if [ ${#key} -eq 64 ]; then
  1983. - passphrase="psk=${key}"
  1984. - else
  1985. - passphrase="psk=\"${key}\""
  1986. - fi
  1987. - case "$enc" in
  1988. - *psk2*)
  1989. - proto='proto=RSN'
  1990. - config_get ieee80211w "$vif" ieee80211w
  1991. - ;;
  1992. - *psk*)
  1993. - proto='proto=WPA'
  1994. - ;;
  1995. - esac
  1996. - ;;
  1997. - *wpa*|*8021x*)
  1998. - proto='proto=WPA2'
  1999. - key_mgmt='WPA-EAP'
  2000. - config_get ieee80211w "$vif" ieee80211w
  2001. - config_get ca_cert "$vif" ca_cert
  2002. - config_get eap_type "$vif" eap_type
  2003. - ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
  2004. - case "$eap_type" in
  2005. - tls)
  2006. - pairwise='pairwise=CCMP'
  2007. - group='group=CCMP'
  2008. - config_get identity "$vif" identity
  2009. - config_get client_cert "$vif" client_cert
  2010. - config_get priv_key "$vif" priv_key
  2011. - config_get priv_key_pwd "$vif" priv_key_pwd
  2012. - identity="identity=\"$identity\""
  2013. - client_cert="client_cert=\"$client_cert\""
  2014. - priv_key="private_key=\"$priv_key\""
  2015. - priv_key_pwd="private_key_passwd=\"$priv_key_pwd\""
  2016. - ;;
  2017. - peap|ttls)
  2018. - config_get auth "$vif" auth
  2019. - config_get identity "$vif" identity
  2020. - config_get password "$vif" password
  2021. - phase2="phase2=\"auth=${auth:-MSCHAPV2}\""
  2022. - identity="identity=\"$identity\""
  2023. - password="${password:+password=\"$password\"}"
  2024. - ;;
  2025. - esac
  2026. - eap_type="eap=$(echo $eap_type | tr 'a-z' 'A-Z')"
  2027. - ;;
  2028. - esac
  2029. -
  2030. - case "$ieee80211w" in
  2031. - [012])
  2032. - ieee80211w="ieee80211w=$ieee80211w"
  2033. - ;;
  2034. - esac
  2035. -
  2036. - local fixed_freq bssid1 beacon_interval brates mrate
  2037. - config_get ifname "$vif" ifname
  2038. - config_get bridge "$vif" bridge
  2039. - config_get ssid "$vif" ssid
  2040. - config_get bssid "$vif" bssid
  2041. - bssid1=${bssid:+"bssid=$bssid"}
  2042. - beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
  2043. -
  2044. - local br brval brsub brstr
  2045. - [ -n "$basic_rate_list" ] && {
  2046. - for br in $basic_rate_list; do
  2047. - brval="$(($br / 1000))"
  2048. - brsub="$((($br / 100) % 10))"
  2049. - [ "$brsub" -gt 0 ] && brval="$brval.$brsub"
  2050. - [ -n "$brstr" ] && brstr="$brstr,"
  2051. - brstr="$brstr$brval"
  2052. - done
  2053. - brates=${basic_rate_list:+"rates=$brstr"}
  2054. - }
  2055. -
  2056. - local mcval=""
  2057. - [ -n "$mcast_rate" ] && {
  2058. - mcval="$(($mcast_rate / 1000))"
  2059. - mcsub="$(( ($mcast_rate / 100) % 10 ))"
  2060. - [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
  2061. - mrate=${mcast_rate:+"mcast_rate=$mcval"}
  2062. - }
  2063. -
  2064. - local ht_str
  2065. - [ -n "$ht" ] && ht_str="htmode=$ht"
  2066. -
  2067. - rm -rf /var/run/wpa_supplicant-$ifname
  2068. - cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
  2069. -ctrl_interface=/var/run/wpa_supplicant-$ifname
  2070. -$ap_scan
  2071. -network={
  2072. - $modestr
  2073. - scan_ssid=$scan_ssid
  2074. - ssid="$ssid"
  2075. - $bssid1
  2076. - key_mgmt=$key_mgmt
  2077. - $proto
  2078. - $freq
  2079. - ${fixed:+"fixed_freq=1"}
  2080. - $beacon_interval
  2081. - $brates
  2082. - $mrate
  2083. - $ht_str
  2084. - $ieee80211w
  2085. - $passphrase
  2086. - $pairwise
  2087. - $group
  2088. - $eap_type
  2089. - $ca_cert
  2090. - $client_cert
  2091. - $priv_key
  2092. - $priv_key_pwd
  2093. - $phase2
  2094. - $identity
  2095. - $password
  2096. - $wep_key0
  2097. - $wep_key1
  2098. - $wep_key2
  2099. - $wep_key3
  2100. - $wep_tx_keyidx
  2101. -}
  2102. -EOF
  2103. - if [ -n "$proto" -o "$key_mgmt" == "NONE" ]; then
  2104. - wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf $options
  2105. - else
  2106. - return 0
  2107. - fi
  2108. -}
  2109. diff --git a/package/hostapd/files/wps-hotplug.sh b/package/hostapd/files/wps-hotplug.sh
  2110. deleted file mode 100644
  2111. index ffd3cf9..0000000
  2112. --- a/package/hostapd/files/wps-hotplug.sh
  2113. +++ /dev/null
  2114. @@ -1,8 +0,0 @@
  2115. -#!/bin/sh
  2116. -
  2117. -if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
  2118. - for dir in /var/run/hostapd-*; do
  2119. - [ -d "$dir" ] || continue
  2120. - hostapd_cli -p "$dir" wps_pbc
  2121. - done
  2122. -fi
  2123. diff --git a/package/hostapd/madwifi/include/compat.h b/package/hostapd/madwifi/include/compat.h
  2124. deleted file mode 100644
  2125. index 09e6397..0000000
  2126. --- a/package/hostapd/madwifi/include/compat.h
  2127. +++ /dev/null
  2128. @@ -1,209 +0,0 @@
  2129. -/*-
  2130. - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  2131. - * All rights reserved.
  2132. - *
  2133. - * Redistribution and use in source and binary forms, with or without
  2134. - * modification, are permitted provided that the following conditions
  2135. - * are met:
  2136. - * 1. Redistributions of source code must retain the above copyright
  2137. - * notice, this list of conditions and the following disclaimer,
  2138. - * without modification.
  2139. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  2140. - * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
  2141. - * redistribution must be conditioned upon including a substantially
  2142. - * similar Disclaimer requirement for further binary redistribution.
  2143. - * 3. Neither the names of the above-listed copyright holders nor the names
  2144. - * of any contributors may be used to endorse or promote products derived
  2145. - * from this software without specific prior written permission.
  2146. - *
  2147. - * Alternatively, this software may be distributed under the terms of the
  2148. - * GNU General Public License ("GPL") version 2 as published by the Free
  2149. - * Software Foundation.
  2150. - *
  2151. - * NO WARRANTY
  2152. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2153. - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2154. - * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
  2155. - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  2156. - * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
  2157. - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  2158. - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  2159. - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  2160. - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  2161. - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  2162. - * THE POSSIBILITY OF SUCH DAMAGES.
  2163. - *
  2164. - * $Id: compat.h 3310 2008-01-30 20:23:49Z mentor $
  2165. - */
  2166. -#ifndef _ATH_COMPAT_H_
  2167. -#define _ATH_COMPAT_H_
  2168. -
  2169. -/* Compatibility with older Linux kernels */
  2170. -#ifdef __KERNEL__
  2171. -#include <linux/types.h>
  2172. -#include <linux/time.h>
  2173. -#include <linux/netdevice.h>
  2174. -#endif
  2175. -
  2176. -#if !defined(__KERNEL__) || !defined (__bitwise)
  2177. -#define __le16 u_int16_t
  2178. -#define __le32 u_int32_t
  2179. -#define __le64 u_int64_t
  2180. -#define __be16 u_int16_t
  2181. -#define __be32 u_int32_t
  2182. -#define __be64 u_int64_t
  2183. -#define __force
  2184. -#endif
  2185. -
  2186. -#ifndef container_of
  2187. -#define container_of(ptr, type, member) ({ \
  2188. - const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  2189. - (type *)( (char *)__mptr - offsetof(type,member) );})
  2190. -#endif
  2191. -
  2192. -#ifndef list_for_each_entry_reverse
  2193. -#define list_for_each_entry_reverse(pos, head, member) \
  2194. - for (pos = list_entry((head)->prev, typeof(*pos), member); \
  2195. - prefetch(pos->member.prev), &pos->member != (head); \
  2196. - pos = list_entry(pos->member.prev, typeof(*pos), member))
  2197. -#endif
  2198. -
  2199. -#ifndef NETDEV_TX_OK
  2200. -#define NETDEV_TX_OK 0
  2201. -#define NETDEV_TX_BUSY 1
  2202. -#endif
  2203. -
  2204. -/*
  2205. - * BSD/Linux compatibility shims. These are used mainly to
  2206. - * minimize differences when importing necesary BSD code.
  2207. - */
  2208. -#define NBBY 8 /* number of bits/byte */
  2209. -
  2210. -/* roundup() appears in Linux 2.6.18 */
  2211. -#include <linux/kernel.h>
  2212. -#ifndef roundup
  2213. -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
  2214. -#endif
  2215. -
  2216. -#define howmany(x, y) (((x)+((y)-1))/(y))
  2217. -
  2218. -/* Bit map related macros. */
  2219. -#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  2220. -#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  2221. -#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  2222. -#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  2223. -
  2224. -#ifndef __packed
  2225. -#define __packed __attribute__((__packed__))
  2226. -#endif
  2227. -
  2228. -#define __offsetof(t,m) offsetof(t,m)
  2229. -
  2230. -#ifndef ALIGNED_POINTER
  2231. -/*
  2232. - * ALIGNED_POINTER is a boolean macro that checks whether an address
  2233. - * is valid to fetch data elements of type t from on this architecture.
  2234. - * This does not reflect the optimal alignment, just the possibility
  2235. - * (within reasonable limits).
  2236. - *
  2237. - */
  2238. -#define ALIGNED_POINTER(p,t) 1
  2239. -#endif
  2240. -
  2241. -#ifdef __KERNEL__
  2242. -#define KASSERT(exp, msg) do { \
  2243. - if (unlikely(!(exp))) { \
  2244. - printk msg; \
  2245. - BUG(); \
  2246. - } \
  2247. -} while (0)
  2248. -#endif /* __KERNEL__ */
  2249. -
  2250. -/*
  2251. - * NetBSD/FreeBSD defines for file version.
  2252. - */
  2253. -#define __FBSDID(_s)
  2254. -#define __KERNEL_RCSID(_n,_s)
  2255. -
  2256. -/*
  2257. - * Fixes for Linux API changes
  2258. - */
  2259. -#ifdef __KERNEL__
  2260. -
  2261. -#include <linux/version.h>
  2262. -
  2263. -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
  2264. -#define AUTOCONF_INCLUDED 1
  2265. -#endif
  2266. -
  2267. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
  2268. -#define ATH_REGISTER_SYSCTL_TABLE(t) register_sysctl_table(t, 1)
  2269. -#else
  2270. -#define ATH_REGISTER_SYSCTL_TABLE(t) register_sysctl_table(t)
  2271. -#endif
  2272. -
  2273. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
  2274. -#define __user
  2275. -#define __kernel
  2276. -#define __iomem
  2277. -#endif
  2278. -
  2279. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
  2280. -typedef int gfp_t;
  2281. -#endif
  2282. -
  2283. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
  2284. -static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs)
  2285. -{
  2286. - if (lhs->tv_sec < rhs->tv_sec)
  2287. - return -1;
  2288. - if (lhs->tv_sec > rhs->tv_sec)
  2289. - return 1;
  2290. - return lhs->tv_usec - rhs->tv_usec;
  2291. -}
  2292. -#endif
  2293. -
  2294. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
  2295. -#define IRQF_SHARED SA_SHIRQ
  2296. -#endif
  2297. -
  2298. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
  2299. -#define netdev_priv(_netdev) ((_netdev)->priv)
  2300. -#endif
  2301. -
  2302. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
  2303. -#define skb_end_pointer(_skb) ((_skb)->end)
  2304. -#define skb_tail_pointer(_skb) ((_skb)->tail)
  2305. -#define skb_set_network_header(_skb, _offset) \
  2306. - do { (_skb)->nh.raw = (_skb)->data + (_offset); } while(0)
  2307. -#define skb_reset_network_header(_skb) \
  2308. - do { (_skb)->nh.raw = (_skb)->data; } while(0)
  2309. -#define skb_mac_header(_skb) ((_skb)->mac.raw)
  2310. -#define skb_reset_mac_header(_skb) \
  2311. - do { (_skb)->mac.raw = (_skb)->data; } while(0)
  2312. -#endif
  2313. -
  2314. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
  2315. -#define CTL_AUTO -2
  2316. -#define DEV_ATH 9
  2317. -#else
  2318. -#define CTL_AUTO CTL_UNNUMBERED
  2319. -#define DEV_ATH CTL_UNNUMBERED
  2320. -#endif
  2321. -
  2322. -/* __skb_append got a third parameter in 2.6.14 */
  2323. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
  2324. -#define __skb_queue_after(_list, _old, _new) __skb_append(_old, _new)
  2325. -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
  2326. -#define __skb_queue_after(_list, _old, _new) __skb_append(_old, _new, _list)
  2327. -#endif
  2328. -
  2329. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
  2330. -#define CTLNAME(x) .ctl_name = x,
  2331. -#else
  2332. -#define CTLNAME(x)
  2333. -#endif
  2334. -
  2335. -#endif /* __KERNEL__ */
  2336. -
  2337. -#endif /* _ATH_COMPAT_H_ */
  2338. diff --git a/package/hostapd/madwifi/net80211/_ieee80211.h b/package/hostapd/madwifi/net80211/_ieee80211.h
  2339. deleted file mode 100644
  2340. index 2d2a06f..0000000
  2341. --- a/package/hostapd/madwifi/net80211/_ieee80211.h
  2342. +++ /dev/null
  2343. @@ -1,325 +0,0 @@
  2344. -/*-
  2345. - * Copyright (c) 2001 Atsushi Onoe
  2346. - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  2347. - * All rights reserved.
  2348. - *
  2349. - * Redistribution and use in source and binary forms, with or without
  2350. - * modification, are permitted provided that the following conditions
  2351. - * are met:
  2352. - * 1. Redistributions of source code must retain the above copyright
  2353. - * notice, this list of conditions and the following disclaimer.
  2354. - * 2. Redistributions in binary form must reproduce the above copyright
  2355. - * notice, this list of conditions and the following disclaimer in the
  2356. - * documentation and/or other materials provided with the distribution.
  2357. - * 3. The name of the author may not be used to endorse or promote products
  2358. - * derived from this software without specific prior written permission.
  2359. - *
  2360. - * Alternatively, this software may be distributed under the terms of the
  2361. - * GNU General Public License ("GPL") version 2 as published by the Free
  2362. - * Software Foundation.
  2363. - *
  2364. - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  2365. - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  2366. - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  2367. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2368. - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2369. - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2370. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2371. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2372. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2373. - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2374. - *
  2375. - * $Id: _ieee80211.h 3207 2008-01-18 21:25:05Z mtaylor $
  2376. - */
  2377. -#ifndef _NET80211__IEEE80211_H_
  2378. -#define _NET80211__IEEE80211_H_
  2379. -
  2380. -enum ieee80211_phytype {
  2381. - IEEE80211_T_DS, /* direct sequence spread spectrum */
  2382. - IEEE80211_T_FH, /* frequency hopping */
  2383. - IEEE80211_T_OFDM, /* frequency division multiplexing */
  2384. - IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */
  2385. -};
  2386. -#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */
  2387. -
  2388. -/* XXX: not really a mode; there are really multiple PHYs */
  2389. -enum ieee80211_phymode {
  2390. - IEEE80211_MODE_AUTO = 0, /* autoselect */
  2391. - IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */
  2392. - IEEE80211_MODE_11B = 2, /* 2GHz, CCK */
  2393. - IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */
  2394. - IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */
  2395. - IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock dynamic turbo */
  2396. - IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock dynamic turbo*/
  2397. -};
  2398. -#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO_G+1)
  2399. -
  2400. -enum ieee80211_opmode {
  2401. - IEEE80211_M_STA = 1, /* infrastructure station */
  2402. - IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */
  2403. - IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */
  2404. - IEEE80211_M_HOSTAP = 6, /* Software Access Point */
  2405. - IEEE80211_M_MONITOR = 8, /* Monitor mode */
  2406. - IEEE80211_M_WDS = 2 /* WDS link */
  2407. -};
  2408. -
  2409. -/*
  2410. - * True if this mode will send beacon on a regular interval, like AP
  2411. - * or IBSS
  2412. - */
  2413. -#define IEEE80211_IS_MODE_BEACON(_opmode) \
  2414. - ((_opmode == IEEE80211_M_IBSS) || \
  2415. - (_opmode == IEEE80211_M_HOSTAP))
  2416. -
  2417. -/*
  2418. - * True if this mode must behave like a DFS master, ie do Channel
  2419. - * Check Availability and In Service Monitoring. We need to make sure
  2420. - * that all modes cannot send data without being authorized. Such
  2421. - * enforcement is not done in monitor mode however.
  2422. - */
  2423. -
  2424. -#define IEEE80211_IS_MODE_DFS_MASTER(_opmode) \
  2425. - ((_opmode == IEEE80211_M_IBSS) || \
  2426. - (_opmode == IEEE80211_M_AHDEMO) || \
  2427. - (_opmode == IEEE80211_M_HOSTAP) || \
  2428. - (_opmode == IEEE80211_M_WDS))
  2429. -
  2430. -/*
  2431. - * 802.11g protection mode.
  2432. - */
  2433. -enum ieee80211_protmode {
  2434. - IEEE80211_PROT_NONE = 0, /* no protection */
  2435. - IEEE80211_PROT_CTSONLY = 1, /* CTS to self */
  2436. - IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */
  2437. -};
  2438. -
  2439. -/*
  2440. - * Authentication mode.
  2441. - */
  2442. -enum ieee80211_authmode {
  2443. - IEEE80211_AUTH_NONE = 0,
  2444. - IEEE80211_AUTH_OPEN = 1, /* open */
  2445. - IEEE80211_AUTH_SHARED = 2, /* shared-key */
  2446. - IEEE80211_AUTH_8021X = 3, /* 802.1x */
  2447. - IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
  2448. - /* NB: these are used only for ioctls */
  2449. - IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x/PSK */
  2450. -};
  2451. -
  2452. -/*
  2453. - * Roaming mode is effectively who controls the operation
  2454. - * of the 802.11 state machine when operating as a station.
  2455. - * State transitions are controlled either by the driver
  2456. - * (typically when management frames are processed by the
  2457. - * hardware/firmware), the host (auto/normal operation of
  2458. - * the 802.11 layer), or explicitly through ioctl requests
  2459. - * when applications like wpa_supplicant want control.
  2460. - */
  2461. -enum ieee80211_roamingmode {
  2462. - IEEE80211_ROAMING_DEVICE= 0, /* driver/hardware control */
  2463. - IEEE80211_ROAMING_AUTO = 1, /* 802.11 layer control */
  2464. - IEEE80211_ROAMING_MANUAL= 2, /* application control */
  2465. -};
  2466. -
  2467. -/*
  2468. - * Scanning mode controls station scanning work; this is
  2469. - * used only when roaming mode permits the host to select
  2470. - * the bss to join/channel to use.
  2471. - */
  2472. -enum ieee80211_scanmode {
  2473. - IEEE80211_SCAN_DEVICE = 0, /* driver/hardware control */
  2474. - IEEE80211_SCAN_BEST = 1, /* 802.11 layer selects best */
  2475. - IEEE80211_SCAN_FIRST = 2, /* take first suitable candidate */
  2476. -};
  2477. -
  2478. -enum ieee80211_scanflags {
  2479. - IEEE80211_NOSCAN_DEFAULT = (1 << 0),
  2480. - IEEE80211_NOSCAN_SET = (1 << 1),
  2481. -};
  2482. -
  2483. -/*
  2484. - * Channels are specified by frequency and attributes.
  2485. - */
  2486. -struct ieee80211_channel {
  2487. - u_int16_t ic_freq; /* setting in MHz */
  2488. - u_int16_t ic_flags; /* see below */
  2489. - u_int8_t ic_ieee; /* IEEE channel number */
  2490. - int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */
  2491. - int8_t ic_maxpower; /* maximum tx power in dBm */
  2492. - int8_t ic_minpower; /* minimum tx power in dBm */
  2493. - u_int8_t ic_scanflags;
  2494. - u_int8_t ic_idletime; /* phy idle time in % */
  2495. -};
  2496. -
  2497. -#define IEEE80211_CHAN_MAX 255
  2498. -#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */
  2499. -#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
  2500. -#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
  2501. -
  2502. -#define IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT 0
  2503. -#define IEEE80211_DEFAULT_CHANCHANGE_TBTT_COUNT 3
  2504. -
  2505. -#define IEEE80211_RADAR_TEST_MUTE_CHAN 36 /* Move to channel 36 for mute test */
  2506. -
  2507. -/* bits 0-3 are for private use by drivers */
  2508. -/* channel attributes */
  2509. -#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
  2510. -#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
  2511. -#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
  2512. -#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
  2513. -#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
  2514. -#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
  2515. -#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
  2516. -#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
  2517. -#define IEEE80211_CHAN_RADAR 0x1000 /* Radar found on channel */
  2518. -#define IEEE80211_CHAN_STURBO 0x2000 /* 11a static turbo channel only */
  2519. -#define IEEE80211_CHAN_HALF 0x4000 /* Half rate channel */
  2520. -#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter rate channel */
  2521. -
  2522. -/*
  2523. - * Useful combinations of channel characteristics.
  2524. - */
  2525. -#define IEEE80211_CHAN_FHSS \
  2526. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
  2527. -#define IEEE80211_CHAN_A \
  2528. - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
  2529. -#define IEEE80211_CHAN_B \
  2530. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
  2531. -#define IEEE80211_CHAN_PUREG \
  2532. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
  2533. -#define IEEE80211_CHAN_G \
  2534. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
  2535. -#define IEEE80211_CHAN_108A \
  2536. - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
  2537. -#define IEEE80211_CHAN_108G \
  2538. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
  2539. -#define IEEE80211_CHAN_ST \
  2540. - (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
  2541. -
  2542. -#define IEEE80211_CHAN_ALL \
  2543. - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
  2544. - IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)
  2545. -#define IEEE80211_CHAN_ALLTURBO \
  2546. - (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
  2547. -
  2548. -#define IEEE80211_IS_CHAN_FHSS(_c) \
  2549. - (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
  2550. -#define IEEE80211_IS_CHAN_A(_c) \
  2551. - (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
  2552. -#define IEEE80211_IS_CHAN_B(_c) \
  2553. - (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
  2554. -#define IEEE80211_IS_CHAN_PUREG(_c) \
  2555. - (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
  2556. -#define IEEE80211_IS_CHAN_G(_c) \
  2557. - (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
  2558. -#define IEEE80211_IS_CHAN_ANYG(_c) \
  2559. - (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c))
  2560. -#define IEEE80211_IS_CHAN_ST(_c) \
  2561. - (((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST)
  2562. -#define IEEE80211_IS_CHAN_108A(_c) \
  2563. - (((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A)
  2564. -#define IEEE80211_IS_CHAN_108G(_c) \
  2565. - (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
  2566. -
  2567. -#define IEEE80211_IS_CHAN_2GHZ(_c) \
  2568. - (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
  2569. -#define IEEE80211_IS_CHAN_5GHZ(_c) \
  2570. - (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
  2571. -#define IEEE80211_IS_CHAN_OFDM(_c) \
  2572. - (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
  2573. -#define IEEE80211_IS_CHAN_CCK(_c) \
  2574. - (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
  2575. -#define IEEE80211_IS_CHAN_GFSK(_c) \
  2576. - (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
  2577. -#define IEEE80211_IS_CHAN_TURBO(_c) \
  2578. - (((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0)
  2579. -#define IEEE80211_IS_CHAN_STURBO(_c) \
  2580. - (((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0)
  2581. -#define IEEE80211_IS_CHAN_DTURBO(_c) \
  2582. - (((_c)->ic_flags & \
  2583. - (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO)
  2584. -#define IEEE80211_IS_CHAN_HALF(_c) \
  2585. - (((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0)
  2586. -#define IEEE80211_IS_CHAN_QUARTER(_c) \
  2587. - (((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0)
  2588. -
  2589. -#define IEEE80211_IS_CHAN_RADAR(_c) \
  2590. - (((_c)->ic_flags & IEEE80211_CHAN_RADAR) != 0)
  2591. -#define IEEE80211_IS_CHAN_PASSIVE(_c) \
  2592. - (((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0)
  2593. -#define IEEE80211_ARE_CHANS_SAME_MODE(_a, _b) \
  2594. - (((_a)->ic_flags & IEEE80211_CHAN_ALLTURBO) == ((_b)->ic_flags & IEEE80211_CHAN_ALLTURBO))
  2595. -
  2596. -/* ni_chan encoding for FH phy */
  2597. -#define IEEE80211_FH_CHANMOD 80
  2598. -#define IEEE80211_FH_CHAN(set,pat) (((set) - 1) * IEEE80211_FH_CHANMOD + (pat))
  2599. -#define IEEE80211_FH_CHANSET(chan) ((chan) / IEEE80211_FH_CHANMOD + 1)
  2600. -#define IEEE80211_FH_CHANPAT(chan) ((chan) % IEEE80211_FH_CHANMOD)
  2601. -
  2602. -/*
  2603. - * Spectrum Management (IEEE 802.11h-2003)
  2604. - */
  2605. -
  2606. -/* algorithm for (re)association based on supported channels
  2607. - * (the one mentioned in 11.6.1 as out of scope of .11h) */
  2608. -enum ieee80211_sc_algorithm {
  2609. - IEEE80211_SC_NONE,
  2610. - /*
  2611. - * Do not disallow anyone from associating. When needed, channel will
  2612. - * be switched to the most suitable channel, no matter client stations
  2613. - * support it or not.
  2614. - */
  2615. -
  2616. - IEEE80211_SC_LOOSE,
  2617. - /*
  2618. - * Do not disallow anyone from associating. When needed, channel will
  2619. - * be switched to a suitable channel, which will be chosen taking
  2620. - * ni->ni_suppchans and ic->ic_sc_sldg under consideration.
  2621. - */
  2622. -
  2623. - IEEE80211_SC_TIGHT,
  2624. - /*
  2625. - * Allow to associate if there are at least ic->ic_mincom channels
  2626. - * common to the associating station and all of the already associated
  2627. - * stations. If the number of new common channels is less than
  2628. - * required, consider disassociating some other STAs. Such a
  2629. - * disassociation will be performed if (and only if) the association we
  2630. - * are currently considering would be then possible and the count of
  2631. - * the resultant set of common channels (ic_chan_nodes[i] ==
  2632. - * ic_cn_total) would increase by some amount. Whether the number of
  2633. - * the new channels that could be gained is enough to sacrifice a
  2634. - * number of STAs is determined by the ic->ic_slcg parameter.
  2635. - */
  2636. -
  2637. - IEEE80211_SC_STRICT
  2638. - /*
  2639. - * Basically the same behavior as IEEE80211_SC_TIGHT, except that if a
  2640. - * station does not specify Supported Channels, then it is denied to
  2641. - * associate.
  2642. - */
  2643. -};
  2644. -
  2645. -/*
  2646. - * 802.11 rate set.
  2647. - */
  2648. -#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */
  2649. -#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
  2650. -#define IEEE80211_SANITISE_RATESIZE(_rsz) \
  2651. - ((_rsz > IEEE80211_RATE_MAXSIZE) ? IEEE80211_RATE_MAXSIZE : _rsz)
  2652. -
  2653. -struct ieee80211_rateset {
  2654. - u_int8_t rs_nrates;
  2655. - u_int8_t rs_rates[IEEE80211_RATE_MAXSIZE];
  2656. -};
  2657. -
  2658. -struct ieee80211_roam {
  2659. - int8_t rssi11a; /* rssi thresh for 11a bss */
  2660. - int8_t rssi11b; /* for 11g sta in 11b bss */
  2661. - int8_t rssi11bOnly; /* for 11b sta */
  2662. - u_int8_t pad1;
  2663. - u_int8_t rate11a; /* rate thresh for 11a bss */
  2664. - u_int8_t rate11b; /* for 11g sta in 11b bss */
  2665. - u_int8_t rate11bOnly; /* for 11b sta */
  2666. - u_int8_t pad2;
  2667. -};
  2668. -#endif /* _NET80211__IEEE80211_H_ */
  2669. diff --git a/package/hostapd/madwifi/net80211/ieee80211.h b/package/hostapd/madwifi/net80211/ieee80211.h
  2670. deleted file mode 100644
  2671. index a39d4b9..0000000
  2672. --- a/package/hostapd/madwifi/net80211/ieee80211.h
  2673. +++ /dev/null
  2674. @@ -1,997 +0,0 @@
  2675. -/*-
  2676. - * Copyright (c) 2001 Atsushi Onoe
  2677. - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  2678. - * All rights reserved.
  2679. - *
  2680. - * Redistribution and use in source and binary forms, with or without
  2681. - * modification, are permitted provided that the following conditions
  2682. - * are met:
  2683. - * 1. Redistributions of source code must retain the above copyright
  2684. - * notice, this list of conditions and the following disclaimer.
  2685. - * 2. Redistributions in binary form must reproduce the above copyright
  2686. - * notice, this list of conditions and the following disclaimer in the
  2687. - * documentation and/or other materials provided with the distribution.
  2688. - * 3. The name of the author may not be used to endorse or promote products
  2689. - * derived from this software without specific prior written permission.
  2690. - *
  2691. - * Alternatively, this software may be distributed under the terms of the
  2692. - * GNU General Public License ("GPL") version 2 as published by the Free
  2693. - * Software Foundation.
  2694. - *
  2695. - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  2696. - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  2697. - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  2698. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2699. - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2700. - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2701. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2702. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2703. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2704. - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2705. - *
  2706. - * $Id: ieee80211.h 3268 2008-01-26 20:48:11Z mtaylor $
  2707. - */
  2708. -#ifndef _NET80211_IEEE80211_H_
  2709. -#define _NET80211_IEEE80211_H_
  2710. -
  2711. -/*
  2712. - * 802.11 protocol definitions.
  2713. - */
  2714. -
  2715. -#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
  2716. -/* is 802.11 address multicast/broadcast? */
  2717. -#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
  2718. -
  2719. -/* IEEE 802.11 PLCP header */
  2720. -struct ieee80211_plcp_hdr {
  2721. - u_int16_t i_sfd;
  2722. - u_int8_t i_signal;
  2723. - u_int8_t i_service;
  2724. - u_int16_t i_length;
  2725. - u_int16_t i_crc;
  2726. -} __packed;
  2727. -
  2728. -#define IEEE80211_PLCP_SFD 0xF3A0
  2729. -#define IEEE80211_PLCP_SERVICE 0x00
  2730. -
  2731. -/*
  2732. - * generic definitions for IEEE 802.11 frames
  2733. - */
  2734. -struct ieee80211_frame {
  2735. - u_int8_t i_fc[2];
  2736. - __le16 i_dur;
  2737. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  2738. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  2739. - u_int8_t i_addr3[IEEE80211_ADDR_LEN];
  2740. - u_int8_t i_seq[2];
  2741. - /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
  2742. - /* see below */
  2743. -} __packed;
  2744. -
  2745. -struct ieee80211_qosframe {
  2746. - u_int8_t i_fc[2];
  2747. - __le16 i_dur;
  2748. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  2749. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  2750. - u_int8_t i_addr3[IEEE80211_ADDR_LEN];
  2751. - u_int8_t i_seq[2];
  2752. - u_int8_t i_qos[2];
  2753. - /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
  2754. - /* see below */
  2755. -} __packed;
  2756. -
  2757. -struct ieee80211_qoscntl {
  2758. - u_int8_t i_qos[2];
  2759. -};
  2760. -
  2761. -struct ieee80211_frame_addr4 {
  2762. - u_int8_t i_fc[2];
  2763. - __le16 i_dur;
  2764. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  2765. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  2766. - u_int8_t i_addr3[IEEE80211_ADDR_LEN];
  2767. - u_int8_t i_seq[2];
  2768. - u_int8_t i_addr4[IEEE80211_ADDR_LEN];
  2769. -} __packed;
  2770. -
  2771. -
  2772. -struct ieee80211_qosframe_addr4 {
  2773. - u_int8_t i_fc[2];
  2774. - __le16 i_dur;
  2775. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  2776. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  2777. - u_int8_t i_addr3[IEEE80211_ADDR_LEN];
  2778. - u_int8_t i_seq[2];
  2779. - u_int8_t i_addr4[IEEE80211_ADDR_LEN];
  2780. - u_int8_t i_qos[2];
  2781. -} __packed;
  2782. -
  2783. -struct ieee80211_ctlframe_addr2 {
  2784. - u_int8_t i_fc[2];
  2785. - __le16 i_aidordur; /* AID or duration */
  2786. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  2787. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  2788. -} __packed;
  2789. -
  2790. -#define IEEE80211_FC0_VERSION_MASK 0x03
  2791. -#define IEEE80211_FC0_VERSION_SHIFT 0
  2792. -#define IEEE80211_FC0_VERSION_0 0x00
  2793. -#define IEEE80211_FC0_TYPE_MASK 0x0c
  2794. -#define IEEE80211_FC0_TYPE_SHIFT 2
  2795. -#define IEEE80211_FC0_TYPE_MGT 0x00
  2796. -#define IEEE80211_FC0_TYPE_CTL 0x04
  2797. -#define IEEE80211_FC0_TYPE_DATA 0x08
  2798. -
  2799. -#define IEEE80211_FC0_SUBTYPE_MASK 0xf0
  2800. -#define IEEE80211_FC0_SUBTYPE_SHIFT 4
  2801. -/* for TYPE_MGT */
  2802. -#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
  2803. -#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
  2804. -#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
  2805. -#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
  2806. -#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
  2807. -#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
  2808. -#define IEEE80211_FC0_SUBTYPE_BEACON 0x80
  2809. -#define IEEE80211_FC0_SUBTYPE_ATIM 0x90
  2810. -#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
  2811. -#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
  2812. -#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
  2813. -#define IEEE80211_FC0_SUBTYPE_ACTION 0xd0
  2814. -/* for TYPE_CTL */
  2815. -#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0
  2816. -#define IEEE80211_FC0_SUBTYPE_RTS 0xb0
  2817. -#define IEEE80211_FC0_SUBTYPE_CTS 0xc0
  2818. -#define IEEE80211_FC0_SUBTYPE_ACK 0xd0
  2819. -#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
  2820. -#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
  2821. -/* for TYPE_DATA (bit combination) */
  2822. -#define IEEE80211_FC0_SUBTYPE_DATA 0x00
  2823. -#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
  2824. -#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
  2825. -#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
  2826. -#define IEEE80211_FC0_SUBTYPE_NODATA 0x40
  2827. -#define IEEE80211_FC0_SUBTYPE_CFACK 0x50
  2828. -#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
  2829. -#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
  2830. -#define IEEE80211_FC0_SUBTYPE_QOS 0x80
  2831. -#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0
  2832. -
  2833. -#define IEEE80211_FC1_DIR_MASK 0x03
  2834. -#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
  2835. -#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
  2836. -#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
  2837. -#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
  2838. -
  2839. -#define IEEE80211_FC1_MORE_FRAG 0x04
  2840. -#define IEEE80211_FC1_RETRY 0x08
  2841. -#define IEEE80211_FC1_PWR_MGT 0x10
  2842. -#define IEEE80211_FC1_MORE_DATA 0x20
  2843. -#define IEEE80211_FC1_PROT 0x40
  2844. -#define IEEE80211_FC1_ORDER 0x80
  2845. -
  2846. -#define IEEE80211_SEQ_FRAG_MASK 0x000f
  2847. -#define IEEE80211_SEQ_FRAG_SHIFT 0
  2848. -#define IEEE80211_SEQ_SEQ_MASK 0xfff0
  2849. -#define IEEE80211_SEQ_SEQ_SHIFT 4
  2850. -
  2851. -#define IEEE80211_NWID_LEN 32
  2852. -
  2853. -#define IEEE80211_QOS_TXOP 0x00ff
  2854. -/* bit 8 is reserved */
  2855. -#define IEEE80211_QOS_ACKPOLICY 0x60
  2856. -#define IEEE80211_QOS_ACKPOLICY_S 5
  2857. -#define IEEE80211_QOS_EOSP 0x10
  2858. -#define IEEE80211_QOS_EOSP_S 4
  2859. -#define IEEE80211_QOS_TID 0x0f
  2860. -
  2861. -#define IEEE80211_FRM_HAS_BODY(_wh) \
  2862. - (((_wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != \
  2863. - IEEE80211_FC0_TYPE_CTL)
  2864. -
  2865. -/*
  2866. - * Country/Region Codes from MS WINNLS.H
  2867. - * Numbering from ISO 3166
  2868. - * XXX belongs elsewhere
  2869. - */
  2870. -enum CountryCode {
  2871. - CTRY_ALBANIA = 8, /* Albania */
  2872. - CTRY_ALGERIA = 12, /* Algeria */
  2873. - CTRY_ARGENTINA = 32, /* Argentina */
  2874. - CTRY_ARMENIA = 51, /* Armenia */
  2875. - CTRY_AUSTRALIA = 36, /* Australia */
  2876. - CTRY_AUSTRIA = 40, /* Austria */
  2877. - CTRY_AZERBAIJAN = 31, /* Azerbaijan */
  2878. - CTRY_BAHRAIN = 48, /* Bahrain */
  2879. - CTRY_BELARUS = 112, /* Belarus */
  2880. - CTRY_BELGIUM = 56, /* Belgium */
  2881. - CTRY_BELIZE = 84, /* Belize */
  2882. - CTRY_BOLIVIA = 68, /* Bolivia */
  2883. - CTRY_BRAZIL = 76, /* Brazil */
  2884. - CTRY_BRUNEI_DARUSSALAM = 96, /* Brunei Darussalam */
  2885. - CTRY_BULGARIA = 100, /* Bulgaria */
  2886. - CTRY_CANADA = 124, /* Canada */
  2887. - CTRY_CHILE = 152, /* Chile */
  2888. - CTRY_CHINA = 156, /* People's Republic of China */
  2889. - CTRY_COLOMBIA = 170, /* Colombia */
  2890. - CTRY_COSTA_RICA = 188, /* Costa Rica */
  2891. - CTRY_CROATIA = 191, /* Croatia */
  2892. - CTRY_CYPRUS = 196,
  2893. - CTRY_CZECH = 203, /* Czech Republic */
  2894. - CTRY_DENMARK = 208, /* Denmark */
  2895. - CTRY_DOMINICAN_REPUBLIC = 214, /* Dominican Republic */
  2896. - CTRY_ECUADOR = 218, /* Ecuador */
  2897. - CTRY_EGYPT = 818, /* Egypt */
  2898. - CTRY_EL_SALVADOR = 222, /* El Salvador */
  2899. - CTRY_ESTONIA = 233, /* Estonia */
  2900. - CTRY_FAEROE_ISLANDS = 234, /* Faeroe Islands */
  2901. - CTRY_FINLAND = 246, /* Finland */
  2902. - CTRY_FRANCE = 250, /* France */
  2903. - CTRY_FRANCE2 = 255, /* France2 */
  2904. - CTRY_GEORGIA = 268, /* Georgia */
  2905. - CTRY_GERMANY = 276, /* Germany */
  2906. - CTRY_GREECE = 300, /* Greece */
  2907. - CTRY_GUATEMALA = 320, /* Guatemala */
  2908. - CTRY_HONDURAS = 340, /* Honduras */
  2909. - CTRY_HONG_KONG = 344, /* Hong Kong S.A.R., P.R.C. */
  2910. - CTRY_HUNGARY = 348, /* Hungary */
  2911. - CTRY_ICELAND = 352, /* Iceland */
  2912. - CTRY_INDIA = 356, /* India */
  2913. - CTRY_INDONESIA = 360, /* Indonesia */
  2914. - CTRY_IRAN = 364, /* Iran */
  2915. - CTRY_IRAQ = 368, /* Iraq */
  2916. - CTRY_IRELAND = 372, /* Ireland */
  2917. - CTRY_ISRAEL = 376, /* Israel */
  2918. - CTRY_ITALY = 380, /* Italy */
  2919. - CTRY_JAMAICA = 388, /* Jamaica */
  2920. - CTRY_JAPAN = 392, /* Japan */
  2921. - CTRY_JAPAN1 = 393, /* Japan (JP1) */
  2922. - CTRY_JAPAN2 = 394, /* Japan (JP0) */
  2923. - CTRY_JAPAN3 = 395, /* Japan (JP1-1) */
  2924. - CTRY_JAPAN4 = 396, /* Japan (JE1) */
  2925. - CTRY_JAPAN5 = 397, /* Japan (JE2) */
  2926. - CTRY_JAPAN6 = 399, /* Japan (JP6) */
  2927. - CTRY_JAPAN7 = 900, /* Japan */
  2928. - CTRY_JAPAN8 = 901, /* Japan */
  2929. - CTRY_JAPAN9 = 902, /* Japan */
  2930. - CTRY_JAPAN10 = 903, /* Japan */
  2931. - CTRY_JAPAN11 = 904, /* Japan */
  2932. - CTRY_JAPAN12 = 905, /* Japan */
  2933. - CTRY_JAPAN13 = 906, /* Japan */
  2934. - CTRY_JAPAN14 = 907, /* Japan */
  2935. - CTRY_JAPAN15 = 908, /* Japan */
  2936. - CTRY_JAPAN16 = 909, /* Japan */
  2937. - CTRY_JAPAN17 = 910, /* Japan */
  2938. - CTRY_JAPAN18 = 911, /* Japan */
  2939. - CTRY_JAPAN19 = 912, /* Japan */
  2940. - CTRY_JAPAN20 = 913, /* Japan */
  2941. - CTRY_JAPAN21 = 914, /* Japan */
  2942. - CTRY_JAPAN22 = 915, /* Japan */
  2943. - CTRY_JAPAN23 = 916, /* Japan */
  2944. - CTRY_JAPAN24 = 917, /* Japan */
  2945. - CTRY_JAPAN25 = 918, /* Japan */
  2946. - CTRY_JAPAN26 = 919, /* Japan */
  2947. - CTRY_JAPAN27 = 920, /* Japan */
  2948. - CTRY_JAPAN28 = 921, /* Japan */
  2949. - CTRY_JAPAN29 = 922, /* Japan */
  2950. - CTRY_JAPAN30 = 923, /* Japan */
  2951. - CTRY_JAPAN31 = 924, /* Japan */
  2952. - CTRY_JAPAN32 = 925, /* Japan */
  2953. - CTRY_JAPAN33 = 926, /* Japan */
  2954. - CTRY_JAPAN34 = 927, /* Japan */
  2955. - CTRY_JAPAN35 = 928, /* Japan */
  2956. - CTRY_JAPAN36 = 929, /* Japan */
  2957. - CTRY_JAPAN37 = 930, /* Japan */
  2958. - CTRY_JAPAN38 = 931, /* Japan */
  2959. - CTRY_JAPAN39 = 932, /* Japan */
  2960. - CTRY_JAPAN40 = 933, /* Japan */
  2961. - CTRY_JAPAN41 = 934, /* Japan */
  2962. - CTRY_JAPAN42 = 935, /* Japan */
  2963. - CTRY_JAPAN43 = 936, /* Japan */
  2964. - CTRY_JAPAN44 = 937, /* Japan */
  2965. - CTRY_JAPAN45 = 938, /* Japan */
  2966. - CTRY_JAPAN46 = 939, /* Japan */
  2967. - CTRY_JAPAN47 = 940, /* Japan */
  2968. - CTRY_JAPAN48 = 941, /* Japan */
  2969. - CTRY_JORDAN = 400, /* Jordan */
  2970. - CTRY_KAZAKHSTAN = 398, /* Kazakhstan */
  2971. - CTRY_KENYA = 404, /* Kenya */
  2972. - CTRY_KOREA_NORTH = 408, /* North Korea */
  2973. - CTRY_KOREA_ROC = 410, /* South Korea */
  2974. - CTRY_KOREA_ROC2 = 411, /* South Korea */
  2975. - CTRY_KUWAIT = 414, /* Kuwait */
  2976. - CTRY_LATVIA = 428, /* Latvia */
  2977. - CTRY_LEBANON = 422, /* Lebanon */
  2978. - CTRY_LIBYA = 434, /* Libya */
  2979. - CTRY_LIECHTENSTEIN = 438, /* Liechtenstein */
  2980. - CTRY_LITHUANIA = 440, /* Lithuania */
  2981. - CTRY_LUXEMBOURG = 442, /* Luxembourg */
  2982. - CTRY_MACAU = 446, /* Macau */
  2983. - CTRY_MACEDONIA = 807, /* the Former Yugoslav Republic of Macedonia */
  2984. - CTRY_MALAYSIA = 458, /* Malaysia */
  2985. - CTRY_MEXICO = 484, /* Mexico */
  2986. - CTRY_MONACO = 492, /* Principality of Monaco */
  2987. - CTRY_MOROCCO = 504, /* Morocco */
  2988. - CTRY_NETHERLANDS = 528, /* Netherlands */
  2989. - CTRY_NEW_ZEALAND = 554, /* New Zealand */
  2990. - CTRY_NICARAGUA = 558, /* Nicaragua */
  2991. - CTRY_NORWAY = 578, /* Norway */
  2992. - CTRY_OMAN = 512, /* Oman */
  2993. - CTRY_PAKISTAN = 586, /* Islamic Republic of Pakistan */
  2994. - CTRY_PANAMA = 591, /* Panama */
  2995. - CTRY_PARAGUAY = 600, /* Paraguay */
  2996. - CTRY_PERU = 604, /* Peru */
  2997. - CTRY_PHILIPPINES = 608, /* Republic of the Philippines */
  2998. - CTRY_POLAND = 616, /* Poland */
  2999. - CTRY_PORTUGAL = 620, /* Portugal */
  3000. - CTRY_PUERTO_RICO = 630, /* Puerto Rico */
  3001. - CTRY_QATAR = 634, /* Qatar */
  3002. - CTRY_ROMANIA = 642, /* Romania */
  3003. - CTRY_RUSSIA = 643, /* Russia */
  3004. - CTRY_SAUDI_ARABIA = 682, /* Saudi Arabia */
  3005. - CTRY_SINGAPORE = 702, /* Singapore */
  3006. - CTRY_SLOVAKIA = 703, /* Slovak Republic */
  3007. - CTRY_SLOVENIA = 705, /* Slovenia */
  3008. - CTRY_SOUTH_AFRICA = 710, /* South Africa */
  3009. - CTRY_SPAIN = 724, /* Spain */
  3010. - CTRY_SWEDEN = 752, /* Sweden */
  3011. - CTRY_SWITZERLAND = 756, /* Switzerland */
  3012. - CTRY_SYRIA = 760, /* Syria */
  3013. - CTRY_TAIWAN = 158, /* Taiwan */
  3014. - CTRY_THAILAND = 764, /* Thailand */
  3015. - CTRY_TRINIDAD_Y_TOBAGO = 780, /* Trinidad y Tobago */
  3016. - CTRY_TUNISIA = 788, /* Tunisia */
  3017. - CTRY_TURKEY = 792, /* Turkey */
  3018. - CTRY_UAE = 784, /* U.A.E. */
  3019. - CTRY_UKRAINE = 804, /* Ukraine */
  3020. - CTRY_UNITED_KINGDOM = 826, /* United Kingdom */
  3021. - CTRY_UNITED_STATES = 840, /* United States */
  3022. - CTRY_UNITED_STATES_FCC49 = 842, /* United States (Public Safety)*/
  3023. - CTRY_URUGUAY = 858, /* Uruguay */
  3024. - CTRY_UZBEKISTAN = 860, /* Uzbekistan */
  3025. - CTRY_VENEZUELA = 862, /* Venezuela */
  3026. - CTRY_VIET_NAM = 704, /* Viet Nam */
  3027. - CTRY_YEMEN = 887, /* Yemen */
  3028. - CTRY_ZIMBABWE = 716 /* Zimbabwe */
  3029. -};
  3030. -
  3031. -/*
  3032. - * Generic information element
  3033. - */
  3034. -struct ieee80211_ie {
  3035. - u_int8_t id;
  3036. - u_int8_t len;
  3037. - u_int8_t info[0];
  3038. -} __packed;
  3039. -
  3040. -/*
  3041. - * Country information element.
  3042. - */
  3043. -#define IEEE80211_COUNTRY_MAX_TRIPLETS (83)
  3044. -struct ieee80211_ie_country {
  3045. - u_int8_t country_id;
  3046. - u_int8_t country_len;
  3047. - u_int8_t country_str[3];
  3048. - u_int8_t country_triplet[IEEE80211_COUNTRY_MAX_TRIPLETS * 3];
  3049. -} __packed;
  3050. -
  3051. -/*
  3052. - * Power Constraint information element.
  3053. - */
  3054. -struct ieee80211_ie_pwrcnstr {
  3055. - u_int8_t pc_id; /* IEEE80211_ELEMID_PWRCNSTR */
  3056. - u_int8_t pc_len; /* == 2 */
  3057. - u_int8_t pc_lpc; /* Local Power Constraint [dB] */
  3058. -} __packed;
  3059. -
  3060. -/*
  3061. - * Power Capability information element.
  3062. - */
  3063. -struct ieee80211_ie_pwrcap {
  3064. - u_int8_t pc_id; /* IEEE80211_ELEMID_PWRCAP */
  3065. - u_int8_t pc_len; /* == 2 */
  3066. - int8_t pc_mintxpow; /* Minimum Transmit Power Capability [dBm] */
  3067. - int8_t pc_maxtxpow; /* Maximum Transmit Power Capability [dBm] */
  3068. -} __packed;
  3069. -
  3070. -/*
  3071. - * Supported Channels information element.
  3072. - */
  3073. -#define IEEE80211_SUPPCHAN_MAX_PAIRS (127)
  3074. -struct ieee80211_ie_sc {
  3075. - u_int8_t sc_id; /* IEEE80211_ELEMID_SUPPCHAN */
  3076. - u_int8_t sc_len; /* == 2 * number of sc_subband elements */
  3077. - struct {
  3078. - u_int8_t sc_first; /* First Channel Number */
  3079. - u_int8_t sc_number; /* Number of Channels */
  3080. - } __packed sc_subband[IEEE80211_SUPPCHAN_MAX_PAIRS];
  3081. -} __packed;
  3082. -
  3083. -/*
  3084. - * Channel Switch Announcement information element.
  3085. - */
  3086. -struct ieee80211_ie_csa {
  3087. - u_int8_t csa_id; /* IEEE80211_ELEMID_CHANSWITCHANN */
  3088. - u_int8_t csa_len; /* == 3 */
  3089. - u_int8_t csa_mode; /* Channel Switch Mode: 1 == stop transmission until CS */
  3090. - u_int8_t csa_chan; /* New Channel Number */
  3091. - u_int8_t csa_count; /* TBTTs until Channel Switch happens */
  3092. -} __packed;
  3093. -
  3094. -/* minimal Channel Switch Count in the initial announcement */
  3095. -#define IEEE80211_CSA_PROTECTION_PERIOD 3
  3096. -
  3097. -/* maximum allowed deviance of measurement of intervals between CSA in Beacons */
  3098. -#define IEEE80211_CSA_SANITY_THRESHOLD 100
  3099. -
  3100. -
  3101. -/* does frame have QoS sequence control data */
  3102. -#define IEEE80211_QOS_HAS_SEQ(wh) \
  3103. - (((wh)->i_fc[0] & \
  3104. - (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
  3105. - (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
  3106. -
  3107. -#define WME_QOSINFO_COUNT 0x0f /* Mask for Param Set Count field */
  3108. -/*
  3109. - * WME/802.11e information element.
  3110. - */
  3111. -struct ieee80211_ie_wme {
  3112. - u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */
  3113. - u_int8_t wme_len; /* length in bytes */
  3114. - u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */
  3115. - u_int8_t wme_type; /* OUI type */
  3116. - u_int8_t wme_subtype; /* OUI subtype */
  3117. - u_int8_t wme_version; /* spec revision */
  3118. - u_int8_t wme_info; /* QoS info */
  3119. -} __packed;
  3120. -
  3121. -/*
  3122. - * WME/802.11e Tspec Element
  3123. - */
  3124. -struct ieee80211_wme_tspec {
  3125. - u_int8_t ts_id;
  3126. - u_int8_t ts_len;
  3127. - u_int8_t ts_oui[3];
  3128. - u_int8_t ts_oui_type;
  3129. - u_int8_t ts_oui_subtype;
  3130. - u_int8_t ts_version;
  3131. - u_int8_t ts_tsinfo[3];
  3132. - u_int8_t ts_nom_msdu[2];
  3133. - u_int8_t ts_max_msdu[2];
  3134. - u_int8_t ts_min_svc[4];
  3135. - u_int8_t ts_max_svc[4];
  3136. - u_int8_t ts_inactv_intv[4];
  3137. - u_int8_t ts_susp_intv[4];
  3138. - u_int8_t ts_start_svc[4];
  3139. - u_int8_t ts_min_rate[4];
  3140. - u_int8_t ts_mean_rate[4];
  3141. - u_int8_t ts_max_burst[4];
  3142. - u_int8_t ts_min_phy[4];
  3143. - u_int8_t ts_peak_rate[4];
  3144. - u_int8_t ts_delay[4];
  3145. - u_int8_t ts_surplus[2];
  3146. - u_int8_t ts_medium_time[2];
  3147. -} __packed;
  3148. -
  3149. -/*
  3150. - * WME AC parameter field
  3151. - */
  3152. -
  3153. -struct ieee80211_wme_acparams {
  3154. - u_int8_t acp_aci_aifsn;
  3155. - u_int8_t acp_logcwminmax;
  3156. - u_int16_t acp_txop;
  3157. -} __packed;
  3158. -
  3159. -#define IEEE80211_WME_PARAM_LEN 24
  3160. -#define WME_NUM_AC 4 /* 4 AC categories */
  3161. -
  3162. -#define WME_PARAM_ACI 0x60 /* Mask for ACI field */
  3163. -#define WME_PARAM_ACI_S 5 /* Shift for ACI field */
  3164. -#define WME_PARAM_ACM 0x10 /* Mask for ACM bit */
  3165. -#define WME_PARAM_ACM_S 4 /* Shift for ACM bit */
  3166. -#define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */
  3167. -#define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */
  3168. -#define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */
  3169. -#define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */
  3170. -#define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */
  3171. -#define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
  3172. -
  3173. -#define WME_AC_TO_TID(_ac) ( \
  3174. - ((_ac) == WME_AC_VO) ? 6 : \
  3175. - ((_ac) == WME_AC_VI) ? 5 : \
  3176. - ((_ac) == WME_AC_BK) ? 1 : \
  3177. - 0)
  3178. -
  3179. -#define TID_TO_WME_AC(_tid) ( \
  3180. - ((_tid) < 1) ? WME_AC_BE : \
  3181. - ((_tid) < 3) ? WME_AC_BK : \
  3182. - ((_tid) < 6) ? WME_AC_VI : \
  3183. - WME_AC_VO)
  3184. -
  3185. -/*
  3186. - * WME Parameter Element
  3187. - */
  3188. -
  3189. -struct ieee80211_wme_param {
  3190. - u_int8_t param_id;
  3191. - u_int8_t param_len;
  3192. - u_int8_t param_oui[3];
  3193. - u_int8_t param_oui_type;
  3194. - u_int8_t param_oui_sybtype;
  3195. - u_int8_t param_version;
  3196. - u_int8_t param_qosInfo;
  3197. - u_int8_t param_reserved;
  3198. - struct ieee80211_wme_acparams params_acParams[WME_NUM_AC];
  3199. -} __packed;
  3200. -
  3201. -/*
  3202. - * WME U-APSD qos info field defines
  3203. - */
  3204. -#define WME_CAPINFO_UAPSD_EN 0x00000080
  3205. -#define WME_CAPINFO_UAPSD_VO 0x00000001
  3206. -#define WME_CAPINFO_UAPSD_VI 0x00000002
  3207. -#define WME_CAPINFO_UAPSD_BK 0x00000004
  3208. -#define WME_CAPINFO_UAPSD_BE 0x00000008
  3209. -#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT 0
  3210. -#define WME_CAPINFO_UAPSD_ACFLAGS_MASK 0xF
  3211. -#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5
  3212. -#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3
  3213. -#define WME_CAPINFO_IE_OFFSET 8
  3214. -#define WME_UAPSD_MAXSP(_qosinfo) \
  3215. - (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & \
  3216. - WME_CAPINFO_UAPSD_MAXSP_MASK)
  3217. -#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) \
  3218. - ((1 << (3 - (_ac))) & ( \
  3219. - ((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & \
  3220. - WME_CAPINFO_UAPSD_ACFLAGS_MASK))
  3221. -
  3222. -/*
  3223. - * Atheros Advanced Capability information element.
  3224. - */
  3225. -struct ieee80211_ie_athAdvCap {
  3226. - u_int8_t athAdvCap_id; /* IEEE80211_ELEMID_VENDOR */
  3227. - u_int8_t athAdvCap_len; /* length in bytes */
  3228. - u_int8_t athAdvCap_oui[3]; /* 0x00, 0x03, 0x7f */
  3229. - u_int8_t athAdvCap_type; /* OUI type */
  3230. - u_int8_t athAdvCap_subtype; /* OUI subtype */
  3231. - u_int8_t athAdvCap_version; /* spec revision */
  3232. - u_int8_t athAdvCap_capability; /* Capability info */
  3233. - u_int16_t athAdvCap_defKeyIndex;
  3234. -} __packed;
  3235. -
  3236. -/*
  3237. - * Atheros XR information element.
  3238. - */
  3239. -struct ieee80211_xr_param {
  3240. - u_int8_t param_id;
  3241. - u_int8_t param_len;
  3242. - u_int8_t param_oui[3];
  3243. - u_int8_t param_oui_type;
  3244. - u_int8_t param_oui_sybtype;
  3245. - u_int8_t param_version;
  3246. - u_int8_t param_Info;
  3247. - u_int8_t param_base_bssid[IEEE80211_ADDR_LEN];
  3248. - u_int8_t param_xr_bssid[IEEE80211_ADDR_LEN];
  3249. - u_int16_t param_xr_beacon_interval;
  3250. - u_int8_t param_base_ath_capability;
  3251. - u_int8_t param_xr_ath_capability;
  3252. -} __packed;
  3253. -
  3254. -/* Atheros capabilities */
  3255. -#define IEEE80211_ATHC_TURBOP 0x0001 /* Turbo Prime */
  3256. -#define IEEE80211_ATHC_COMP 0x0002 /* Compression */
  3257. -#define IEEE80211_ATHC_FF 0x0004 /* Fast Frames */
  3258. -#define IEEE80211_ATHC_XR 0x0008 /* Xtended Range support */
  3259. -#define IEEE80211_ATHC_AR 0x0010 /* Advanced Radar support */
  3260. -#define IEEE80211_ATHC_BURST 0x0020 /* Bursting - not negotiated */
  3261. -#define IEEE80211_ATHC_WME 0x0040 /* CWMin tuning */
  3262. -#define IEEE80211_ATHC_BOOST 0x0080 /* Boost */
  3263. -
  3264. -/*
  3265. - * Management Notification Frame
  3266. - */
  3267. -struct ieee80211_mnf {
  3268. - u_int8_t mnf_category;
  3269. - u_int8_t mnf_action;
  3270. - u_int8_t mnf_dialog;
  3271. - u_int8_t mnf_status;
  3272. -} __packed;
  3273. -#define MNF_SETUP_REQ 0
  3274. -#define MNF_SETUP_RESP 1
  3275. -#define MNF_TEARDOWN 2
  3276. -
  3277. -/*
  3278. - * Control frames.
  3279. - */
  3280. -struct ieee80211_frame_min {
  3281. - u_int8_t i_fc[2];
  3282. - __le16 i_dur;
  3283. - u_int8_t i_addr1[IEEE80211_ADDR_LEN];
  3284. - u_int8_t i_addr2[IEEE80211_ADDR_LEN];
  3285. - /* FCS */
  3286. -} __packed;
  3287. -
  3288. -struct ieee80211_frame_rts {
  3289. - u_int8_t i_fc[2];
  3290. - __le16 i_dur;
  3291. - u_int8_t i_ra[IEEE80211_ADDR_LEN];
  3292. - u_int8_t i_ta[IEEE80211_ADDR_LEN];
  3293. - /* FCS */
  3294. -} __packed;
  3295. -
  3296. -struct ieee80211_frame_cts {
  3297. - u_int8_t i_fc[2];
  3298. - __le16 i_dur;
  3299. - u_int8_t i_ra[IEEE80211_ADDR_LEN];
  3300. - /* FCS */
  3301. -} __packed;
  3302. -
  3303. -struct ieee80211_frame_ack {
  3304. - u_int8_t i_fc[2];
  3305. - __le16 i_dur;
  3306. - u_int8_t i_ra[IEEE80211_ADDR_LEN];
  3307. - /* FCS */
  3308. -} __packed;
  3309. -
  3310. -struct ieee80211_frame_pspoll {
  3311. - u_int8_t i_fc[2];
  3312. - u_int8_t i_aid[2];
  3313. - u_int8_t i_bssid[IEEE80211_ADDR_LEN];
  3314. - u_int8_t i_ta[IEEE80211_ADDR_LEN];
  3315. - /* FCS */
  3316. -} __packed;
  3317. -
  3318. -struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */
  3319. - u_int8_t i_fc[2];
  3320. - __le16 i_dur; /* should be zero */
  3321. - u_int8_t i_ra[IEEE80211_ADDR_LEN];
  3322. - u_int8_t i_bssid[IEEE80211_ADDR_LEN];
  3323. - /* FCS */
  3324. -} __packed;
  3325. -
  3326. -/*
  3327. - * BEACON management packets
  3328. - *
  3329. - * octet timestamp[8]
  3330. - * octet beacon interval[2]
  3331. - * octet capability information[2]
  3332. - * information element
  3333. - * octet elemid
  3334. - * octet length
  3335. - * octet information[length]
  3336. - */
  3337. -
  3338. -typedef u_int8_t *ieee80211_mgt_beacon_t;
  3339. -
  3340. -#define IEEE80211_BEACON_INTERVAL(beacon) \
  3341. - ((beacon)[8] | ((beacon)[9] << 8))
  3342. -#define IEEE80211_BEACON_CAPABILITY(beacon) \
  3343. - ((beacon)[10] | ((beacon)[11] << 8))
  3344. -
  3345. -#define IEEE80211_CAPINFO_ESS 0x0001
  3346. -#define IEEE80211_CAPINFO_IBSS 0x0002
  3347. -#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
  3348. -#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
  3349. -#define IEEE80211_CAPINFO_PRIVACY 0x0010
  3350. -#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
  3351. -#define IEEE80211_CAPINFO_PBCC 0x0040
  3352. -#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
  3353. -/* bits 8-9 are reserved (8 now for spectrum management) */
  3354. -#define IEEE80211_CAPINFO_SPECTRUM_MGMT 0x0100
  3355. -#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
  3356. -#define IEEE80211_CAPINFO_RSN 0x0800
  3357. -/* bit 12 is reserved */
  3358. -#define IEEE80211_CAPINFO_DSSSOFDM 0x2000
  3359. -/* bits 14-15 are reserved */
  3360. -
  3361. -/*
  3362. - * 802.11i/WPA information element (maximally sized).
  3363. - */
  3364. -struct ieee80211_ie_wpa {
  3365. - u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */
  3366. - u_int8_t wpa_len; /* length in bytes */
  3367. - u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */
  3368. - u_int8_t wpa_type; /* OUI type */
  3369. - u_int16_t wpa_version; /* spec revision */
  3370. - u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */
  3371. - u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */
  3372. - u_int32_t wpa_uciphers[8]; /* ciphers */
  3373. - u_int16_t wpa_authselcnt; /* authentication selector cnt*/
  3374. - u_int32_t wpa_authsels[8]; /* selectors */
  3375. - u_int16_t wpa_caps; /* 802.11i capabilities */
  3376. - u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */
  3377. - u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */
  3378. -} __packed;
  3379. -
  3380. -/*
  3381. - * Management information element payloads.
  3382. - */
  3383. -
  3384. -enum {
  3385. - IEEE80211_ELEMID_SSID = 0,
  3386. - IEEE80211_ELEMID_RATES = 1,
  3387. - IEEE80211_ELEMID_FHPARMS = 2,
  3388. - IEEE80211_ELEMID_DSPARMS = 3,
  3389. - IEEE80211_ELEMID_CFPARMS = 4,
  3390. - IEEE80211_ELEMID_TIM = 5,
  3391. - IEEE80211_ELEMID_IBSSPARMS = 6,
  3392. - IEEE80211_ELEMID_COUNTRY = 7,
  3393. - IEEE80211_ELEMID_HOPPATRNPARMS = 8,
  3394. - IEEE80211_ELEMID_HOPPATRNTABLE = 9,
  3395. - IEEE80211_ELEMID_REQINFO = 10,
  3396. - IEEE80211_ELEMID_QBSSLOAD = 11,
  3397. - IEEE80211_ELEMID_EDCAPARAM = 12,
  3398. - IEEE80211_ELEMID_TSPEC = 13,
  3399. - IEEE80211_ELEMID_TRAFCLASS = 14,
  3400. - IEEE80211_ELEMID_SCHEDULE = 15,
  3401. - IEEE80211_ELEMID_CHALLENGE = 16,
  3402. - /* 17-31 reserved for challenge text extension */
  3403. - IEEE80211_ELEMID_PWRCNSTR = 32,
  3404. - IEEE80211_ELEMID_PWRCAP = 33,
  3405. - IEEE80211_ELEMID_TPCREQ = 34,
  3406. - IEEE80211_ELEMID_TPCREP = 35,
  3407. - IEEE80211_ELEMID_SUPPCHAN = 36,
  3408. - IEEE80211_ELEMID_CHANSWITCHANN = 37,
  3409. - IEEE80211_ELEMID_MEASREQ = 38,
  3410. - IEEE80211_ELEMID_MEASREP = 39,
  3411. - IEEE80211_ELEMID_QUIET = 40,
  3412. - IEEE80211_ELEMID_IBSSDFS = 41,
  3413. - IEEE80211_ELEMID_ERP = 42,
  3414. - IEEE80211_ELEMID_TSDELAY = 43,
  3415. - IEEE80211_ELEMID_TCLASSPROC = 44,
  3416. - IEEE80211_ELEMID_QOS = 46,
  3417. - IEEE80211_ELEMID_RSN = 48,
  3418. - /* 49 reserved */
  3419. - IEEE80211_ELEMID_XRATES = 50,
  3420. - /* 128-129 proprietary elements used by Agere chipsets */
  3421. - IEEE80211_ELEMID_AGERE1 = 128,
  3422. - IEEE80211_ELEMID_AGERE2 = 129,
  3423. - IEEE80211_ELEMID_TPC = 150,
  3424. - IEEE80211_ELEMID_CCKM = 156,
  3425. - IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
  3426. -};
  3427. -
  3428. -#define IEEE80211_CHANSWITCHANN_BYTES 5
  3429. -#define BITCTL_BUFD_MCAST 1
  3430. -#define BITCTL_BUFD_UCAST_AID_MASK ((u_int8_t)~(BITCTL_BUFD_MCAST))
  3431. -#define BITCTL_BUFD_UCAST_AID_SHIFT 1
  3432. -
  3433. -struct ieee80211_tim_ie {
  3434. - u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */
  3435. - u_int8_t tim_len;
  3436. - u_int8_t tim_count; /* DTIM count */
  3437. - u_int8_t tim_period; /* DTIM period */
  3438. - u_int8_t tim_bitctl; /* bitmap control */
  3439. - u_int8_t tim_bitmap[1]; /* variable-length bitmap */
  3440. -} __packed;
  3441. -
  3442. -struct ieee80211_country_ie {
  3443. - u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */
  3444. - u_int8_t len;
  3445. - u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */
  3446. - struct {
  3447. - u_int8_t schan; /* starting channel */
  3448. - u_int8_t nchan; /* number channels */
  3449. - u_int8_t maxtxpwr; /* tx power cap */
  3450. - } __packed band[4]; /* up to 4 sub bands */
  3451. -} __packed;
  3452. -
  3453. -#define IEEE80211_CHALLENGE_LEN 128
  3454. -
  3455. -#define IEEE80211_SUPPCHAN_LEN 26
  3456. -
  3457. -#define IEEE80211_RATE_BASIC 0x80
  3458. -#define IEEE80211_RATE_VAL 0x7f
  3459. -
  3460. -/* EPR information element flags */
  3461. -#define IEEE80211_ERP_NON_ERP_PRESENT 0x01
  3462. -#define IEEE80211_ERP_USE_PROTECTION 0x02
  3463. -#define IEEE80211_ERP_LONG_PREAMBLE 0x04
  3464. -
  3465. -/* Atheros private advanced capabilities info */
  3466. -#define ATHEROS_CAP_TURBO_PRIME 0x01
  3467. -#define ATHEROS_CAP_COMPRESSION 0x02
  3468. -#define ATHEROS_CAP_FAST_FRAME 0x04
  3469. -/* bits 3-6 reserved */
  3470. -#define ATHEROS_CAP_BOOST 0x80
  3471. -
  3472. -#define ATH_OUI 0x7f0300 /* Atheros OUI */
  3473. -#define ATH_OUI_TYPE 0x01
  3474. -#define ATH_OUI_SUBTYPE 0x01
  3475. -#define ATH_OUI_VERSION 0x00
  3476. -#define ATH_OUI_TYPE_XR 0x03
  3477. -#define ATH_OUI_SUBTYPE_XR 0x01
  3478. -#define ATH_OUI_VER_XR 0x00
  3479. -
  3480. -#define WPA_OUI 0xf25000
  3481. -#define WPA_OUI_TYPE 0x01
  3482. -#define WPA_VERSION 1 /* current supported version */
  3483. -
  3484. -#define WPA_CSE_NULL 0x00
  3485. -#define WPA_CSE_WEP40 0x01
  3486. -#define WPA_CSE_TKIP 0x02
  3487. -#define WPA_CSE_CCMP 0x04
  3488. -#define WPA_CSE_WEP104 0x05
  3489. -
  3490. -#define WPA_ASE_NONE 0x00
  3491. -#define WPA_ASE_8021X_UNSPEC 0x01
  3492. -#define WPA_ASE_8021X_PSK 0x02
  3493. -
  3494. -#define RSN_OUI 0xac0f00
  3495. -#define RSN_VERSION 1 /* current supported version */
  3496. -
  3497. -#define RSN_CSE_NULL 0x00
  3498. -#define RSN_CSE_WEP40 0x01
  3499. -#define RSN_CSE_TKIP 0x02
  3500. -#define RSN_CSE_WRAP 0x03
  3501. -#define RSN_CSE_CCMP 0x04
  3502. -#define RSN_CSE_WEP104 0x05
  3503. -
  3504. -#define RSN_ASE_NONE 0x00
  3505. -#define RSN_ASE_8021X_UNSPEC 0x01
  3506. -#define RSN_ASE_8021X_PSK 0x02
  3507. -
  3508. -#define RSN_CAP_PREAUTH 0x01
  3509. -
  3510. -#define WME_OUI 0xf25000
  3511. -#define WME_OUI_TYPE 0x02
  3512. -#define WME_INFO_OUI_SUBTYPE 0x00
  3513. -#define WME_PARAM_OUI_SUBTYPE 0x01
  3514. -#define WME_VERSION 1
  3515. -
  3516. -/* WME stream classes */
  3517. -#define WME_AC_BE 0 /* best effort */
  3518. -#define WME_AC_BK 1 /* background */
  3519. -#define WME_AC_VI 2 /* video */
  3520. -#define WME_AC_VO 3 /* voice */
  3521. -
  3522. -/*
  3523. - * AUTH management packets
  3524. - *
  3525. - * octet algo[2]
  3526. - * octet seq[2]
  3527. - * octet status[2]
  3528. - * octet chal.id
  3529. - * octet chal.length
  3530. - * octet chal.text[253]
  3531. - */
  3532. -
  3533. -typedef u_int8_t *ieee80211_mgt_auth_t;
  3534. -
  3535. -#define IEEE80211_AUTH_ALGORITHM(auth) \
  3536. - ((auth)[0] | ((auth)[1] << 8))
  3537. -#define IEEE80211_AUTH_TRANSACTION(auth) \
  3538. - ((auth)[2] | ((auth)[3] << 8))
  3539. -#define IEEE80211_AUTH_STATUS(auth) \
  3540. - ((auth)[4] | ((auth)[5] << 8))
  3541. -
  3542. -#define IEEE80211_AUTH_ALG_OPEN 0x0000
  3543. -#define IEEE80211_AUTH_ALG_SHARED 0x0001
  3544. -#define IEEE80211_AUTH_ALG_LEAP 0x0080
  3545. -
  3546. -enum {
  3547. - IEEE80211_AUTH_OPEN_REQUEST = 1,
  3548. - IEEE80211_AUTH_OPEN_RESPONSE = 2,
  3549. -};
  3550. -
  3551. -enum {
  3552. - IEEE80211_AUTH_SHARED_REQUEST = 1,
  3553. - IEEE80211_AUTH_SHARED_CHALLENGE = 2,
  3554. - IEEE80211_AUTH_SHARED_RESPONSE = 3,
  3555. - IEEE80211_AUTH_SHARED_PASS = 4,
  3556. -};
  3557. -
  3558. -/*
  3559. - * Reason codes
  3560. - *
  3561. - * Unlisted codes are reserved
  3562. - */
  3563. -
  3564. -enum {
  3565. - IEEE80211_REASON_UNSPECIFIED = 1,
  3566. - IEEE80211_REASON_AUTH_EXPIRE = 2,
  3567. - IEEE80211_REASON_AUTH_LEAVE = 3,
  3568. - IEEE80211_REASON_ASSOC_EXPIRE = 4,
  3569. - IEEE80211_REASON_ASSOC_TOOMANY = 5,
  3570. - IEEE80211_REASON_NOT_AUTHED = 6,
  3571. - IEEE80211_REASON_NOT_ASSOCED = 7,
  3572. - IEEE80211_REASON_ASSOC_LEAVE = 8,
  3573. - IEEE80211_REASON_ASSOC_NOT_AUTHED = 9,
  3574. -
  3575. - IEEE80211_REASON_PWRCAP_UNACCEPTABLE = 10,
  3576. - IEEE80211_REASON_SUPPCHAN_UNACCEPTABLE = 11,
  3577. - IEEE80211_REASON_RSN_REQUIRED = 11,
  3578. - IEEE80211_REASON_RSN_INCONSISTENT = 12,
  3579. - IEEE80211_REASON_IE_INVALID = 13,
  3580. - IEEE80211_REASON_MIC_FAILURE = 14,
  3581. -
  3582. - IEEE80211_STATUS_SUCCESS = 0,
  3583. - IEEE80211_STATUS_UNSPECIFIED = 1,
  3584. - IEEE80211_STATUS_CAPINFO = 10,
  3585. - IEEE80211_STATUS_NOT_ASSOCED = 11,
  3586. - IEEE80211_STATUS_OTHER = 12,
  3587. - IEEE80211_STATUS_ALG = 13,
  3588. - IEEE80211_STATUS_SEQUENCE = 14,
  3589. - IEEE80211_STATUS_CHALLENGE = 15,
  3590. - IEEE80211_STATUS_TIMEOUT = 16,
  3591. - IEEE80211_STATUS_TOOMANY = 17,
  3592. - IEEE80211_STATUS_BASIC_RATE = 18,
  3593. - IEEE80211_STATUS_SP_REQUIRED = 19,
  3594. - IEEE80211_STATUS_PBCC_REQUIRED = 20,
  3595. - IEEE80211_STATUS_CA_REQUIRED = 21,
  3596. - IEEE80211_STATUS_SM_REQUIRED = 22,
  3597. - IEEE80211_STATUS_PWRCAP_UNACCEPTABLE = 23,
  3598. - IEEE80211_STATUS_SUPPCHAN_UNACCEPTABLE = 24,
  3599. - IEEE80211_STATUS_TOO_MANY_STATIONS = 22,
  3600. - IEEE80211_STATUS_RATES = 23,
  3601. - IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25,
  3602. - IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26,
  3603. -};
  3604. -
  3605. -#define IEEE80211_WEP_KEYLEN 5 /* 40bit */
  3606. -#define IEEE80211_WEP_IVLEN 3 /* 24bit */
  3607. -#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */
  3608. -#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
  3609. -#define IEEE80211_WEP_NKID 4 /* number of key ids */
  3610. -
  3611. -/*
  3612. - * 802.11i defines an extended IV for use with non-WEP ciphers.
  3613. - * When the EXTIV bit is set in the key id byte an additional
  3614. - * 4 bytes immediately follow the IV for TKIP. For CCMP the
  3615. - * EXTIV bit is likewise set but the 8 bytes represent the
  3616. - * CCMP header rather than IV+extended-IV.
  3617. - */
  3618. -#define IEEE80211_WEP_EXTIV 0x20
  3619. -#define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */
  3620. -#define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
  3621. -
  3622. -#define IEEE80211_CRC_LEN 4
  3623. -
  3624. -/*
  3625. - * Maximum acceptable MTU is:
  3626. - * IEEE80211_MAX_LEN - WEP overhead - CRC -
  3627. - * QoS overhead - RSN/WPA overhead
  3628. - * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default
  3629. - * mtu is Ethernet-compatible; it's set by ether_ifattach.
  3630. - */
  3631. -#define IEEE80211_MTU_MAX 2290
  3632. -#define IEEE80211_MTU_MIN 32
  3633. -
  3634. -#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \
  3635. - (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
  3636. -#define IEEE80211_ACK_LEN \
  3637. - (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
  3638. -#define IEEE80211_MIN_LEN \
  3639. - (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
  3640. -
  3641. -/*
  3642. - * The 802.11 spec says at most 2007 stations may be
  3643. - * associated at once. For most APs this is way more
  3644. - * than is feasible so we use a default of 128. This
  3645. - * number may be overridden by the driver and/or by
  3646. - * user configuration.
  3647. - */
  3648. -#define IEEE80211_AID_MAX 2007
  3649. -#define IEEE80211_AID_DEF 128
  3650. -
  3651. -#define IEEE80211_AID(b) ((b) &~ 0xc000)
  3652. -
  3653. -/*
  3654. - * RTS frame length parameters. The default is specified in
  3655. - * the 802.11 spec. The max may be wrong for jumbo frames.
  3656. - */
  3657. -#define IEEE80211_RTS_DEFAULT 512
  3658. -#define IEEE80211_RTS_MIN 1
  3659. -#define IEEE80211_RTS_MAX 2346
  3660. -
  3661. -/*
  3662. - * Regulatory extension identifier for country IE.
  3663. - */
  3664. -#define IEEE80211_REG_EXT_ID 201
  3665. -
  3666. -/*
  3667. - * IEEE 802.11 timer synchronization function (TSF) timestamp length
  3668. - */
  3669. -#define IEEE80211_TSF_LEN 8
  3670. -
  3671. -#endif /* _NET80211_IEEE80211_H_ */
  3672. diff --git a/package/hostapd/madwifi/net80211/ieee80211_crypto.h b/package/hostapd/madwifi/net80211/ieee80211_crypto.h
  3673. deleted file mode 100644
  3674. index b34f359..0000000
  3675. --- a/package/hostapd/madwifi/net80211/ieee80211_crypto.h
  3676. +++ /dev/null
  3677. @@ -1,207 +0,0 @@
  3678. -/*-
  3679. - * Copyright (c) 2001 Atsushi Onoe
  3680. - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  3681. - * All rights reserved.
  3682. - *
  3683. - * Redistribution and use in source and binary forms, with or without
  3684. - * modification, are permitted provided that the following conditions
  3685. - * are met:
  3686. - * 1. Redistributions of source code must retain the above copyright
  3687. - * notice, this list of conditions and the following disclaimer.
  3688. - * 2. Redistributions in binary form must reproduce the above copyright
  3689. - * notice, this list of conditions and the following disclaimer in the
  3690. - * documentation and/or other materials provided with the distribution.
  3691. - * 3. The name of the author may not be used to endorse or promote products
  3692. - * derived from this software without specific prior written permission.
  3693. - *
  3694. - * Alternatively, this software may be distributed under the terms of the
  3695. - * GNU General Public License ("GPL") version 2 as published by the Free
  3696. - * Software Foundation.
  3697. - *
  3698. - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  3699. - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  3700. - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  3701. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3702. - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3703. - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3704. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3705. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3706. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3707. - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3708. - *
  3709. - * $Id: ieee80211_crypto.h 3068 2007-12-21 17:46:02Z mentor $
  3710. - */
  3711. -#ifndef _NET80211_IEEE80211_CRYPTO_H_
  3712. -#define _NET80211_IEEE80211_CRYPTO_H_
  3713. -
  3714. -/*
  3715. - * 802.11 protocol crypto-related definitions.
  3716. - */
  3717. -#define IEEE80211_KEYBUF_SIZE 16
  3718. -#define IEEE80211_MICBUF_SIZE (8 + 8) /* space for both TX & RX keys */
  3719. -#define IEEE80211_TID_SIZE 17 /* total number of TIDs */
  3720. -
  3721. -/*
  3722. - * Old WEP-style key. Deprecated.
  3723. - */
  3724. -struct ieee80211_wepkey {
  3725. - u_int wk_len; /* key length in bytes */
  3726. - u_int8_t wk_key[IEEE80211_KEYBUF_SIZE];
  3727. -};
  3728. -
  3729. -struct ieee80211_cipher;
  3730. -
  3731. -/*
  3732. - * Crypto key state. There is sufficient room for all supported
  3733. - * ciphers (see below). The underlying ciphers are handled
  3734. - * separately through loadable cipher modules that register with
  3735. - * the generic crypto support. A key has a reference to an instance
  3736. - * of the cipher; any per-key state is hung off wk_private by the
  3737. - * cipher when it is attached. Ciphers are automatically called
  3738. - * to detach and cleanup any such state when the key is deleted.
  3739. - *
  3740. - * The generic crypto support handles encap/decap of cipher-related
  3741. - * frame contents for both hardware- and software-based implementations.
  3742. - * A key requiring software crypto support is automatically flagged and
  3743. - * the cipher is expected to honor this and do the necessary work.
  3744. - * Ciphers such as TKIP may also support mixed hardware/software
  3745. - * encrypt/decrypt and MIC processing.
  3746. - */
  3747. -
  3748. -typedef u_int16_t ieee80211_keyix_t;
  3749. -
  3750. -/* XXX pack better? */
  3751. -/* XXX 48-bit rsc/tsc */
  3752. -struct ieee80211_key {
  3753. - u_int8_t wk_keylen; /* key length in bytes */
  3754. - u_int8_t wk_flags;
  3755. -#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */
  3756. -#define IEEE80211_KEY_RECV 0x02 /* key used for recv */
  3757. -#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */
  3758. -#define IEEE80211_KEY_SWCRYPT 0x10 /* host-based encrypt/decrypt */
  3759. -#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */
  3760. - ieee80211_keyix_t wk_keyix; /* key index */
  3761. - u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
  3762. -#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */
  3763. -#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */
  3764. - u_int64_t wk_keyrsc[IEEE80211_TID_SIZE]; /* key receive sequence counter */
  3765. - u_int64_t wk_keytsc; /* key transmit sequence counter */
  3766. - const struct ieee80211_cipher *wk_cipher;
  3767. - void *wk_private; /* private cipher state */
  3768. -};
  3769. -#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\
  3770. - (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP)
  3771. -
  3772. -/*
  3773. - * NB: these values are ordered carefully; there are lots of
  3774. - * of implications in any reordering. In particular beware
  3775. - * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
  3776. - */
  3777. -#define IEEE80211_CIPHER_WEP 0
  3778. -#define IEEE80211_CIPHER_TKIP 1
  3779. -#define IEEE80211_CIPHER_AES_OCB 2
  3780. -#define IEEE80211_CIPHER_AES_CCM 3
  3781. -#define IEEE80211_CIPHER_CKIP 5
  3782. -#define IEEE80211_CIPHER_NONE 6 /* pseudo value */
  3783. -
  3784. -#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE + 1)
  3785. -
  3786. -#define IEEE80211_KEYIX_NONE ((ieee80211_keyix_t)-1)
  3787. -
  3788. -#if defined(__KERNEL__) || defined(_KERNEL)
  3789. -
  3790. -struct ieee80211com;
  3791. -struct ieee80211vap;
  3792. -struct ieee80211_node;
  3793. -struct sk_buff;
  3794. -
  3795. -void ieee80211_crypto_attach(struct ieee80211com *);
  3796. -void ieee80211_crypto_detach(struct ieee80211com *);
  3797. -void ieee80211_crypto_vattach(struct ieee80211vap *);
  3798. -void ieee80211_crypto_vdetach(struct ieee80211vap *);
  3799. -int ieee80211_crypto_newkey(struct ieee80211vap *, int, int,
  3800. - struct ieee80211_key *);
  3801. -int ieee80211_crypto_delkey(struct ieee80211vap *, struct ieee80211_key *,
  3802. - struct ieee80211_node *);
  3803. -int ieee80211_crypto_setkey(struct ieee80211vap *, struct ieee80211_key *,
  3804. - const u_int8_t macaddr[IEEE80211_ADDR_LEN], struct ieee80211_node *);
  3805. -void ieee80211_crypto_delglobalkeys(struct ieee80211vap *);
  3806. -
  3807. -/*
  3808. - * Template for a supported cipher. Ciphers register with the
  3809. - * crypto code and are typically loaded as separate modules
  3810. - * (the null cipher is always present).
  3811. - * XXX may need refcnts
  3812. - */
  3813. -struct ieee80211_cipher {
  3814. - const char *ic_name; /* printable name */
  3815. - u_int ic_cipher; /* IEEE80211_CIPHER_* */
  3816. - u_int ic_header; /* size of privacy header (bytes) */
  3817. - u_int ic_trailer; /* size of privacy trailer (bytes) */
  3818. - u_int ic_miclen; /* size of mic trailer (bytes) */
  3819. - void *(*ic_attach)(struct ieee80211vap *, struct ieee80211_key *);
  3820. - void (*ic_detach)(struct ieee80211_key *);
  3821. - int (*ic_setkey)(struct ieee80211_key *);
  3822. - int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t);
  3823. - int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int);
  3824. - int (*ic_enmic)(struct ieee80211_key *, struct sk_buff *, int);
  3825. - int (*ic_demic)(struct ieee80211_key *, struct sk_buff *, int, int);
  3826. -};
  3827. -extern const struct ieee80211_cipher ieee80211_cipher_none;
  3828. -
  3829. -void ieee80211_crypto_register(const struct ieee80211_cipher *);
  3830. -void ieee80211_crypto_unregister(const struct ieee80211_cipher *);
  3831. -int ieee80211_crypto_available(struct ieee80211vap*, u_int);
  3832. -
  3833. -struct ieee80211_key *ieee80211_crypto_encap(struct ieee80211_node *,
  3834. - struct sk_buff *);
  3835. -struct ieee80211_key *ieee80211_crypto_decap(struct ieee80211_node *,
  3836. - struct sk_buff *, int);
  3837. -
  3838. -/*
  3839. - * Check and remove any MIC.
  3840. - */
  3841. -static __inline int
  3842. -ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k,
  3843. - struct sk_buff *skb, int hdrlen, int force)
  3844. -{
  3845. - const struct ieee80211_cipher *cip = k->wk_cipher;
  3846. - return (cip->ic_miclen > 0 ? cip->ic_demic(k, skb, hdrlen, force) : 1);
  3847. -}
  3848. -
  3849. -/*
  3850. - * Add any MIC.
  3851. - */
  3852. -static __inline int
  3853. -ieee80211_crypto_enmic(struct ieee80211vap *vap, struct ieee80211_key *k,
  3854. - struct sk_buff *skb, int force)
  3855. -{
  3856. - const struct ieee80211_cipher *cip = k->wk_cipher;
  3857. - return (cip->ic_miclen > 0 ? cip->ic_enmic(k, skb, force) : 1);
  3858. -}
  3859. -
  3860. -/*
  3861. - * Reset key state to an unused state. The crypto
  3862. - * key allocation mechanism ensures other state (e.g.
  3863. - * key data) is properly setup before a key is used.
  3864. - */
  3865. -static __inline void
  3866. -ieee80211_crypto_resetkey(struct ieee80211vap *vap, struct ieee80211_key *k,
  3867. - ieee80211_keyix_t ix)
  3868. -{
  3869. - k->wk_cipher = &ieee80211_cipher_none;;
  3870. - k->wk_private = k->wk_cipher->ic_attach(vap, k);
  3871. - k->wk_keyix = ix;
  3872. - k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;
  3873. -}
  3874. -
  3875. -/*
  3876. - * Crypto-related notification methods.
  3877. - */
  3878. -void ieee80211_notify_replay_failure(struct ieee80211vap *,
  3879. - const struct ieee80211_frame *, const struct ieee80211_key *,
  3880. - u_int64_t rsc);
  3881. -void ieee80211_notify_michael_failure(struct ieee80211vap *,
  3882. - const struct ieee80211_frame *, ieee80211_keyix_t keyix);
  3883. -#endif /* defined(__KERNEL__) || defined(_KERNEL) */
  3884. -#endif /* _NET80211_IEEE80211_CRYPTO_H_ */
  3885. diff --git a/package/hostapd/madwifi/net80211/ieee80211_ioctl.h b/package/hostapd/madwifi/net80211/ieee80211_ioctl.h
  3886. deleted file mode 100644
  3887. index 204303b..0000000
  3888. --- a/package/hostapd/madwifi/net80211/ieee80211_ioctl.h
  3889. +++ /dev/null
  3890. @@ -1,715 +0,0 @@
  3891. -/*-
  3892. - * Copyright (c) 2001 Atsushi Onoe
  3893. - * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
  3894. - * All rights reserved.
  3895. - *
  3896. - * Redistribution and use in source and binary forms, with or without
  3897. - * modification, are permitted provided that the following conditions
  3898. - * are met:
  3899. - * 1. Redistributions of source code must retain the above copyright
  3900. - * notice, this list of conditions and the following disclaimer.
  3901. - * 2. Redistributions in binary form must reproduce the above copyright
  3902. - * notice, this list of conditions and the following disclaimer in the
  3903. - * documentation and/or other materials provided with the distribution.
  3904. - * 3. The name of the author may not be used to endorse or promote products
  3905. - * derived from this software without specific prior written permission.
  3906. - *
  3907. - * Alternatively, this software may be distributed under the terms of the
  3908. - * GNU General Public License ("GPL") version 2 as published by the Free
  3909. - * Software Foundation.
  3910. - *
  3911. - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  3912. - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  3913. - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  3914. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3915. - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3916. - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  3917. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  3918. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3919. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3920. - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3921. - *
  3922. - * $Id: ieee80211_ioctl.h 3314 2008-01-30 23:50:16Z mtaylor $
  3923. - */
  3924. -#ifndef _NET80211_IEEE80211_IOCTL_H_
  3925. -#define _NET80211_IEEE80211_IOCTL_H_
  3926. -
  3927. -/*
  3928. - * IEEE 802.11 ioctls.
  3929. - */
  3930. -#include <net80211/_ieee80211.h>
  3931. -#include <net80211/ieee80211.h>
  3932. -#include <net80211/ieee80211_crypto.h>
  3933. -
  3934. -/*
  3935. - * Per/node (station) statistics available when operating as an AP.
  3936. - */
  3937. -struct ieee80211_nodestats {
  3938. - u_int32_t ns_rx_data; /* rx data frames */
  3939. - u_int32_t ns_rx_mgmt; /* rx management frames */
  3940. - u_int32_t ns_rx_ctrl; /* rx control frames */
  3941. - u_int32_t ns_rx_ucast; /* rx unicast frames */
  3942. - u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */
  3943. - u_int64_t ns_rx_bytes; /* rx data count (bytes) */
  3944. - u_int64_t ns_rx_beacons; /* rx beacon frames */
  3945. - u_int32_t ns_rx_proberesp; /* rx probe response frames */
  3946. -
  3947. - u_int32_t ns_rx_dup; /* rx discard because it's a dup */
  3948. - u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */
  3949. - u_int32_t ns_rx_wepfail; /* rx wep processing failed */
  3950. - u_int32_t ns_rx_demicfail; /* rx demic failed */
  3951. - u_int32_t ns_rx_decap; /* rx decapsulation failed */
  3952. - u_int32_t ns_rx_defrag; /* rx defragmentation failed */
  3953. - u_int32_t ns_rx_disassoc; /* rx disassociation */
  3954. - u_int32_t ns_rx_deauth; /* rx deauthentication */
  3955. - u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */
  3956. - u_int32_t ns_rx_unauth; /* rx on unauthorized port */
  3957. - u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
  3958. -
  3959. - u_int32_t ns_tx_data; /* tx data frames */
  3960. - u_int32_t ns_tx_mgmt; /* tx management frames */
  3961. - u_int32_t ns_tx_ucast; /* tx unicast frames */
  3962. - u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */
  3963. - u_int64_t ns_tx_bytes; /* tx data count (bytes) */
  3964. - u_int32_t ns_tx_probereq; /* tx probe request frames */
  3965. - u_int32_t ns_tx_uapsd; /* tx on uapsd queue */
  3966. -
  3967. - u_int32_t ns_tx_novlantag; /* tx discard due to no tag */
  3968. - u_int32_t ns_tx_vlanmismatch; /* tx discard due to of bad tag */
  3969. -
  3970. - u_int32_t ns_tx_eosplost; /* uapsd EOSP retried out */
  3971. -
  3972. - u_int32_t ns_ps_discard; /* ps discard due to of age */
  3973. -
  3974. - u_int32_t ns_uapsd_triggers; /* uapsd triggers */
  3975. -
  3976. - /* MIB-related state */
  3977. - u_int32_t ns_tx_assoc; /* [re]associations */
  3978. - u_int32_t ns_tx_assoc_fail; /* [re]association failures */
  3979. - u_int32_t ns_tx_auth; /* [re]authentications */
  3980. - u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/
  3981. - u_int32_t ns_tx_deauth; /* deauthentications */
  3982. - u_int32_t ns_tx_deauth_code; /* last deauth reason */
  3983. - u_int32_t ns_tx_disassoc; /* disassociations */
  3984. - u_int32_t ns_tx_disassoc_code; /* last disassociation reason */
  3985. - u_int32_t ns_psq_drops; /* power save queue drops */
  3986. -};
  3987. -
  3988. -/*
  3989. - * Summary statistics.
  3990. - */
  3991. -struct ieee80211_stats {
  3992. - u_int32_t is_rx_badversion; /* rx frame with bad version */
  3993. - u_int32_t is_rx_tooshort; /* rx frame too short */
  3994. - u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
  3995. - u_int32_t is_rx_dup; /* rx discard due to it's a dup */
  3996. - u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
  3997. - u_int32_t is_rx_mcastecho; /* rx discard due to of mcast echo */
  3998. - u_int32_t is_rx_mcastdisabled; /* rx discard due to of mcast disabled */
  3999. - u_int32_t is_rx_notassoc; /* rx discard due to sta !assoc */
  4000. - u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */
  4001. - u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */
  4002. - u_int32_t is_rx_wepfail; /* rx wep processing failed */
  4003. - u_int32_t is_rx_decap; /* rx decapsulation failed */
  4004. - u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
  4005. - u_int32_t is_rx_ctl; /* rx discard ctrl frames */
  4006. - u_int32_t is_rx_beacon; /* rx beacon frames */
  4007. - u_int32_t is_rx_rstoobig; /* rx rate set truncated */
  4008. - u_int32_t is_rx_elem_missing; /* rx required element missing*/
  4009. - u_int32_t is_rx_elem_toobig; /* rx element too big */
  4010. - u_int32_t is_rx_elem_toosmall; /* rx element too small */
  4011. - u_int32_t is_rx_elem_unknown; /* rx element unknown */
  4012. - u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
  4013. - u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
  4014. - u_int32_t is_rx_nodealloc; /* rx frame dropped */
  4015. - u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
  4016. - u_int32_t is_rx_auth_unsupported;/* rx w/ unsupported auth alg */
  4017. - u_int32_t is_rx_auth_fail; /* rx sta auth failure */
  4018. - u_int32_t is_rx_auth_countermeasures;/* rx auth discard due to CM */
  4019. - u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
  4020. - u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
  4021. - u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
  4022. - u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
  4023. - u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
  4024. - u_int32_t is_rx_assoc_badscie; /* rx assoc w/ bad SC IE */
  4025. - u_int32_t is_rx_deauth; /* rx deauthentication */
  4026. - u_int32_t is_rx_disassoc; /* rx disassociation */
  4027. - u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
  4028. - u_int32_t is_rx_nobuf; /* rx failed for lack of buf */
  4029. - u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
  4030. - u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
  4031. - u_int32_t is_rx_bad_auth; /* rx bad auth request */
  4032. - u_int32_t is_rx_unauth; /* rx on unauthorized port */
  4033. - u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */
  4034. - u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */
  4035. - u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */
  4036. - u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */
  4037. - u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */
  4038. - u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */
  4039. - u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */
  4040. - u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */
  4041. - u_int32_t is_rx_badcipher; /* rx failed due to of key type */
  4042. - u_int32_t is_rx_nocipherctx; /* rx failed due to key !setup */
  4043. - u_int32_t is_rx_acl; /* rx discard due to of acl policy */
  4044. - u_int32_t is_rx_ffcnt; /* rx fast frames */
  4045. - u_int32_t is_rx_badathtnl; /* driver key alloc failed */
  4046. - u_int32_t is_tx_nobuf; /* tx failed for lack of buf */
  4047. - u_int32_t is_tx_nonode; /* tx failed for no node */
  4048. - u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
  4049. - u_int32_t is_tx_badcipher; /* tx failed due to of key type */
  4050. - u_int32_t is_tx_nodefkey; /* tx failed due to no defkey */
  4051. - u_int32_t is_tx_noheadroom; /* tx failed due to no space */
  4052. - u_int32_t is_tx_ffokcnt; /* tx fast frames sent success */
  4053. - u_int32_t is_tx_fferrcnt; /* tx fast frames sent success */
  4054. - u_int32_t is_scan_active; /* active scans started */
  4055. - u_int32_t is_scan_passive; /* passive scans started */
  4056. - u_int32_t is_node_timeout; /* nodes timed out inactivity */
  4057. - u_int32_t is_node_fdisassoc; /* forced node disassociation */
  4058. - u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
  4059. - u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */
  4060. - u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */
  4061. - u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */
  4062. - u_int32_t is_crypto_tkipcm; /* tkip counter measures */
  4063. - u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */
  4064. - u_int32_t is_crypto_wep; /* wep crypto done in s/w */
  4065. - u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */
  4066. - u_int32_t is_crypto_setkey_nokey;/* no key index for setkey */
  4067. - u_int32_t is_crypto_delkey; /* driver key delete failed */
  4068. - u_int32_t is_crypto_badcipher; /* unknown cipher */
  4069. - u_int32_t is_crypto_nocipher; /* cipher not available */
  4070. - u_int32_t is_crypto_attachfail; /* cipher attach failed */
  4071. - u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */
  4072. - u_int32_t is_crypto_keyfail; /* driver key alloc failed */
  4073. - u_int32_t is_crypto_enmicfail; /* en-MIC failed */
  4074. - u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */
  4075. - u_int32_t is_ibss_norate; /* merge failed-rate mismatch */
  4076. - u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
  4077. - u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */
  4078. - u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */
  4079. -};
  4080. -
  4081. -/*
  4082. - * Max size of optional information elements. We artificially
  4083. - * constrain this; it's limited only by the max frame size (and
  4084. - * the max parameter size of the wireless extensions).
  4085. - */
  4086. -#define IEEE80211_MAX_OPT_IE 256
  4087. -
  4088. -/*
  4089. - * WPA/RSN get/set key request. Specify the key/cipher
  4090. - * type and whether the key is to be used for sending and/or
  4091. - * receiving. The key index should be set only when working
  4092. - * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
  4093. - * Otherwise a unicast/pairwise key is specified by the bssid
  4094. - * (on a station) or mac address (on an ap). They key length
  4095. - * must include any MIC key data; otherwise it should be no
  4096. - more than IEEE80211_KEYBUF_SIZE.
  4097. - */
  4098. -struct ieee80211req_key {
  4099. - u_int8_t ik_type; /* key/cipher type */
  4100. - u_int8_t ik_pad;
  4101. - ieee80211_keyix_t ik_keyix; /* key index */
  4102. - u_int8_t ik_keylen; /* key length in bytes */
  4103. - u_int8_t ik_flags;
  4104. -/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
  4105. -#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
  4106. - u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
  4107. - u_int64_t ik_keyrsc; /* key receive sequence counter */
  4108. - u_int64_t ik_keytsc; /* key transmit sequence counter */
  4109. - u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
  4110. -};
  4111. -
  4112. -/*
  4113. - * Delete a key either by index or address. Set the index
  4114. - * to IEEE80211_KEYIX_NONE when deleting a unicast key.
  4115. - */
  4116. -struct ieee80211req_del_key {
  4117. - /* NB: This is different to ieee80211_keyix_t, but this is OK as
  4118. - * values are unique over the low order bits. */
  4119. - u_int8_t idk_keyix; /* key index */
  4120. - u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
  4121. -};
  4122. -
  4123. -/*
  4124. - * MLME state manipulation request. IEEE80211_MLME_ASSOC
  4125. - * only makes sense when operating as a station. The other
  4126. - * requests can be used when operating as a station or an
  4127. - * ap (to effect a station).
  4128. - */
  4129. -struct ieee80211req_mlme {
  4130. - u_int8_t im_op; /* operation to perform */
  4131. -#define IEEE80211_MLME_ASSOC 1 /* associate station */
  4132. -#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
  4133. -#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
  4134. -#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
  4135. -#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
  4136. -#define IEEE80211_MLME_CLEAR_STATS 6 /* clear station statistic */
  4137. - u_int8_t im_ssid_len; /* length of optional ssid */
  4138. - u_int16_t im_reason; /* 802.11 reason code */
  4139. - u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
  4140. - u_int8_t im_ssid[IEEE80211_NWID_LEN];
  4141. -};
  4142. -
  4143. -/*
  4144. - * MAC ACL operations.
  4145. - */
  4146. -enum {
  4147. - IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACLs */
  4148. - IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */
  4149. - IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */
  4150. - IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */
  4151. - IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */
  4152. -};
  4153. -
  4154. -/*
  4155. - * Set the active channel list. Note this list is
  4156. - * intersected with the available channel list in
  4157. - * calculating the set of channels actually used in
  4158. - * scanning.
  4159. - */
  4160. -struct ieee80211req_chanlist {
  4161. - u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
  4162. -};
  4163. -
  4164. -/*
  4165. - * Get the active channel list info.
  4166. - */
  4167. -struct ieee80211req_chaninfo {
  4168. - u_int ic_nchans;
  4169. - struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
  4170. -};
  4171. -
  4172. -/*
  4173. - * Retrieve the WPA/RSN information element for an associated station.
  4174. - */
  4175. -struct ieee80211req_wpaie {
  4176. - u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN];
  4177. - u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE];
  4178. - u_int8_t rsn_ie[IEEE80211_MAX_OPT_IE];
  4179. -};
  4180. -
  4181. -/*
  4182. - * Retrieve per-node statistics.
  4183. - */
  4184. -struct ieee80211req_sta_stats {
  4185. - union {
  4186. - /* NB: explicitly force 64-bit alignment */
  4187. - u_int8_t macaddr[IEEE80211_ADDR_LEN];
  4188. - u_int64_t pad;
  4189. - } is_u;
  4190. - struct ieee80211_nodestats is_stats;
  4191. -};
  4192. -
  4193. -/*
  4194. - * Station information block; the mac address is used
  4195. - * to retrieve other data like stats, unicast key, etc.
  4196. - */
  4197. -struct ieee80211req_sta_info {
  4198. - u_int16_t isi_len; /* length (mult of 4) */
  4199. - u_int16_t isi_freq; /* MHz */
  4200. - u_int16_t isi_flags; /* channel flags */
  4201. - u_int16_t isi_state; /* state flags */
  4202. - u_int8_t isi_authmode; /* authentication algorithm */
  4203. - u_int8_t isi_rssi;
  4204. - int8_t isi_noise;
  4205. - u_int16_t isi_capinfo; /* capabilities */
  4206. - u_int8_t isi_athflags; /* Atheros capabilities */
  4207. - u_int8_t isi_erp; /* ERP element */
  4208. - u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
  4209. - u_int8_t isi_nrates; /* negotiated rates */
  4210. - u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
  4211. - u_int8_t isi_txrate; /* index to isi_rates[] */
  4212. - u_int16_t isi_ie_len; /* IE length */
  4213. - u_int16_t isi_associd; /* assoc response */
  4214. - u_int16_t isi_txpower; /* current tx power */
  4215. - u_int16_t isi_vlan; /* vlan tag */
  4216. - u_int16_t isi_txseqs[17]; /* seq to be transmitted */
  4217. - u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/
  4218. - u_int16_t isi_inact; /* inactivity timer */
  4219. - u_int8_t isi_uapsd; /* UAPSD queues */
  4220. - u_int8_t isi_opmode; /* sta operating mode */
  4221. -
  4222. - /* XXX frag state? */
  4223. - /* variable length IE data */
  4224. -};
  4225. -
  4226. -enum {
  4227. - IEEE80211_STA_OPMODE_NORMAL,
  4228. - IEEE80211_STA_OPMODE_XR
  4229. -};
  4230. -
  4231. -/*
  4232. - * Retrieve per-station information; to retrieve all
  4233. - * specify a mac address of ff:ff:ff:ff:ff:ff.
  4234. - */
  4235. -struct ieee80211req_sta_req {
  4236. - union {
  4237. - /* NB: explicitly force 64-bit alignment */
  4238. - u_int8_t macaddr[IEEE80211_ADDR_LEN];
  4239. - u_int64_t pad;
  4240. - } is_u;
  4241. - struct ieee80211req_sta_info info[1]; /* variable length */
  4242. -};
  4243. -
  4244. -/*
  4245. - * Get/set per-station tx power cap.
  4246. - */
  4247. -struct ieee80211req_sta_txpow {
  4248. - u_int8_t it_macaddr[IEEE80211_ADDR_LEN];
  4249. - u_int8_t it_txpow;
  4250. -};
  4251. -
  4252. -/*
  4253. - * WME parameters are set and return using i_val and i_len.
  4254. - * i_val holds the value itself. i_len specifies the AC
  4255. - * and, as appropriate, then high bit specifies whether the
  4256. - * operation is to be applied to the BSS or ourself.
  4257. - */
  4258. -#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
  4259. -#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
  4260. -#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
  4261. -
  4262. -/*
  4263. - * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
  4264. - */
  4265. -struct ieee80211req_scan_result {
  4266. - u_int16_t isr_len; /* length (mult of 4) */
  4267. - u_int16_t isr_freq; /* MHz */
  4268. - u_int16_t isr_flags; /* channel flags */
  4269. - u_int8_t isr_noise;
  4270. - u_int8_t isr_rssi;
  4271. - u_int8_t isr_intval; /* beacon interval */
  4272. - u_int16_t isr_capinfo; /* capabilities */
  4273. - u_int8_t isr_erp; /* ERP element */
  4274. - u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
  4275. - u_int8_t isr_nrates;
  4276. - u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
  4277. - u_int8_t isr_ssid_len; /* SSID length */
  4278. - u_int8_t isr_ie_len; /* IE length */
  4279. - u_int8_t isr_pad[5];
  4280. - /* variable length SSID followed by IE data */
  4281. -};
  4282. -
  4283. -#ifdef __FreeBSD__
  4284. -/*
  4285. - * FreeBSD-style ioctls.
  4286. - */
  4287. -/* the first member must be matched with struct ifreq */
  4288. -struct ieee80211req {
  4289. - char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
  4290. - u_int16_t i_type; /* req type */
  4291. - int16_t i_val; /* Index or simple value */
  4292. - int16_t i_len; /* Index or simple value */
  4293. - void *i_data; /* Extra data */
  4294. -};
  4295. -#define SIOCS80211 _IOW('i', 234, struct ieee80211req)
  4296. -#define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
  4297. -#define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
  4298. -#define SIOC80211IFCREATE _IOWR('i', 237, struct ifreq)
  4299. -#define SIOC80211IFDESTROY _IOW('i', 238, struct ifreq)
  4300. -
  4301. -#define IEEE80211_IOC_SSID 1
  4302. -#define IEEE80211_IOC_NUMSSIDS 2
  4303. -#define IEEE80211_IOC_WEP 3
  4304. -#define IEEE80211_WEP_NOSUP -1
  4305. -#define IEEE80211_WEP_OFF 0
  4306. -#define IEEE80211_WEP_ON 1
  4307. -#define IEEE80211_WEP_MIXED 2
  4308. -#define IEEE80211_IOC_WEPKEY 4
  4309. -#define IEEE80211_IOC_NUMWEPKEYS 5
  4310. -#define IEEE80211_IOC_WEPTXKEY 6
  4311. -#define IEEE80211_IOC_AUTHMODE 7
  4312. -#define IEEE80211_IOC_STATIONNAME 8
  4313. -#define IEEE80211_IOC_CHANNEL 9
  4314. -#define IEEE80211_IOC_POWERSAVE 10
  4315. -#define IEEE80211_POWERSAVE_NOSUP -1
  4316. -#define IEEE80211_POWERSAVE_OFF 0
  4317. -#define IEEE80211_POWERSAVE_CAM 1
  4318. -#define IEEE80211_POWERSAVE_PSP 2
  4319. -#define IEEE80211_POWERSAVE_PSP_CAM 3
  4320. -#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
  4321. -#define IEEE80211_IOC_POWERSAVESLEEP 11
  4322. -#define IEEE80211_IOC_RTSTHRESHOLD 12
  4323. -#define IEEE80211_IOC_PROTMODE 13
  4324. -#define IEEE80211_PROTMODE_OFF 0
  4325. -#define IEEE80211_PROTMODE_CTS 1
  4326. -#define IEEE80211_PROTMODE_RTSCTS 2
  4327. -#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
  4328. -#define IEEE80211_IOC_BSSID 15
  4329. -#define IEEE80211_IOC_ROAMING 16 /* roaming mode */
  4330. -#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
  4331. -#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
  4332. -#define IEEE80211_IOC_WPAKEY 19
  4333. -#define IEEE80211_IOC_DELKEY 20
  4334. -#define IEEE80211_IOC_MLME 21
  4335. -#define IEEE80211_IOC_OPTIE 22 /* optional info. element */
  4336. -#define IEEE80211_IOC_SCAN_REQ 23
  4337. -#define IEEE80211_IOC_SCAN_RESULTS 24
  4338. -#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
  4339. -#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
  4340. -#define IEEE80211_IOC_CHANLIST 27 /* channel list */
  4341. -#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
  4342. -#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
  4343. -#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
  4344. -#define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */
  4345. -#define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */
  4346. -#define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */
  4347. -#define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */
  4348. -#define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */
  4349. -#define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */
  4350. -#define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */
  4351. -#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
  4352. -#define IEEE80211_IOC_WPAIE 39 /* WPA information element */
  4353. -#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
  4354. -#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
  4355. -#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
  4356. -#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
  4357. -#define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */
  4358. -#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
  4359. -#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
  4360. -#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
  4361. -#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
  4362. -#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
  4363. -#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
  4364. -#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
  4365. -#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
  4366. -#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
  4367. -#define IEEE80211_IOC_SETMAC 55 /* set interface wds mac addr */
  4368. -#define IEEE80211_IOC_FF 56 /* ATH fast frames (on, off) */
  4369. -#define IEEE80211_IOC_TURBOP 57 /* ATH turbo' (on, off) */
  4370. -#define IEEE80211_IOC_APPIEBUF 58 /* IE in the management frame */
  4371. -#define IEEE80211_IOC_FILTERFRAME 59 /* management frame filter */
  4372. -
  4373. -/*
  4374. - * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
  4375. - */
  4376. -struct ieee80211req_scan_result {
  4377. - u_int16_t isr_len; /* length (mult of 4) */
  4378. - u_int16_t isr_freq; /* MHz */
  4379. - u_int16_t isr_flags; /* channel flags */
  4380. - u_int8_t isr_noise;
  4381. - u_int8_t isr_rssi;
  4382. - u_int8_t isr_intval; /* beacon interval */
  4383. - u_int16_t isr_capinfo; /* capabilities */
  4384. - u_int8_t isr_erp; /* ERP element */
  4385. - u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
  4386. - u_int8_t isr_nrates;
  4387. - u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
  4388. - u_int8_t isr_ssid_len; /* SSID length */
  4389. - u_int8_t isr_ie_len; /* IE length */
  4390. - u_int8_t isr_pad[5];
  4391. - /* variable length SSID followed by IE data */
  4392. -};
  4393. -
  4394. -#endif /* __FreeBSD__ */
  4395. -
  4396. -#ifdef __linux__
  4397. -/*
  4398. - * Wireless Extensions API, private ioctl interfaces.
  4399. - *
  4400. - * NB: Even-numbered ioctl numbers have set semantics and are privileged!
  4401. - * (regardless of the incorrect comment in wireless.h!)
  4402. - */
  4403. -#ifdef __KERNEL__
  4404. -#include <linux/if.h>
  4405. -#endif
  4406. -/* The maximum size of a iwpriv structure is IW_PRIV_SIZE_MASK, which was
  4407. - * exceeded for some time by chaninfo ioctl. These macros change the size
  4408. - * encoding for anything larger than IW_PRIV_SIZE_MASK from bytes to 4-byte
  4409. - * multiples so that the padded size fits under IW_PRIV_SIZE_MASK. */
  4410. -#define IW_PRIV_BLOB_LENGTH_ENCODING(_SIZE) \
  4411. - (((_SIZE) == ((_SIZE) & IW_PRIV_SIZE_MASK)) ? \
  4412. - (_SIZE) : \
  4413. - (((_SIZE) / sizeof(uint32_t)) + \
  4414. - (((_SIZE) == (((_SIZE) / sizeof(uint32_t)) * sizeof(int))) ? \
  4415. - 0 : 1)))
  4416. -#define IW_PRIV_BLOB_TYPE_ENCODING(_SIZE) \
  4417. - (((_SIZE) == ((_SIZE) & IW_PRIV_SIZE_MASK)) ? \
  4418. - (IW_PRIV_TYPE_BYTE | (_SIZE)) : \
  4419. - (IW_PRIV_TYPE_INT | IW_PRIV_BLOB_LENGTH_ENCODING((_SIZE))))
  4420. -
  4421. -#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
  4422. -#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
  4423. -#define IEEE80211_IOCTL_SETMODE (SIOCIWFIRSTPRIV+2)
  4424. -#define IEEE80211_IOCTL_GETMODE (SIOCIWFIRSTPRIV+3)
  4425. -#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+4)
  4426. -#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5)
  4427. -#define IEEE80211_IOCTL_SETCHANLIST (SIOCIWFIRSTPRIV+6)
  4428. -#define IEEE80211_IOCTL_GETCHANLIST (SIOCIWFIRSTPRIV+7)
  4429. -#define IEEE80211_IOCTL_CHANSWITCH (SIOCIWFIRSTPRIV+8)
  4430. -#define IEEE80211_IOCTL_GET_APPIEBUF (SIOCIWFIRSTPRIV+9)
  4431. -#define IEEE80211_IOCTL_SET_APPIEBUF (SIOCIWFIRSTPRIV+10)
  4432. -#define IEEE80211_IOCTL_READREG (SIOCIWFIRSTPRIV+11)
  4433. -#define IEEE80211_IOCTL_FILTERFRAME (SIOCIWFIRSTPRIV+12)
  4434. -#define IEEE80211_IOCTL_GETCHANINFO (SIOCIWFIRSTPRIV+13)
  4435. -#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+14)
  4436. -#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+15)
  4437. -#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+16)
  4438. -#define IEEE80211_IOCTL_RADAR (SIOCIWFIRSTPRIV+17)
  4439. -#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+18)
  4440. -#define IEEE80211_IOCTL_WRITEREG (SIOCIWFIRSTPRIV+19)
  4441. -#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+20)
  4442. -#define IEEE80211_IOCTL_HALMAP (SIOCIWFIRSTPRIV+21)
  4443. -#define IEEE80211_IOCTL_ADDMAC (SIOCIWFIRSTPRIV+22)
  4444. -#define IEEE80211_IOCTL_DELMAC (SIOCIWFIRSTPRIV+24)
  4445. -#define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+25)
  4446. -#define IEEE80211_IOCTL_WDSSETMAC (SIOCIWFIRSTPRIV+26)
  4447. -#define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30)
  4448. -#define IEEE80211_IOCTL_SETSCANLIST (SIOCIWFIRSTPRIV+31)
  4449. -
  4450. -enum {
  4451. - IEEE80211_WMMPARAMS_CWMIN = 1,
  4452. - IEEE80211_WMMPARAMS_CWMAX = 2,
  4453. - IEEE80211_WMMPARAMS_AIFS = 3,
  4454. - IEEE80211_WMMPARAMS_TXOPLIMIT = 4,
  4455. - IEEE80211_WMMPARAMS_ACM = 5,
  4456. - IEEE80211_WMMPARAMS_NOACKPOLICY = 6,
  4457. -};
  4458. -enum {
  4459. - IEEE80211_PARAM_TURBO = 1, /* turbo mode */
  4460. - IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */
  4461. - IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */
  4462. - IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */
  4463. - IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */
  4464. - IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
  4465. - IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */
  4466. - IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */
  4467. - IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */
  4468. - IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
  4469. - IEEE80211_PARAM_ROAMING = 12, /* roaming mode */
  4470. - IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */
  4471. - IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */
  4472. - IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */
  4473. - IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */
  4474. - IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */
  4475. - IEEE80211_PARAM_WMM = 18, /* WMM mode (on, off) */
  4476. - IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */
  4477. - IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */
  4478. - IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */
  4479. - IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */
  4480. - IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */
  4481. - IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */
  4482. - IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */
  4483. - IEEE80211_PARAM_ABOLT = 26, /* Atheros Adv. Capabilities */
  4484. - IEEE80211_PARAM_INACT_TICK = 27, /* station inactivity timer tick (seconds) */
  4485. - IEEE80211_PARAM_DTIM_PERIOD = 28, /* DTIM period (beacons) */
  4486. - IEEE80211_PARAM_BEACON_INTERVAL = 29, /* beacon interval (ms) */
  4487. - IEEE80211_PARAM_DOTH = 30, /* 11.h is on/off */
  4488. - IEEE80211_PARAM_PWRTARGET = 31, /* Current Channel Pwr Constraint */
  4489. - IEEE80211_PARAM_GENREASSOC = 32, /* Generate a reassociation request */
  4490. - IEEE80211_PARAM_COMPRESSION = 33, /* compression */
  4491. - IEEE80211_PARAM_FF = 34, /* fast frames support */
  4492. - IEEE80211_PARAM_XR = 35, /* XR support */
  4493. - IEEE80211_PARAM_BURST = 36, /* burst mode */
  4494. - IEEE80211_PARAM_PUREG = 37, /* pure 11g (no 11b stations) */
  4495. - IEEE80211_PARAM_AR = 38, /* AR support */
  4496. - IEEE80211_PARAM_WDS = 39, /* Enable 4 address processing */
  4497. - IEEE80211_PARAM_BGSCAN = 40, /* bg scanning (on, off) */
  4498. - IEEE80211_PARAM_BGSCAN_IDLE = 41, /* bg scan idle threshold */
  4499. - IEEE80211_PARAM_BGSCAN_INTERVAL = 42, /* bg scan interval */
  4500. - IEEE80211_PARAM_MCAST_RATE = 43, /* Multicast Tx Rate */
  4501. - IEEE80211_PARAM_COVERAGE_CLASS = 44, /* coverage class */
  4502. - IEEE80211_PARAM_COUNTRY_IE = 45, /* enable country IE */
  4503. - IEEE80211_PARAM_SCANVALID = 46, /* scan cache valid threshold */
  4504. - IEEE80211_PARAM_ROAM_RSSI_11A = 47, /* rssi threshold in 11a */
  4505. - IEEE80211_PARAM_ROAM_RSSI_11B = 48, /* rssi threshold in 11b */
  4506. - IEEE80211_PARAM_ROAM_RSSI_11G = 49, /* rssi threshold in 11g */
  4507. - IEEE80211_PARAM_ROAM_RATE_11A = 50, /* tx rate threshold in 11a */
  4508. - IEEE80211_PARAM_ROAM_RATE_11B = 51, /* tx rate threshold in 11b */
  4509. - IEEE80211_PARAM_ROAM_RATE_11G = 52, /* tx rate threshold in 11g */
  4510. - IEEE80211_PARAM_UAPSDINFO = 53, /* value for qos info field */
  4511. - IEEE80211_PARAM_SLEEP = 54, /* force sleep/wake */
  4512. - IEEE80211_PARAM_QOSNULL = 55, /* force sleep/wake */
  4513. - IEEE80211_PARAM_PSPOLL = 56, /* force ps-poll generation (sta only) */
  4514. - IEEE80211_PARAM_EOSPDROP = 57, /* force uapsd EOSP drop (ap only) */
  4515. - IEEE80211_PARAM_MARKDFS = 58, /* mark a dfs interference channel when found */
  4516. - IEEE80211_PARAM_REGCLASS = 59, /* enable regclass ids in country IE */
  4517. - IEEE80211_PARAM_DROPUNENC_EAPOL = 60, /* drop unencrypted eapol frames */
  4518. - IEEE80211_PARAM_SHPREAMBLE = 61, /* Short Preamble */
  4519. - IEEE80211_PARAM_DUMPREGS = 62, /* Pretty printed dump of Atheros hardware registers */
  4520. - IEEE80211_PARAM_DOTH_ALGORITHM = 63, /* spectrum management algorithm */
  4521. - IEEE80211_PARAM_DOTH_MINCOM = 64, /* minimum number of common channels */
  4522. - IEEE80211_PARAM_DOTH_SLCG = 65, /* permil of Stations Lost per Channel Gained */
  4523. - IEEE80211_PARAM_DOTH_SLDG = 66, /* permil of Stations Lost per rssi Db Gained */
  4524. - IEEE80211_PARAM_TXCONT = 67, /* continuous transmit mode (boolean) */
  4525. - IEEE80211_PARAM_TXCONT_RATE = 68, /* continuous transmit mode data rate (in mbit/sec) - will use closest match from current rate table */
  4526. - IEEE80211_PARAM_TXCONT_POWER = 69, /* power level in units of 0.5dBm */
  4527. - IEEE80211_PARAM_DFS_TESTMODE = 70, /* do not perform DFS actions (i.e. markng DFS and channel change on interference), just report them via debug. */
  4528. - IEEE80211_PARAM_DFS_CACTIME = 71, /* how long do we wait for chan availability
  4529. - scans ?
  4530. - FCC requires 60s, so that is the default. */
  4531. - IEEE80211_PARAM_DFS_EXCLPERIOD = 72, /* DFS no-occupancy limit - how long do we stay
  4532. - off a channel once radar is detected?
  4533. - FCC requires 30m, so that is the default. */
  4534. - IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */
  4535. - IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */
  4536. - IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */
  4537. - IEEE80211_PARAM_MINRATE = 76, /* Minimum rate (by table index) */
  4538. - IEEE80211_PARAM_PROTMODE_RSSI = 77, /* RSSI Threshold for enabling protection mode */
  4539. - IEEE80211_PARAM_PROTMODE_TIMEOUT = 78, /* Timeout for expiring protection mode */
  4540. - IEEE80211_PARAM_BGSCAN_THRESH = 79, /* bg scan rssi threshold */
  4541. - IEEE80211_PARAM_RSSI_DIS_THR = 80, /* rssi threshold for disconnection */
  4542. - IEEE80211_PARAM_RSSI_DIS_COUNT = 81, /* counter for rssi threshold */
  4543. - IEEE80211_PARAM_WDS_SEP = 82, /* move wds stations into separate interfaces */
  4544. - IEEE80211_PARAM_MAXASSOC = 83, /* maximum associated stations */
  4545. - IEEE80211_PARAM_PROBEREQ = 84, /* enable handling of probe requests */
  4546. - IEEE80211_PARAM_BEACON_TXP = 85, /* set beacon tx power */
  4547. -};
  4548. -
  4549. -#define SIOCG80211STATS (SIOCDEVPRIVATE+2)
  4550. -/* NB: require in+out parameters so cannot use wireless extensions, yech */
  4551. -#define IEEE80211_IOCTL_GETKEY (SIOCDEVPRIVATE+3)
  4552. -#define IEEE80211_IOCTL_GETWPAIE (SIOCDEVPRIVATE+4)
  4553. -#define IEEE80211_IOCTL_STA_STATS (SIOCDEVPRIVATE+5)
  4554. -#define IEEE80211_IOCTL_STA_INFO (SIOCDEVPRIVATE+6)
  4555. -#define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
  4556. -#define SIOC80211IFDESTROY (SIOCDEVPRIVATE+8)
  4557. -#define IEEE80211_IOCTL_SCAN_RESULTS (SIOCDEVPRIVATE+9)
  4558. -
  4559. -struct ieee80211_clone_params {
  4560. - char icp_name[IFNAMSIZ]; /* device name */
  4561. - u_int16_t icp_opmode; /* operating mode */
  4562. - u_int16_t icp_flags; /* see below */
  4563. -#define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
  4564. -#define IEEE80211_NO_STABEACONS 0x0002 /* Do not setup the station beacon timers */
  4565. -};
  4566. -
  4567. -/* APPIEBUF related definitions */
  4568. -
  4569. -/* Management frame type to which application IE is added */
  4570. -enum {
  4571. - IEEE80211_APPIE_FRAME_BEACON = 0,
  4572. - IEEE80211_APPIE_FRAME_PROBE_REQ = 1,
  4573. - IEEE80211_APPIE_FRAME_PROBE_RESP = 2,
  4574. - IEEE80211_APPIE_FRAME_ASSOC_REQ = 3,
  4575. - IEEE80211_APPIE_FRAME_ASSOC_RESP = 4,
  4576. - IEEE80211_APPIE_NUM_OF_FRAME = 5
  4577. -};
  4578. -
  4579. -struct ieee80211req_getset_appiebuf {
  4580. - u_int32_t app_frmtype; /* management frame type for which buffer is added */
  4581. - u_int32_t app_buflen; /* application-supplied buffer length */
  4582. - u_int8_t app_buf[0]; /* application-supplied IE(s) */
  4583. -};
  4584. -
  4585. -/* Flags ORed by application to set filter for receiving management frames */
  4586. -enum {
  4587. - IEEE80211_FILTER_TYPE_BEACON = 1<<0,
  4588. - IEEE80211_FILTER_TYPE_PROBE_REQ = 1<<1,
  4589. - IEEE80211_FILTER_TYPE_PROBE_RESP = 1<<2,
  4590. - IEEE80211_FILTER_TYPE_ASSOC_REQ = 1<<3,
  4591. - IEEE80211_FILTER_TYPE_ASSOC_RESP = 1<<4,
  4592. - IEEE80211_FILTER_TYPE_AUTH = 1<<5,
  4593. - IEEE80211_FILTER_TYPE_DEAUTH = 1<<6,
  4594. - IEEE80211_FILTER_TYPE_DISASSOC = 1<<7,
  4595. - IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */
  4596. -};
  4597. -
  4598. -struct ieee80211req_set_filter {
  4599. - u_int32_t app_filterype; /* management frame filter type */
  4600. -};
  4601. -
  4602. -
  4603. -#endif /* __linux__ */
  4604. -
  4605. -#endif /* _NET80211_IEEE80211_IOCTL_H_ */
  4606. diff --git a/package/hostapd/patches/300-nl80211_multicall_fixes.patch b/package/hostapd/patches/300-nl80211_multicall_fixes.patch
  4607. deleted file mode 100644
  4608. index be68ed1..0000000
  4609. --- a/package/hostapd/patches/300-nl80211_multicall_fixes.patch
  4610. +++ /dev/null
  4611. @@ -1,60 +0,0 @@
  4612. ---- a/src/drivers/driver_nl80211.c
  4613. -+++ b/src/drivers/driver_nl80211.c
  4614. -@@ -3290,6 +3290,7 @@ static void * wpa_driver_nl80211_init(vo
  4615. - drv->monitor_sock = -1;
  4616. - drv->eapol_tx_sock = -1;
  4617. - drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
  4618. -+ drv->nlmode = NL80211_IFTYPE_STATION;
  4619. -
  4620. - if (wpa_driver_nl80211_init_nl(drv)) {
  4621. - os_free(drv);
  4622. -@@ -3607,17 +3608,12 @@ static void wpa_driver_nl80211_send_rfki
  4623. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  4624. - }
  4625. -
  4626. --
  4627. - static int
  4628. --wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
  4629. -+wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv,
  4630. -+ int *send_rfkill_event)
  4631. - {
  4632. - struct i802_bss *bss = &drv->first_bss;
  4633. -- int send_rfkill_event = 0;
  4634. -
  4635. -- drv->ifindex = if_nametoindex(bss->ifname);
  4636. -- drv->first_bss.ifindex = drv->ifindex;
  4637. --
  4638. --#ifndef HOSTAPD
  4639. - /*
  4640. - * Make sure the interface starts up in station mode unless this is a
  4641. - * dynamically added interface (e.g., P2P) that was already configured
  4642. -@@ -3636,7 +3632,7 @@ wpa_driver_nl80211_finish_drv_init(struc
  4643. - "interface '%s' due to rfkill",
  4644. - bss->ifname);
  4645. - drv->if_disabled = 1;
  4646. -- send_rfkill_event = 1;
  4647. -+ *send_rfkill_event = 1;
  4648. - } else {
  4649. - wpa_printf(MSG_ERROR, "nl80211: Could not set "
  4650. - "interface '%s' UP", bss->ifname);
  4651. -@@ -3646,7 +3642,19 @@ wpa_driver_nl80211_finish_drv_init(struc
  4652. -
  4653. - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
  4654. - 1, IF_OPER_DORMANT);
  4655. --#endif /* HOSTAPD */
  4656. -+}
  4657. -+
  4658. -+static int
  4659. -+wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
  4660. -+{
  4661. -+ struct i802_bss *bss = &drv->first_bss;
  4662. -+ int send_rfkill_event = 0;
  4663. -+
  4664. -+ drv->ifindex = if_nametoindex(bss->ifname);
  4665. -+ drv->first_bss.ifindex = drv->ifindex;
  4666. -+
  4667. -+ if (drv->nlmode == NL80211_IFTYPE_STATION)
  4668. -+ wpa_driver_nl80211_finish_drv_init_sta(drv, &send_rfkill_event);
  4669. -
  4670. - if (wpa_driver_nl80211_capa(drv))
  4671. - return -1;
  4672. diff --git a/package/hostapd/patches/310-multicall_bridge_fix.patch b/package/hostapd/patches/310-multicall_bridge_fix.patch
  4673. deleted file mode 100644
  4674. index a80c041..0000000
  4675. --- a/package/hostapd/patches/310-multicall_bridge_fix.patch
  4676. +++ /dev/null
  4677. @@ -1,45 +0,0 @@
  4678. ---- a/src/drivers/driver_nl80211.c
  4679. -+++ b/src/drivers/driver_nl80211.c
  4680. -@@ -899,6 +899,10 @@ static void wpa_driver_nl80211_event_rtm
  4681. - return;
  4682. - }
  4683. -
  4684. -+ if (ifi->ifi_family == AF_BRIDGE &&
  4685. -+ drv->nlmode != NL80211_IFTYPE_AP)
  4686. -+ return;
  4687. -+
  4688. - wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x "
  4689. - "(%s%s%s%s)",
  4690. - drv->operstate, ifi->ifi_flags,
  4691. -@@ -1006,6 +1010,10 @@ static void wpa_driver_nl80211_event_rtm
  4692. - attrlen = len;
  4693. - attr = (struct rtattr *) buf;
  4694. -
  4695. -+ if (ifi->ifi_family == AF_BRIDGE &&
  4696. -+ drv->nlmode != NL80211_IFTYPE_AP)
  4697. -+ return;
  4698. -+
  4699. - rta_len = RTA_ALIGN(sizeof(struct rtattr));
  4700. - while (RTA_OK(attr, attrlen)) {
  4701. - if (attr->rta_type == IFLA_IFNAME) {
  4702. -@@ -3292,6 +3300,11 @@ static void * wpa_driver_nl80211_init(vo
  4703. - drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
  4704. - drv->nlmode = NL80211_IFTYPE_STATION;
  4705. -
  4706. -+#ifdef HOSTAPD
  4707. -+ drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
  4708. -+ drv->if_indices = drv->default_if_indices;
  4709. -+#endif
  4710. -+
  4711. - if (wpa_driver_nl80211_init_nl(drv)) {
  4712. - os_free(drv);
  4713. - return NULL;
  4714. -@@ -8296,8 +8309,6 @@ static void *i802_init(struct hostapd_da
  4715. - br_ifindex = 0;
  4716. - }
  4717. -
  4718. -- drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
  4719. -- drv->if_indices = drv->default_if_indices;
  4720. - for (i = 0; i < params->num_bridge; i++) {
  4721. - if (params->bridge[i]) {
  4722. - ifindex = if_nametoindex(params->bridge[i]);
  4723. diff --git a/package/hostapd/patches/320-madwifi_key_fixes.patch b/package/hostapd/patches/320-madwifi_key_fixes.patch
  4724. deleted file mode 100644
  4725. index 45a7ac6..0000000
  4726. --- a/package/hostapd/patches/320-madwifi_key_fixes.patch
  4727. +++ /dev/null
  4728. @@ -1,34 +0,0 @@
  4729. ---- a/src/drivers/driver_madwifi.c
  4730. -+++ b/src/drivers/driver_madwifi.c
  4731. -@@ -453,7 +453,9 @@ wpa_driver_madwifi_set_key(const char *i
  4732. -
  4733. - memset(&wk, 0, sizeof(wk));
  4734. - wk.ik_type = cipher;
  4735. -- wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT;
  4736. -+ wk.ik_flags = IEEE80211_KEY_RECV;
  4737. -+ if (set_tx)
  4738. -+ wk.ik_flags |= IEEE80211_KEY_XMIT;
  4739. - if (addr == NULL || is_broadcast_ether_addr(addr)) {
  4740. - memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
  4741. - wk.ik_keyix = key_idx;
  4742. -@@ -465,6 +467,20 @@ wpa_driver_madwifi_set_key(const char *i
  4743. - wk.ik_keylen = key_len;
  4744. - memcpy(wk.ik_keydata, key, key_len);
  4745. -
  4746. -+#ifdef WORDS_BIGENDIAN
  4747. -+#define WPA_KEY_RSC_LEN 8
  4748. -+ {
  4749. -+ size_t i;
  4750. -+ u8 tmp[WPA_KEY_RSC_LEN];
  4751. -+ os_memset(tmp, 0, sizeof(tmp));
  4752. -+ for (i = 0; i < seq_len; i++)
  4753. -+ tmp[WPA_KEY_RSC_LEN - i - 1] = seq[i];
  4754. -+ os_memcpy(&wk.ik_keyrsc, tmp, WPA_KEY_RSC_LEN);
  4755. -+ }
  4756. -+#else /* WORDS_BIGENDIAN */
  4757. -+ os_memcpy(&wk.ik_keyrsc, seq, seq_len);
  4758. -+#endif /* WORDS_BIGENDIAN */
  4759. -+
  4760. - ret = set80211priv(drv, IEEE80211_IOCTL_SETKEY, &wk, sizeof(wk));
  4761. - if (ret < 0) {
  4762. - wpa_printf(MSG_DEBUG, "%s: Failed to set key (addr %s"
  4763. diff --git a/package/hostapd/patches/400-noscan.patch b/package/hostapd/patches/400-noscan.patch
  4764. deleted file mode 100644
  4765. index 18a218c..0000000
  4766. --- a/package/hostapd/patches/400-noscan.patch
  4767. +++ /dev/null
  4768. @@ -1,32 +0,0 @@
  4769. ---- a/hostapd/config_file.c
  4770. -+++ b/hostapd/config_file.c
  4771. -@@ -2464,6 +2464,8 @@ static int hostapd_config_fill(struct ho
  4772. - }
  4773. - #endif /* CONFIG_IEEE80211W */
  4774. - #ifdef CONFIG_IEEE80211N
  4775. -+ } else if (os_strcmp(buf, "noscan") == 0) {
  4776. -+ conf->noscan = atoi(pos);
  4777. - } else if (os_strcmp(buf, "ieee80211n") == 0) {
  4778. - conf->ieee80211n = atoi(pos);
  4779. - } else if (os_strcmp(buf, "ht_capab") == 0) {
  4780. ---- a/src/ap/ap_config.h
  4781. -+++ b/src/ap/ap_config.h
  4782. -@@ -511,6 +511,7 @@ struct hostapd_config {
  4783. -
  4784. - int ht_op_mode_fixed;
  4785. - u16 ht_capab;
  4786. -+ int noscan;
  4787. - int ieee80211n;
  4788. - int secondary_channel;
  4789. - int require_ht;
  4790. ---- a/src/ap/hw_features.c
  4791. -+++ b/src/ap/hw_features.c
  4792. -@@ -494,7 +494,7 @@ static int ieee80211n_check_40mhz(struct
  4793. - {
  4794. - struct wpa_driver_scan_params params;
  4795. -
  4796. -- if (!iface->conf->secondary_channel)
  4797. -+ if (!iface->conf->secondary_channel || iface->conf->noscan)
  4798. - return 0; /* HT40 not used */
  4799. -
  4800. - wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling "
  4801. diff --git a/package/hostapd/patches/410-multicall.patch b/package/hostapd/patches/410-multicall.patch
  4802. deleted file mode 100644
  4803. index 723f5f6..0000000
  4804. --- a/package/hostapd/patches/410-multicall.patch
  4805. +++ /dev/null
  4806. @@ -1,246 +0,0 @@
  4807. ---- a/hostapd/Makefile
  4808. -+++ b/hostapd/Makefile
  4809. -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
  4810. - # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
  4811. -
  4812. - -include .config
  4813. -+-include $(if $(MULTICALL), ../wpa_supplicant/.config)
  4814. -
  4815. - ifndef CONFIG_OS
  4816. - ifdef CONFIG_NATIVE_WINDOWS
  4817. -@@ -192,10 +193,14 @@ ifdef CONFIG_IEEE80211AC
  4818. - CFLAGS += -DCONFIG_IEEE80211AC
  4819. - endif
  4820. -
  4821. -+ifndef MULTICALL
  4822. -+CFLAGS += -DNO_SUPPLICANT
  4823. -+endif
  4824. -+
  4825. - include ../src/drivers/drivers.mak
  4826. --OBJS += $(DRV_AP_OBJS)
  4827. --CFLAGS += $(DRV_AP_CFLAGS)
  4828. --LDFLAGS += $(DRV_AP_LDFLAGS)
  4829. -+OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS)))
  4830. -+CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS))
  4831. -+LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS))
  4832. - LIBS += $(DRV_AP_LIBS)
  4833. -
  4834. - ifdef CONFIG_L2_PACKET
  4835. -@@ -860,6 +865,12 @@ install: all
  4836. -
  4837. - BCHECK=../src/drivers/build.hostapd
  4838. -
  4839. -+hostapd_multi.a: $(BCHECK) $(OBJS)
  4840. -+ $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c
  4841. -+ @$(E) " CC " $<
  4842. -+ @rm -f $@
  4843. -+ @$(AR) cr $@ hostapd_multi.o $(OBJS)
  4844. -+
  4845. - hostapd: $(BCHECK) $(OBJS)
  4846. - $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  4847. - @$(E) " LD " $@
  4848. -@@ -898,6 +909,12 @@ HOBJS += ../src/crypto/aes-internal.o
  4849. - HOBJS += ../src/crypto/aes-internal-enc.o
  4850. - endif
  4851. -
  4852. -+dump_cflags:
  4853. -+ @echo -n $(CFLAGS) " "
  4854. -+
  4855. -+dump_ldflags:
  4856. -+ @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
  4857. -+
  4858. - nt_password_hash: $(NOBJS)
  4859. - $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  4860. - @$(E) " LD " $@
  4861. ---- a/wpa_supplicant/Makefile
  4862. -+++ b/wpa_supplicant/Makefile
  4863. -@@ -14,6 +14,7 @@ CFLAGS += -I../src
  4864. - CFLAGS += -I../src/utils
  4865. -
  4866. - -include .config
  4867. -+-include $(if $(MULTICALL),../hostapd/.config)
  4868. -
  4869. - BINALL=wpa_supplicant wpa_cli
  4870. -
  4871. -@@ -708,6 +709,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  4872. - CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  4873. - LIBS += -ldl -rdynamic
  4874. - endif
  4875. -+else
  4876. -+ ifdef MULTICALL
  4877. -+ OBJS += ../src/eap_common/eap_common.o
  4878. -+ endif
  4879. - endif
  4880. -
  4881. - ifdef CONFIG_AP
  4882. -@@ -716,9 +721,11 @@ NEED_EAP_COMMON=y
  4883. - NEED_RSN_AUTHENTICATOR=y
  4884. - CFLAGS += -DCONFIG_AP
  4885. - OBJS += ap.o
  4886. -+ifndef MULTICALL
  4887. - CFLAGS += -DCONFIG_NO_RADIUS
  4888. - CFLAGS += -DCONFIG_NO_ACCOUNTING
  4889. - CFLAGS += -DCONFIG_NO_VLAN
  4890. -+endif
  4891. - OBJS += ../src/ap/hostapd.o
  4892. - OBJS += ../src/ap/wpa_auth_glue.o
  4893. - OBJS += ../src/ap/utils.o
  4894. -@@ -773,10 +780,18 @@ endif
  4895. - ifdef CONFIG_HS20
  4896. - OBJS += ../src/ap/hs20.o
  4897. - endif
  4898. -+else
  4899. -+ ifdef MULTICALL
  4900. -+ OBJS += ../src/eap_server/eap_server.o
  4901. -+ OBJS += ../src/eap_server/eap_server_identity.o
  4902. -+ OBJS += ../src/eap_server/eap_server_methods.o
  4903. -+ endif
  4904. - endif
  4905. -
  4906. - ifdef NEED_RSN_AUTHENTICATOR
  4907. -+ifndef MULTICALL
  4908. - CFLAGS += -DCONFIG_NO_RADIUS
  4909. -+endif
  4910. - NEED_AES_WRAP=y
  4911. - OBJS += ../src/ap/wpa_auth.o
  4912. - OBJS += ../src/ap/wpa_auth_ie.o
  4913. -@@ -1525,6 +1540,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  4914. -
  4915. - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  4916. -
  4917. -+wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
  4918. -+ $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c
  4919. -+ @$(E) " CC " $<
  4920. -+ @rm -f $@
  4921. -+ @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
  4922. -+
  4923. - wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  4924. - $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  4925. - @$(E) " LD " $@
  4926. -@@ -1595,6 +1616,12 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2.
  4927. - %@.service: %.service.arg.in
  4928. - sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  4929. -
  4930. -+dump_cflags:
  4931. -+ @echo -n $(CFLAGS) " "
  4932. -+
  4933. -+dump_ldflags:
  4934. -+ @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " "
  4935. -+
  4936. - wpa_supplicant.exe: wpa_supplicant
  4937. - mv -f $< $@
  4938. - wpa_cli.exe: wpa_cli
  4939. ---- a/src/drivers/driver.h
  4940. -+++ b/src/drivers/driver.h
  4941. -@@ -3750,8 +3750,8 @@ union wpa_event_data {
  4942. - * Driver wrapper code should call this function whenever an event is received
  4943. - * from the driver.
  4944. - */
  4945. --void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
  4946. -- union wpa_event_data *data);
  4947. -+extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
  4948. -+ union wpa_event_data *data);
  4949. -
  4950. -
  4951. - /*
  4952. ---- a/src/ap/drv_callbacks.c
  4953. -+++ b/src/ap/drv_callbacks.c
  4954. -@@ -714,8 +714,8 @@ static void hostapd_event_eapol_rx(struc
  4955. - }
  4956. -
  4957. -
  4958. --void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
  4959. -- union wpa_event_data *data)
  4960. -+void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
  4961. -+ union wpa_event_data *data)
  4962. - {
  4963. - struct hostapd_data *hapd = ctx;
  4964. - #ifndef CONFIG_NO_STDOUT_DEBUG
  4965. ---- a/wpa_supplicant/wpa_priv.c
  4966. -+++ b/wpa_supplicant/wpa_priv.c
  4967. -@@ -819,8 +819,8 @@ static void wpa_priv_send_ft_response(st
  4968. - }
  4969. -
  4970. -
  4971. --void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
  4972. -- union wpa_event_data *data)
  4973. -+static void supplicant_event(void *ctx, enum wpa_event_type event,
  4974. -+ union wpa_event_data *data)
  4975. - {
  4976. - struct wpa_priv_interface *iface = ctx;
  4977. -
  4978. -@@ -962,6 +962,7 @@ int main(int argc, char *argv[])
  4979. - if (os_program_init())
  4980. - return -1;
  4981. -
  4982. -+ wpa_supplicant_event = supplicant_event;
  4983. - wpa_priv_fd_workaround();
  4984. -
  4985. - for (;;) {
  4986. ---- a/wpa_supplicant/events.c
  4987. -+++ b/wpa_supplicant/events.c
  4988. -@@ -2354,8 +2354,8 @@ static void wpa_supplicant_event_unprot_
  4989. - }
  4990. -
  4991. -
  4992. --void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
  4993. -- union wpa_event_data *data)
  4994. -+void supplicant_event(void *ctx, enum wpa_event_type event,
  4995. -+ union wpa_event_data *data)
  4996. - {
  4997. - struct wpa_supplicant *wpa_s = ctx;
  4998. - u16 reason_code = 0;
  4999. ---- a/wpa_supplicant/wpa_supplicant.c
  5000. -+++ b/wpa_supplicant/wpa_supplicant.c
  5001. -@@ -3050,6 +3050,9 @@ static void wpa_supplicant_deinit_iface(
  5002. - }
  5003. - }
  5004. -
  5005. -+extern void supplicant_event(void *ctx, enum wpa_event_type event,
  5006. -+ union wpa_event_data *data);
  5007. -+
  5008. -
  5009. - /**
  5010. - * wpa_supplicant_add_iface - Add a new network interface
  5011. -@@ -3244,6 +3247,7 @@ struct wpa_global * wpa_supplicant_init(
  5012. - wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
  5013. - #endif /* CONFIG_NO_WPA_MSG */
  5014. -
  5015. -+ wpa_supplicant_event = supplicant_event;
  5016. - wpa_debug_open_file(params->wpa_debug_file_path);
  5017. - if (params->wpa_debug_syslog)
  5018. - wpa_debug_open_syslog();
  5019. ---- a/hostapd/main.c
  5020. -+++ b/hostapd/main.c
  5021. -@@ -554,6 +554,9 @@ static int hostapd_get_ctrl_iface_group(
  5022. - return 0;
  5023. - }
  5024. -
  5025. -+void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
  5026. -+ union wpa_event_data *data);
  5027. -+
  5028. -
  5029. - int main(int argc, char *argv[])
  5030. - {
  5031. -@@ -579,6 +582,7 @@ int main(int argc, char *argv[])
  5032. - interfaces.global_iface_name = NULL;
  5033. - interfaces.global_ctrl_sock = -1;
  5034. -
  5035. -+ wpa_supplicant_event = hostapd_wpa_event;
  5036. - for (;;) {
  5037. - c = getopt(argc, argv, "Bde:f:hKP:tvg:G:");
  5038. - if (c < 0)
  5039. ---- a/src/drivers/drivers.c
  5040. -+++ b/src/drivers/drivers.c
  5041. -@@ -7,7 +7,11 @@
  5042. - */
  5043. -
  5044. - #include "includes.h"
  5045. -+#include "common.h"
  5046. -+#include "driver.h"
  5047. -
  5048. -+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
  5049. -+ union wpa_event_data *data);
  5050. -
  5051. - #ifdef CONFIG_DRIVER_WEXT
  5052. - extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
  5053. diff --git a/package/hostapd/patches/420-timestamp_check.patch b/package/hostapd/patches/420-timestamp_check.patch
  5054. deleted file mode 100644
  5055. index b2d4a05..0000000
  5056. --- a/package/hostapd/patches/420-timestamp_check.patch
  5057. +++ /dev/null
  5058. @@ -1,12 +0,0 @@
  5059. ---- a/src/tls/x509v3.c
  5060. -+++ b/src/tls/x509v3.c
  5061. -@@ -1848,6 +1848,9 @@ int x509_certificate_chain_validate(stru
  5062. - if (chain_trusted)
  5063. - continue;
  5064. -
  5065. -+#ifdef NO_TIMESTAMP_CHECK
  5066. -+ disable_time_checks = 1;
  5067. -+#endif
  5068. - if (!disable_time_checks &&
  5069. - ((unsigned long) now.sec <
  5070. - (unsigned long) cert->not_before ||
  5071. diff --git a/package/hostapd/patches/430-rescan_immediately.patch b/package/hostapd/patches/430-rescan_immediately.patch
  5072. deleted file mode 100644
  5073. index 9d5fd32..0000000
  5074. --- a/package/hostapd/patches/430-rescan_immediately.patch
  5075. +++ /dev/null
  5076. @@ -1,11 +0,0 @@
  5077. ---- a/wpa_supplicant/wpa_supplicant.c
  5078. -+++ b/wpa_supplicant/wpa_supplicant.c
  5079. -@@ -2443,7 +2443,7 @@ static struct wpa_supplicant * wpa_suppl
  5080. - if (wpa_s == NULL)
  5081. - return NULL;
  5082. - wpa_s->scan_req = INITIAL_SCAN_REQ;
  5083. -- wpa_s->scan_interval = 5;
  5084. -+ wpa_s->scan_interval = 1;
  5085. - wpa_s->new_connection = 1;
  5086. - wpa_s->parent = wpa_s;
  5087. - wpa_s->sched_scanning = 0;
  5088. diff --git a/package/hostapd/patches/440-optional_rfkill.patch b/package/hostapd/patches/440-optional_rfkill.patch
  5089. deleted file mode 100644
  5090. index 8a006df..0000000
  5091. --- a/package/hostapd/patches/440-optional_rfkill.patch
  5092. +++ /dev/null
  5093. @@ -1,261 +0,0 @@
  5094. ---- a/src/drivers/driver_nl80211.c
  5095. -+++ b/src/drivers/driver_nl80211.c
  5096. -@@ -218,7 +218,9 @@ struct wpa_driver_nl80211_data {
  5097. - int if_removed;
  5098. - int if_disabled;
  5099. - int ignore_if_down_event;
  5100. -+#ifdef CONFIG_RFKILL
  5101. - struct rfkill_data *rfkill;
  5102. -+#endif
  5103. - struct wpa_driver_capa capa;
  5104. - u8 *extended_capa, *extended_capa_mask;
  5105. - unsigned int extended_capa_len;
  5106. -@@ -3128,7 +3130,7 @@ static int wpa_driver_nl80211_init_nl(st
  5107. - return 0;
  5108. - }
  5109. -
  5110. --
  5111. -+#ifdef CONFIG_RFKILL
  5112. - static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
  5113. - {
  5114. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
  5115. -@@ -3151,6 +3153,7 @@ static void wpa_driver_nl80211_rfkill_un
  5116. - }
  5117. - /* rtnetlink ifup handler will report interface as enabled */
  5118. - }
  5119. -+#endif /* CONFIG_RFKILL */
  5120. -
  5121. -
  5122. - static void nl80211_get_phy_name(struct wpa_driver_nl80211_data *drv)
  5123. -@@ -3279,7 +3282,9 @@ static void * wpa_driver_nl80211_init(vo
  5124. - void *global_priv)
  5125. - {
  5126. - struct wpa_driver_nl80211_data *drv;
  5127. -+#ifdef CONFIG_RFKILL
  5128. - struct rfkill_config *rcfg;
  5129. -+#endif
  5130. - struct i802_bss *bss;
  5131. -
  5132. - if (global_priv == NULL)
  5133. -@@ -3315,6 +3320,7 @@ static void * wpa_driver_nl80211_init(vo
  5134. -
  5135. - nl80211_get_phy_name(drv);
  5136. -
  5137. -+#ifdef CONFIG_RFKILL
  5138. - rcfg = os_zalloc(sizeof(*rcfg));
  5139. - if (rcfg == NULL)
  5140. - goto failed;
  5141. -@@ -3327,6 +3333,7 @@ static void * wpa_driver_nl80211_init(vo
  5142. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
  5143. - os_free(rcfg);
  5144. - }
  5145. -+#endif /* CONFIG_RFKILL */
  5146. -
  5147. - if (wpa_driver_nl80211_finish_drv_init(drv))
  5148. - goto failed;
  5149. -@@ -3616,10 +3623,12 @@ static void nl80211_mgmt_unsubscribe(str
  5150. - }
  5151. -
  5152. -
  5153. -+#ifdef CONFIG_RFKILL
  5154. - static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  5155. - {
  5156. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  5157. - }
  5158. -+#endif /* CONFIG_RFKILL */
  5159. -
  5160. - static int
  5161. - wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv,
  5162. -@@ -3640,13 +3649,16 @@ wpa_driver_nl80211_finish_drv_init_sta(s
  5163. - }
  5164. -
  5165. - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
  5166. -+#ifdef CONFIG_RFKILL
  5167. - if (rfkill_is_blocked(drv->rfkill)) {
  5168. - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
  5169. - "interface '%s' due to rfkill",
  5170. - bss->ifname);
  5171. - drv->if_disabled = 1;
  5172. - *send_rfkill_event = 1;
  5173. -- } else {
  5174. -+ } else
  5175. -+#endif
  5176. -+ {
  5177. - wpa_printf(MSG_ERROR, "nl80211: Could not set "
  5178. - "interface '%s' UP", bss->ifname);
  5179. - return -1;
  5180. -@@ -3677,8 +3689,10 @@ wpa_driver_nl80211_finish_drv_init(struc
  5181. - return -1;
  5182. -
  5183. - if (send_rfkill_event) {
  5184. -+#ifdef CONFIG_RFKILL
  5185. - eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
  5186. - drv, drv->ctx);
  5187. -+#endif
  5188. - }
  5189. -
  5190. - return 0;
  5191. -@@ -3764,7 +3778,9 @@ static void wpa_driver_nl80211_deinit(st
  5192. -
  5193. - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
  5194. - IF_OPER_UP);
  5195. -+#ifdef CONFIG_RFKILL
  5196. - rfkill_deinit(drv->rfkill);
  5197. -+#endif
  5198. -
  5199. - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
  5200. -
  5201. ---- a/src/drivers/driver_wext.c
  5202. -+++ b/src/drivers/driver_wext.c
  5203. -@@ -742,7 +742,7 @@ static void wpa_driver_wext_event_rtm_de
  5204. - }
  5205. - }
  5206. -
  5207. --
  5208. -+#ifdef CONFIG_RFKILL
  5209. - static void wpa_driver_wext_rfkill_blocked(void *ctx)
  5210. - {
  5211. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
  5212. -@@ -764,7 +764,7 @@ static void wpa_driver_wext_rfkill_unblo
  5213. - }
  5214. - /* rtnetlink ifup handler will report interface as enabled */
  5215. - }
  5216. --
  5217. -+#endif /* CONFIG_RFKILL */
  5218. -
  5219. - static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
  5220. - {
  5221. -@@ -810,7 +810,9 @@ void * wpa_driver_wext_init(void *ctx, c
  5222. - {
  5223. - struct wpa_driver_wext_data *drv;
  5224. - struct netlink_config *cfg;
  5225. -+#ifdef CONFIG_RFKILL
  5226. - struct rfkill_config *rcfg;
  5227. -+#endif
  5228. - char path[128];
  5229. - struct stat buf;
  5230. -
  5231. -@@ -845,6 +847,7 @@ void * wpa_driver_wext_init(void *ctx, c
  5232. - goto err2;
  5233. - }
  5234. -
  5235. -+#ifdef CONFIG_RFKILL
  5236. - rcfg = os_zalloc(sizeof(*rcfg));
  5237. - if (rcfg == NULL)
  5238. - goto err3;
  5239. -@@ -857,6 +860,7 @@ void * wpa_driver_wext_init(void *ctx, c
  5240. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
  5241. - os_free(rcfg);
  5242. - }
  5243. -+#endif /* CONFIG_RFKILL */
  5244. -
  5245. - drv->mlme_sock = -1;
  5246. -
  5247. -@@ -874,7 +878,9 @@ void * wpa_driver_wext_init(void *ctx, c
  5248. - return drv;
  5249. -
  5250. - err3:
  5251. -+#ifdef CONFIG_RFKILL
  5252. - rfkill_deinit(drv->rfkill);
  5253. -+#endif
  5254. - netlink_deinit(drv->netlink);
  5255. - err2:
  5256. - close(drv->ioctl_sock);
  5257. -@@ -884,10 +890,12 @@ err1:
  5258. - }
  5259. -
  5260. -
  5261. -+#ifdef CONFIG_RFKILL
  5262. - static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  5263. - {
  5264. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  5265. - }
  5266. -+#endif /* CONFIG_RFKILL */
  5267. -
  5268. -
  5269. - static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
  5270. -@@ -895,13 +903,16 @@ static int wpa_driver_wext_finish_drv_in
  5271. - int send_rfkill_event = 0;
  5272. -
  5273. - if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
  5274. -+#ifdef CONFIG_RFKILL
  5275. - if (rfkill_is_blocked(drv->rfkill)) {
  5276. - wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
  5277. - "interface '%s' due to rfkill",
  5278. - drv->ifname);
  5279. - drv->if_disabled = 1;
  5280. - send_rfkill_event = 1;
  5281. -- } else {
  5282. -+ } else
  5283. -+#endif
  5284. -+ {
  5285. - wpa_printf(MSG_ERROR, "WEXT: Could not set "
  5286. - "interface '%s' UP", drv->ifname);
  5287. - return -1;
  5288. -@@ -949,8 +960,10 @@ static int wpa_driver_wext_finish_drv_in
  5289. - 1, IF_OPER_DORMANT);
  5290. -
  5291. - if (send_rfkill_event) {
  5292. -+#ifdef CONFIG_RFKILL
  5293. - eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
  5294. - drv, drv->ctx);
  5295. -+#endif
  5296. - }
  5297. -
  5298. - return 0;
  5299. -@@ -980,7 +993,9 @@ void wpa_driver_wext_deinit(void *priv)
  5300. -
  5301. - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
  5302. - netlink_deinit(drv->netlink);
  5303. -+#ifdef CONFIG_RFKILL
  5304. - rfkill_deinit(drv->rfkill);
  5305. -+#endif
  5306. -
  5307. - if (drv->mlme_sock >= 0)
  5308. - eloop_unregister_read_sock(drv->mlme_sock);
  5309. ---- a/src/drivers/drivers.mak
  5310. -+++ b/src/drivers/drivers.mak
  5311. -@@ -25,7 +25,6 @@ NEED_SME=y
  5312. - NEED_AP_MLME=y
  5313. - NEED_NETLINK=y
  5314. - NEED_LINUX_IOCTL=y
  5315. --NEED_RFKILL=y
  5316. -
  5317. - ifdef CONFIG_LIBNL32
  5318. - DRV_LIBS += -lnl-3
  5319. -@@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
  5320. - CONFIG_WIRELESS_EXTENSION=y
  5321. - NEED_NETLINK=y
  5322. - NEED_LINUX_IOCTL=y
  5323. --NEED_RFKILL=y
  5324. - endif
  5325. -
  5326. - ifdef CONFIG_DRIVER_NDIS
  5327. -@@ -135,7 +133,6 @@ endif
  5328. - ifdef CONFIG_WIRELESS_EXTENSION
  5329. - DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
  5330. - DRV_WPA_OBJS += ../src/drivers/driver_wext.o
  5331. --NEED_RFKILL=y
  5332. - endif
  5333. -
  5334. - ifdef NEED_NETLINK
  5335. -@@ -148,6 +145,7 @@ endif
  5336. -
  5337. - ifdef NEED_RFKILL
  5338. - DRV_OBJS += ../src/drivers/rfkill.o
  5339. -+DRV_WPA_CFLAGS += -DCONFIG_RFKILL
  5340. - endif
  5341. -
  5342. - ifdef CONFIG_VLAN_NETLINK
  5343. ---- a/src/drivers/driver_wext.h
  5344. -+++ b/src/drivers/driver_wext.h
  5345. -@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
  5346. - int ifindex2;
  5347. - int if_removed;
  5348. - int if_disabled;
  5349. -+#ifdef CONFIG_RFKILL
  5350. - struct rfkill_data *rfkill;
  5351. -+#endif
  5352. - u8 *assoc_req_ies;
  5353. - size_t assoc_req_ies_len;
  5354. - u8 *assoc_resp_ies;
  5355. diff --git a/package/hostapd/patches/450-reload_freq_change.patch b/package/hostapd/patches/450-reload_freq_change.patch
  5356. deleted file mode 100644
  5357. index ffa757e..0000000
  5358. --- a/package/hostapd/patches/450-reload_freq_change.patch
  5359. +++ /dev/null
  5360. @@ -1,27 +0,0 @@
  5361. ---- a/src/ap/hostapd.c
  5362. -+++ b/src/ap/hostapd.c
  5363. -@@ -156,6 +156,24 @@ int hostapd_reload_config(struct hostapd
  5364. - oldconf = hapd->iconf;
  5365. - iface->conf = newconf;
  5366. -
  5367. -+ hostapd_select_hw_mode(iface);
  5368. -+ iface->freq = hostapd_hw_get_freq(hapd, newconf->channel);
  5369. -+
  5370. -+ if (hostapd_set_freq(hapd, newconf->hw_mode, iface->freq,
  5371. -+ newconf->channel,
  5372. -+ newconf->ieee80211n,
  5373. -+ newconf->ieee80211ac,
  5374. -+ newconf->secondary_channel,
  5375. -+ newconf->vht_oper_chwidth,
  5376. -+ newconf->vht_oper_centr_freq_seg0_idx,
  5377. -+ newconf->vht_oper_centr_freq_seg1_idx)) {
  5378. -+ wpa_printf(MSG_ERROR, "Could not set channel for "
  5379. -+ "kernel driver");
  5380. -+ }
  5381. -+
  5382. -+ if (iface->current_mode)
  5383. -+ hostapd_prepare_rates(iface, iface->current_mode);
  5384. -+
  5385. - for (j = 0; j < iface->num_bss; j++) {
  5386. - hapd = iface->bss[j];
  5387. - hapd->iconf = newconf;
  5388. diff --git a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch b/package/hostapd/patches/451-nl80211_del_beacon_bss.patch
  5389. deleted file mode 100644
  5390. index fdff9e7..0000000
  5391. --- a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch
  5392. +++ /dev/null
  5393. @@ -1,63 +0,0 @@
  5394. ---- a/src/drivers/driver_nl80211.c
  5395. -+++ b/src/drivers/driver_nl80211.c
  5396. -@@ -3699,16 +3699,18 @@ wpa_driver_nl80211_finish_drv_init(struc
  5397. - }
  5398. -
  5399. -
  5400. --static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
  5401. -+static int wpa_driver_nl80211_del_bss_beacon(struct i802_bss *bss)
  5402. - {
  5403. -+ struct wpa_driver_nl80211_data *drv = bss->drv;
  5404. - struct nl_msg *msg;
  5405. -
  5406. -+ bss->beacon_set = 0;
  5407. - msg = nlmsg_alloc();
  5408. - if (!msg)
  5409. - return -ENOMEM;
  5410. -
  5411. - nl80211_cmd(drv, msg, 0, NL80211_CMD_DEL_BEACON);
  5412. -- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
  5413. -+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
  5414. -
  5415. - return send_and_recv_msgs(drv, msg, NULL, NULL);
  5416. - nla_put_failure:
  5417. -@@ -3716,6 +3718,21 @@ static int wpa_driver_nl80211_del_beacon
  5418. - return -ENOBUFS;
  5419. - }
  5420. -
  5421. -+static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
  5422. -+{
  5423. -+ struct i802_bss *bss;
  5424. -+
  5425. -+ for (bss = &drv->first_bss; bss; bss = bss->next)
  5426. -+ wpa_driver_nl80211_del_bss_beacon(bss);
  5427. -+
  5428. -+ return 0;
  5429. -+}
  5430. -+
  5431. -+static int wpa_driver_nl80211_stop_ap(void *priv)
  5432. -+{
  5433. -+ struct i802_bss *bss = priv;
  5434. -+ return wpa_driver_nl80211_del_beacon(bss->drv);
  5435. -+}
  5436. -
  5437. - /**
  5438. - * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
  5439. -@@ -9855,4 +9872,5 @@ const struct wpa_driver_ops wpa_driver_n
  5440. - .tdls_oper = nl80211_tdls_oper,
  5441. - #endif /* CONFIG_TDLS */
  5442. - .update_ft_ies = wpa_driver_nl80211_update_ft_ies,
  5443. -+ .stop_ap = wpa_driver_nl80211_stop_ap,
  5444. - };
  5445. ---- a/src/drivers/driver.h
  5446. -+++ b/src/drivers/driver.h
  5447. -@@ -2095,6 +2095,9 @@ struct wpa_driver_ops {
  5448. - */
  5449. - int (*probe_req_report)(void *priv, int report);
  5450. -
  5451. -+
  5452. -+ int (*stop_ap)(void *priv);
  5453. -+
  5454. - /**
  5455. - * deinit_ap - Deinitialize AP mode
  5456. - * @priv: Private driver interface data
  5457. diff --git a/package/hostapd/patches/452-ctrl_iface_reload.patch b/package/hostapd/patches/452-ctrl_iface_reload.patch
  5458. deleted file mode 100644
  5459. index 85e871f..0000000
  5460. --- a/package/hostapd/patches/452-ctrl_iface_reload.patch
  5461. +++ /dev/null
  5462. @@ -1,98 +0,0 @@
  5463. ---- a/hostapd/ctrl_iface.c
  5464. -+++ b/hostapd/ctrl_iface.c
  5465. -@@ -33,6 +33,7 @@
  5466. - #include "wps/wps.h"
  5467. - #include "config_file.h"
  5468. - #include "ctrl_iface.h"
  5469. -+#include "config_file.h"
  5470. -
  5471. -
  5472. - struct wpa_ctrl_dst {
  5473. -@@ -43,6 +44,7 @@ struct wpa_ctrl_dst {
  5474. - int errors;
  5475. - };
  5476. -
  5477. -+static char *reload_opts = NULL;
  5478. -
  5479. - static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
  5480. - const char *buf, size_t len);
  5481. -@@ -152,6 +154,68 @@ static int hostapd_ctrl_iface_new_sta(st
  5482. - return 0;
  5483. - }
  5484. -
  5485. -+static int hostapd_ctrl_iface_set_down(struct hostapd_data *hapd)
  5486. -+{
  5487. -+ if (hapd->driver->stop_ap)
  5488. -+ hapd->driver->stop_ap(hapd->drv_priv);
  5489. -+ return 0;
  5490. -+}
  5491. -+
  5492. -+static char *get_option(char *opt, char *str)
  5493. -+{
  5494. -+ int len = strlen(str);
  5495. -+
  5496. -+ if (!strncmp(opt, str, len))
  5497. -+ return opt + len;
  5498. -+ else
  5499. -+ return NULL;
  5500. -+}
  5501. -+
  5502. -+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
  5503. -+{
  5504. -+ struct hostapd_config *conf;
  5505. -+ char *opt, *val;
  5506. -+
  5507. -+ conf = hostapd_config_read(fname);
  5508. -+ if (!conf)
  5509. -+ return NULL;
  5510. -+
  5511. -+ for (opt = strtok(reload_opts, " ");
  5512. -+ opt;
  5513. -+ opt = strtok(NULL, " ")) {
  5514. -+
  5515. -+ if ((val = get_option(opt, "channel=")))
  5516. -+ conf->channel = atoi(val);
  5517. -+ else if ((val = get_option(opt, "ht_capab=")))
  5518. -+ conf->ht_capab = atoi(val);
  5519. -+ else if ((val = get_option(opt, "ht_capab_mask=")))
  5520. -+ conf->ht_capab &= atoi(val);
  5521. -+ else if ((val = get_option(opt, "sec_chan=")))
  5522. -+ conf->secondary_channel = atoi(val);
  5523. -+ else if ((val = get_option(opt, "hw_mode=")))
  5524. -+ conf->hw_mode = atoi(val);
  5525. -+ else if ((val = get_option(opt, "ieee80211n=")))
  5526. -+ conf->ieee80211n = atoi(val);
  5527. -+ else
  5528. -+ break;
  5529. -+ }
  5530. -+
  5531. -+ return conf;
  5532. -+}
  5533. -+
  5534. -+static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
  5535. -+{
  5536. -+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
  5537. -+ struct hostapd_iface *iface = hapd->iface;
  5538. -+
  5539. -+ config_read_cb = iface->interfaces->config_read_cb;
  5540. -+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
  5541. -+ reload_opts = txt;
  5542. -+
  5543. -+ hostapd_reload_config(iface);
  5544. -+
  5545. -+ iface->interfaces->config_read_cb = config_read_cb;
  5546. -+}
  5547. -
  5548. - #ifdef CONFIG_IEEE80211W
  5549. - #ifdef NEED_AP_MLME
  5550. -@@ -902,6 +966,10 @@ static void hostapd_ctrl_iface_receive(i
  5551. - reply_len += res;
  5552. - }
  5553. - #endif /* CONFIG_NO_RADIUS */
  5554. -+ } else if (os_strcmp(buf, "DOWN") == 0) {
  5555. -+ hostapd_ctrl_iface_set_down(hapd);
  5556. -+ } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  5557. -+ hostapd_ctrl_iface_update(hapd, buf + 7);
  5558. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  5559. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  5560. - reply_size);
  5561. diff --git a/package/hostapd/patches/453-ap_sta_support.patch b/package/hostapd/patches/453-ap_sta_support.patch
  5562. deleted file mode 100644
  5563. index a3dff04..0000000
  5564. --- a/package/hostapd/patches/453-ap_sta_support.patch
  5565. +++ /dev/null
  5566. @@ -1,223 +0,0 @@
  5567. ---- a/wpa_supplicant/wpa_supplicant_i.h
  5568. -+++ b/wpa_supplicant/wpa_supplicant_i.h
  5569. -@@ -96,6 +96,8 @@ struct wpa_interface {
  5570. - * receiving of EAPOL frames from an additional interface.
  5571. - */
  5572. - const char *bridge_ifname;
  5573. -+
  5574. -+ const char *hostapd_ctrl;
  5575. - };
  5576. -
  5577. - /**
  5578. -@@ -306,6 +308,8 @@ struct wpa_supplicant {
  5579. - #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  5580. - char bridge_ifname[16];
  5581. -
  5582. -+ struct wpa_ctrl *hostapd;
  5583. -+
  5584. - char *confname;
  5585. - struct wpa_config *conf;
  5586. - int countermeasures;
  5587. ---- a/wpa_supplicant/Makefile
  5588. -+++ b/wpa_supplicant/Makefile
  5589. -@@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config
  5590. - CFLAGS += -I../src
  5591. - CFLAGS += -I../src/utils
  5592. -
  5593. -+ifdef MULTICALL
  5594. -+CFLAGS += -DMULTICALL
  5595. -+endif
  5596. -+
  5597. - -include .config
  5598. - -include $(if $(MULTICALL),../hostapd/.config)
  5599. -
  5600. -@@ -76,6 +80,10 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
  5601. - OBJS_c += ../src/utils/wpa_debug.o
  5602. - OBJS_c += ../src/utils/common.o
  5603. -
  5604. -+ifdef MULTICALL
  5605. -+OBJS += ../src/common/wpa_ctrl.o
  5606. -+endif
  5607. -+
  5608. - ifndef CONFIG_OS
  5609. - ifdef CONFIG_NATIVE_WINDOWS
  5610. - CONFIG_OS=win32
  5611. ---- a/wpa_supplicant/wpa_supplicant.c
  5612. -+++ b/wpa_supplicant/wpa_supplicant.c
  5613. -@@ -107,6 +107,55 @@ extern int wpa_debug_show_keys;
  5614. - extern int wpa_debug_timestamp;
  5615. - extern struct wpa_driver_ops *wpa_drivers[];
  5616. -
  5617. -+#ifdef MULTICALL
  5618. -+static int hostapd_stop(struct wpa_supplicant *wpa_s)
  5619. -+{
  5620. -+ const char *cmd = "DOWN";
  5621. -+ char buf[256];
  5622. -+ int len = sizeof(buf);
  5623. -+
  5624. -+ if (wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL) < 0) {
  5625. -+ wpa_printf(MSG_ERROR, "\nFailed to stop hostapd AP interfaces\n");
  5626. -+ return -1;
  5627. -+ }
  5628. -+ return 0;
  5629. -+}
  5630. -+
  5631. -+static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
  5632. -+{
  5633. -+ char *cmd = NULL;
  5634. -+ char buf[256];
  5635. -+ int len = sizeof(buf);
  5636. -+ int channel, hw_mode;
  5637. -+ int ret;
  5638. -+
  5639. -+ if (!bss)
  5640. -+ return;
  5641. -+
  5642. -+ if (bss->freq < 4000) {
  5643. -+ hw_mode = HOSTAPD_MODE_IEEE80211G;
  5644. -+ channel = (bss->freq - 2407) / 5;
  5645. -+ } else {
  5646. -+ hw_mode = HOSTAPD_MODE_IEEE80211A;
  5647. -+ channel = (bss->freq - 5000) / 5;
  5648. -+ }
  5649. -+
  5650. -+ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d",
  5651. -+ channel, hw_mode, !!bss->ht_capab) < 0) {
  5652. -+ return -1;
  5653. -+ }
  5654. -+
  5655. -+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
  5656. -+ free(cmd);
  5657. -+
  5658. -+ if (ret < 0) {
  5659. -+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n");
  5660. -+ return -1;
  5661. -+ }
  5662. -+ return 0;
  5663. -+}
  5664. -+#endif
  5665. -+
  5666. - /* Configure default/group WEP keys for static WEP */
  5667. - int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
  5668. - {
  5669. -@@ -667,8 +716,16 @@ void wpa_supplicant_set_state(struct wpa
  5670. - #endif /* CONFIG_P2P */
  5671. -
  5672. - sme_sched_obss_scan(wpa_s, 1);
  5673. -+#ifdef MULTICALL
  5674. -+ if (wpa_s->hostapd)
  5675. -+ hostapd_reload(wpa_s, wpa_s->current_bss);
  5676. -+#endif
  5677. - } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
  5678. - state == WPA_ASSOCIATED) {
  5679. -+#ifdef MULTICALL
  5680. -+ if (wpa_s->hostapd)
  5681. -+ hostapd_stop(wpa_s);
  5682. -+#endif
  5683. - wpa_s->new_connection = 1;
  5684. - wpa_drv_set_operstate(wpa_s, 0);
  5685. - #ifndef IEEE8021X_EAPOL
  5686. -@@ -2853,6 +2910,21 @@ static int wpa_supplicant_init_iface(str
  5687. - os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname,
  5688. - sizeof(wpa_s->bridge_ifname));
  5689. - }
  5690. -+#ifdef MULTICALL
  5691. -+ if (iface->hostapd_ctrl) {
  5692. -+ char *cmd = "DOWN";
  5693. -+ char buf[256];
  5694. -+ int len = sizeof(buf);
  5695. -+
  5696. -+ wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl);
  5697. -+ if (!wpa_s->hostapd) {
  5698. -+ wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n");
  5699. -+ return -1;
  5700. -+ }
  5701. -+ if (hostapd_stop(wpa_s) < 0)
  5702. -+ return -1;
  5703. -+ }
  5704. -+#endif
  5705. -
  5706. - /* RSNA Supplicant Key Management - INITIALIZE */
  5707. - eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  5708. ---- a/wpa_supplicant/bss.c
  5709. -+++ b/wpa_supplicant/bss.c
  5710. -@@ -11,6 +11,7 @@
  5711. - #include "utils/common.h"
  5712. - #include "utils/eloop.h"
  5713. - #include "common/ieee802_11_defs.h"
  5714. -+#include "common/ieee802_11_common.h"
  5715. - #include "drivers/driver.h"
  5716. - #include "wpa_supplicant_i.h"
  5717. - #include "config.h"
  5718. -@@ -245,6 +246,9 @@ static void calculate_update_time(const
  5719. - static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
  5720. - struct os_time *fetch_time)
  5721. - {
  5722. -+ struct ieee80211_ht_capabilities *capab;
  5723. -+ struct ieee802_11_elems elems;
  5724. -+
  5725. - dst->flags = src->flags;
  5726. - os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
  5727. - dst->freq = src->freq;
  5728. -@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_
  5729. - dst->level = src->level;
  5730. - dst->tsf = src->tsf;
  5731. -
  5732. -+ memset(&elems, 0, sizeof(elems));
  5733. -+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
  5734. -+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
  5735. -+ if (capab)
  5736. -+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
  5737. -+
  5738. - calculate_update_time(fetch_time, src->age, &dst->last_update);
  5739. - }
  5740. -
  5741. ---- a/wpa_supplicant/main.c
  5742. -+++ b/wpa_supplicant/main.c
  5743. -@@ -25,7 +25,7 @@ static void usage(void)
  5744. - "usage:\n"
  5745. - " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
  5746. - "[-g<global ctrl>] \\\n"
  5747. -- " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
  5748. -+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>]"
  5749. - "[-p<driver_param>] \\\n"
  5750. - " [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] "
  5751. - "\\\n"
  5752. -@@ -67,6 +67,7 @@ static void usage(void)
  5753. - #endif /* CONFIG_DEBUG_LINUX_TRACING */
  5754. - printf(" -t = include timestamp in debug messages\n"
  5755. - " -h = show this help text\n"
  5756. -+ " -H = connect to a hostapd instance to manage state changes\n"
  5757. - " -L = show license (BSD)\n"
  5758. - " -o = override driver parameter for new interfaces\n"
  5759. - " -O = override ctrl_interface parameter for new interfaces\n"
  5760. -@@ -155,7 +156,7 @@ int main(int argc, char *argv[])
  5761. -
  5762. - for (;;) {
  5763. - c = getopt(argc, argv,
  5764. -- "b:Bc:C:D:de:f:g:hi:KLNo:O:p:P:qsTtuvW");
  5765. -+ "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuvW");
  5766. - if (c < 0)
  5767. - break;
  5768. - switch (c) {
  5769. -@@ -199,6 +200,9 @@ int main(int argc, char *argv[])
  5770. - usage();
  5771. - exitcode = 0;
  5772. - goto out;
  5773. -+ case 'H':
  5774. -+ iface->hostapd_ctrl = optarg;
  5775. -+ break;
  5776. - case 'i':
  5777. - iface->ifname = optarg;
  5778. - break;
  5779. ---- a/wpa_supplicant/bss.h
  5780. -+++ b/wpa_supplicant/bss.h
  5781. -@@ -69,6 +69,8 @@ struct wpa_bss {
  5782. - u8 ssid[32];
  5783. - /** Length of SSID */
  5784. - size_t ssid_len;
  5785. -+ /** HT caapbilities */
  5786. -+ u16 ht_capab;
  5787. - /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */
  5788. - int freq;
  5789. - /** Beacon interval in TUs (host byte order) */
  5790. diff --git a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch b/package/hostapd/patches/460-disable_ctrl_iface_mib.patch
  5791. deleted file mode 100644
  5792. index a51ade8..0000000
  5793. --- a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch
  5794. +++ /dev/null
  5795. @@ -1,168 +0,0 @@
  5796. ---- a/hostapd/Makefile
  5797. -+++ b/hostapd/Makefile
  5798. -@@ -136,6 +136,9 @@ endif
  5799. - ifdef CONFIG_NO_CTRL_IFACE
  5800. - CFLAGS += -DCONFIG_NO_CTRL_IFACE
  5801. - else
  5802. -+ifdef CONFIG_CTRL_IFACE_MIB
  5803. -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
  5804. -+endif
  5805. - OBJS += ctrl_iface.o
  5806. - OBJS += ../src/ap/ctrl_iface_ap.o
  5807. - endif
  5808. ---- a/hostapd/ctrl_iface.c
  5809. -+++ b/hostapd/ctrl_iface.c
  5810. -@@ -937,6 +937,7 @@ static void hostapd_ctrl_iface_receive(i
  5811. - } else if (os_strncmp(buf, "RELOG", 5) == 0) {
  5812. - if (wpa_debug_reopen_file() < 0)
  5813. - reply_len = -1;
  5814. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5815. - } else if (os_strcmp(buf, "MIB") == 0) {
  5816. - reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  5817. - if (reply_len >= 0) {
  5818. -@@ -966,10 +967,12 @@ static void hostapd_ctrl_iface_receive(i
  5819. - reply_len += res;
  5820. - }
  5821. - #endif /* CONFIG_NO_RADIUS */
  5822. -+#endif
  5823. - } else if (os_strcmp(buf, "DOWN") == 0) {
  5824. - hostapd_ctrl_iface_set_down(hapd);
  5825. - } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  5826. - hostapd_ctrl_iface_update(hapd, buf + 7);
  5827. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5828. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  5829. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  5830. - reply_size);
  5831. -@@ -979,6 +982,7 @@ static void hostapd_ctrl_iface_receive(i
  5832. - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  5833. - reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
  5834. - reply_size);
  5835. -+#endif
  5836. - } else if (os_strcmp(buf, "ATTACH") == 0) {
  5837. - if (hostapd_ctrl_iface_attach(hapd, &from, fromlen))
  5838. - reply_len = -1;
  5839. ---- a/wpa_supplicant/Makefile
  5840. -+++ b/wpa_supplicant/Makefile
  5841. -@@ -758,6 +758,9 @@ ifdef CONFIG_WNM
  5842. - OBJS += ../src/ap/wnm_ap.o
  5843. - endif
  5844. - ifdef CONFIG_CTRL_IFACE
  5845. -+ifdef CONFIG_CTRL_IFACE_MIB
  5846. -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
  5847. -+endif
  5848. - OBJS += ../src/ap/ctrl_iface_ap.o
  5849. - endif
  5850. -
  5851. ---- a/wpa_supplicant/ctrl_iface.c
  5852. -+++ b/wpa_supplicant/ctrl_iface.c
  5853. -@@ -5051,6 +5051,7 @@ char * wpa_supplicant_ctrl_iface_process
  5854. - reply_len = -1;
  5855. - } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
  5856. - wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
  5857. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5858. - } else if (os_strcmp(buf, "MIB") == 0) {
  5859. - reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
  5860. - if (reply_len >= 0) {
  5861. -@@ -5062,6 +5063,7 @@ char * wpa_supplicant_ctrl_iface_process
  5862. - else
  5863. - reply_len += res;
  5864. - }
  5865. -+#endif
  5866. - } else if (os_strncmp(buf, "STATUS", 6) == 0) {
  5867. - reply_len = wpa_supplicant_ctrl_iface_status(
  5868. - wpa_s, buf + 6, reply, reply_size);
  5869. -@@ -5465,6 +5467,7 @@ char * wpa_supplicant_ctrl_iface_process
  5870. - reply_len = wpa_supplicant_ctrl_iface_bss(
  5871. - wpa_s, buf + 4, reply, reply_size);
  5872. - #ifdef CONFIG_AP
  5873. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5874. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  5875. - reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
  5876. - } else if (os_strncmp(buf, "STA ", 4) == 0) {
  5877. -@@ -5473,6 +5476,7 @@ char * wpa_supplicant_ctrl_iface_process
  5878. - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  5879. - reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
  5880. - reply_size);
  5881. -+#endif
  5882. - } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
  5883. - if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
  5884. - reply_len = -1;
  5885. ---- a/src/ap/ctrl_iface_ap.c
  5886. -+++ b/src/ap/ctrl_iface_ap.c
  5887. -@@ -20,6 +20,7 @@
  5888. - #include "ctrl_iface_ap.h"
  5889. - #include "ap_drv_ops.h"
  5890. -
  5891. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5892. -
  5893. - static int hostapd_get_sta_conn_time(struct sta_info *sta,
  5894. - char *buf, size_t buflen)
  5895. -@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  5896. - return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
  5897. - }
  5898. -
  5899. -+#endif
  5900. -
  5901. - #ifdef CONFIG_P2P_MANAGER
  5902. - static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
  5903. -@@ -303,3 +305,4 @@ int hostapd_ctrl_iface_disassociate(stru
  5904. -
  5905. - return 0;
  5906. - }
  5907. -+
  5908. ---- a/src/ap/ieee802_1x.c
  5909. -+++ b/src/ap/ieee802_1x.c
  5910. -@@ -2048,6 +2048,7 @@ static const char * bool_txt(Boolean boo
  5911. - return bool ? "TRUE" : "FALSE";
  5912. - }
  5913. -
  5914. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5915. -
  5916. - int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  5917. - {
  5918. -@@ -2200,6 +2201,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  5919. - return len;
  5920. - }
  5921. -
  5922. -+#endif
  5923. -
  5924. - static void ieee802_1x_finished(struct hostapd_data *hapd,
  5925. - struct sta_info *sta, int success)
  5926. ---- a/src/ap/wpa_auth.c
  5927. -+++ b/src/ap/wpa_auth.c
  5928. -@@ -2687,6 +2687,7 @@ static const char * wpa_bool_txt(int boo
  5929. - return bool ? "TRUE" : "FALSE";
  5930. - }
  5931. -
  5932. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5933. -
  5934. - #define RSN_SUITE "%02x-%02x-%02x-%d"
  5935. - #define RSN_SUITE_ARG(s) \
  5936. -@@ -2831,7 +2832,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  5937. -
  5938. - return len;
  5939. - }
  5940. --
  5941. -+#endif
  5942. -
  5943. - void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
  5944. - {
  5945. ---- a/src/rsn_supp/wpa.c
  5946. -+++ b/src/rsn_supp/wpa.c
  5947. -@@ -1848,6 +1848,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  5948. - }
  5949. -
  5950. -
  5951. -+#ifdef CONFIG_CTRL_IFACE_MIB
  5952. -+
  5953. - #define RSN_SUITE "%02x-%02x-%02x-%d"
  5954. - #define RSN_SUITE_ARG(s) \
  5955. - ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
  5956. -@@ -1931,6 +1933,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  5957. -
  5958. - return (int) len;
  5959. - }
  5960. -+#endif
  5961. - #endif /* CONFIG_CTRL_IFACE */
  5962. -
  5963. -
  5964. diff --git a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch b/package/hostapd/patches/470-wpa_ie_cap_workaround.patch
  5965. deleted file mode 100644
  5966. index 974ec3d..0000000
  5967. --- a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch
  5968. +++ /dev/null
  5969. @@ -1,56 +0,0 @@
  5970. ---- a/src/common/wpa_common.c
  5971. -+++ b/src/common/wpa_common.c
  5972. -@@ -965,6 +965,31 @@ const char * wpa_key_mgmt_txt(int key_mg
  5973. - }
  5974. -
  5975. -
  5976. -+static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie,
  5977. -+ size_t rsn_ie_len)
  5978. -+{
  5979. -+ int pos, count;
  5980. -+
  5981. -+ pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN;
  5982. -+ if (rsn_ie_len < pos + 2)
  5983. -+ return;
  5984. -+
  5985. -+ count = WPA_GET_LE16(wpa_msg_ie + pos);
  5986. -+ pos += 2 + count * RSN_SELECTOR_LEN;
  5987. -+ if (rsn_ie_len < pos + 2)
  5988. -+ return;
  5989. -+
  5990. -+ count = WPA_GET_LE16(wpa_msg_ie + pos);
  5991. -+ pos += 2 + count * RSN_SELECTOR_LEN;
  5992. -+ if (rsn_ie_len < pos + 2)
  5993. -+ return;
  5994. -+
  5995. -+ if (!assoc_ie[pos] && !assoc_ie[pos + 1] &&
  5996. -+ (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1]))
  5997. -+ memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2);
  5998. -+}
  5999. -+
  6000. -+
  6001. - int wpa_compare_rsn_ie(int ft_initial_assoc,
  6002. - const u8 *ie1, size_t ie1len,
  6003. - const u8 *ie2, size_t ie2len)
  6004. -@@ -972,8 +997,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  6005. - if (ie1 == NULL || ie2 == NULL)
  6006. - return -1;
  6007. -
  6008. -- if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0)
  6009. -- return 0; /* identical IEs */
  6010. -+ if (ie1len == ie2len) {
  6011. -+ u8 *ie_tmp;
  6012. -+
  6013. -+ if (os_memcmp(ie1, ie2, ie1len) == 0)
  6014. -+ return 0; /* identical IEs */
  6015. -+
  6016. -+ ie_tmp = alloca(ie1len);
  6017. -+ memcpy(ie_tmp, ie1, ie1len);
  6018. -+ wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len);
  6019. -+
  6020. -+ if (os_memcmp(ie_tmp, ie2, ie1len) == 0)
  6021. -+ return 0; /* only mismatch in RSN capabilties */
  6022. -+ }
  6023. -
  6024. - #ifdef CONFIG_IEEE80211R
  6025. - if (ft_initial_assoc) {
  6026. diff --git a/package/hostapd/patches/480-terminate_on_setup_failure.patch b/package/hostapd/patches/480-terminate_on_setup_failure.patch
  6027. deleted file mode 100644
  6028. index 3f8a778..0000000
  6029. --- a/package/hostapd/patches/480-terminate_on_setup_failure.patch
  6030. +++ /dev/null
  6031. @@ -1,81 +0,0 @@
  6032. ---- a/src/ap/hostapd.c
  6033. -+++ b/src/ap/hostapd.c
  6034. -@@ -911,11 +911,8 @@ int hostapd_setup_interface_complete(str
  6035. - size_t j;
  6036. - u8 *prev_addr;
  6037. -
  6038. -- if (err) {
  6039. -- wpa_printf(MSG_ERROR, "Interface initialization failed");
  6040. -- eloop_terminate();
  6041. -- return -1;
  6042. -- }
  6043. -+ if (err)
  6044. -+ goto error;
  6045. -
  6046. - wpa_printf(MSG_DEBUG, "Completing interface initialization");
  6047. - if (hapd->iconf->channel) {
  6048. -@@ -935,7 +932,7 @@ int hostapd_setup_interface_complete(str
  6049. - hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
  6050. - wpa_printf(MSG_ERROR, "Could not set channel for "
  6051. - "kernel driver");
  6052. -- return -1;
  6053. -+ goto error;
  6054. - }
  6055. - }
  6056. -
  6057. -@@ -946,7 +943,7 @@ int hostapd_setup_interface_complete(str
  6058. - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
  6059. - HOSTAPD_LEVEL_WARNING,
  6060. - "Failed to prepare rates table.");
  6061. -- return -1;
  6062. -+ goto error;
  6063. - }
  6064. - }
  6065. -
  6066. -@@ -954,14 +951,14 @@ int hostapd_setup_interface_complete(str
  6067. - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
  6068. - wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
  6069. - "kernel driver");
  6070. -- return -1;
  6071. -+ goto error;
  6072. - }
  6073. -
  6074. - if (hapd->iconf->fragm_threshold > -1 &&
  6075. - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) {
  6076. - wpa_printf(MSG_ERROR, "Could not set fragmentation threshold "
  6077. - "for kernel driver");
  6078. -- return -1;
  6079. -+ goto error;
  6080. - }
  6081. -
  6082. - prev_addr = hapd->own_addr;
  6083. -@@ -971,7 +968,7 @@ int hostapd_setup_interface_complete(str
  6084. - if (j)
  6085. - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
  6086. - if (hostapd_setup_bss(hapd, j == 0))
  6087. -- return -1;
  6088. -+ goto error;
  6089. - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
  6090. - prev_addr = hapd->own_addr;
  6091. - }
  6092. -@@ -983,7 +980,7 @@ int hostapd_setup_interface_complete(str
  6093. - if (hostapd_driver_commit(hapd) < 0) {
  6094. - wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
  6095. - "configuration", __func__);
  6096. -- return -1;
  6097. -+ goto error;
  6098. - }
  6099. -
  6100. - /*
  6101. -@@ -1004,6 +1001,11 @@ int hostapd_setup_interface_complete(str
  6102. - iface->bss[0]->conf->iface);
  6103. -
  6104. - return 0;
  6105. -+
  6106. -+error:
  6107. -+ wpa_printf(MSG_ERROR, "Interface initialization failed");
  6108. -+ eloop_terminate();
  6109. -+ return -1;
  6110. - }
  6111. -
  6112. -
  6113. diff --git a/package/hostapd/patches/500-random_pool_add_kernel.patch b/package/hostapd/patches/500-random_pool_add_kernel.patch
  6114. deleted file mode 100644
  6115. index ccecb22..0000000
  6116. --- a/package/hostapd/patches/500-random_pool_add_kernel.patch
  6117. +++ /dev/null
  6118. @@ -1,177 +0,0 @@
  6119. ---- a/src/crypto/random.c
  6120. -+++ b/src/crypto/random.c
  6121. -@@ -25,6 +25,7 @@
  6122. - #include "utils/includes.h"
  6123. - #ifdef __linux__
  6124. - #include <fcntl.h>
  6125. -+#include <sys/stat.h>
  6126. - #endif /* __linux__ */
  6127. -
  6128. - #include "utils/common.h"
  6129. -@@ -33,6 +34,8 @@
  6130. - #include "sha1.h"
  6131. - #include "random.h"
  6132. -
  6133. -+#define RANDOM_STAMPFILE "/var/run/.random_available"
  6134. -+
  6135. - #define POOL_WORDS 32
  6136. - #define POOL_WORDS_MASK (POOL_WORDS - 1)
  6137. - #define POOL_TAP1 26
  6138. -@@ -43,6 +46,8 @@
  6139. - #define EXTRACT_LEN 16
  6140. - #define MIN_READY_MARK 2
  6141. -
  6142. -+#ifndef CONFIG_NO_RANDOM_POOL
  6143. -+
  6144. - static u32 pool[POOL_WORDS];
  6145. - static unsigned int input_rotate = 0;
  6146. - static unsigned int pool_pos = 0;
  6147. -@@ -123,7 +128,7 @@ static void random_extract(u8 *out)
  6148. - }
  6149. -
  6150. -
  6151. --void random_add_randomness(const void *buf, size_t len)
  6152. -+static void random_pool_add_randomness(const void *buf, size_t len)
  6153. - {
  6154. - struct os_time t;
  6155. - static unsigned int count = 0;
  6156. -@@ -213,16 +218,22 @@ int random_get_bytes(void *buf, size_t l
  6157. - int random_pool_ready(void)
  6158. - {
  6159. - #ifdef __linux__
  6160. -+ struct stat st;
  6161. - int fd;
  6162. - ssize_t res;
  6163. -
  6164. -+ if (stat(RANDOM_STAMPFILE, &st) == 0)
  6165. -+ return 1;
  6166. -+
  6167. - /*
  6168. - * Make sure that there is reasonable entropy available before allowing
  6169. - * some key derivation operations to proceed.
  6170. - */
  6171. -
  6172. -- if (dummy_key_avail == sizeof(dummy_key))
  6173. -+ if (dummy_key_avail == sizeof(dummy_key)) {
  6174. -+ random_mark_pool_ready();
  6175. - return 1; /* Already initialized - good to continue */
  6176. -+ }
  6177. -
  6178. - /*
  6179. - * Try to fetch some more data from the kernel high quality
  6180. -@@ -257,6 +268,7 @@ int random_pool_ready(void)
  6181. - if (dummy_key_avail == sizeof(dummy_key)) {
  6182. - if (own_pool_ready < MIN_READY_MARK)
  6183. - own_pool_ready = MIN_READY_MARK;
  6184. -+ random_mark_pool_ready();
  6185. - random_write_entropy();
  6186. - return 1;
  6187. - }
  6188. -@@ -269,6 +281,7 @@ int random_pool_ready(void)
  6189. - total_collected + 10 * own_pool_ready > MIN_COLLECT_ENTROPY) {
  6190. - wpa_printf(MSG_INFO, "random: Allow operation to proceed "
  6191. - "based on internal entropy");
  6192. -+ random_mark_pool_ready();
  6193. - return 1;
  6194. - }
  6195. -
  6196. -@@ -284,10 +297,16 @@ int random_pool_ready(void)
  6197. -
  6198. - void random_mark_pool_ready(void)
  6199. - {
  6200. -+ int fd;
  6201. -+
  6202. - own_pool_ready++;
  6203. - wpa_printf(MSG_DEBUG, "random: Mark internal entropy pool to be "
  6204. - "ready (count=%u/%u)", own_pool_ready, MIN_READY_MARK);
  6205. - random_write_entropy();
  6206. -+
  6207. -+ fd = open(RANDOM_STAMPFILE, O_CREAT | O_WRONLY | O_EXCL | O_NOFOLLOW, 0600);
  6208. -+ if (fd >= 0)
  6209. -+ close(fd);
  6210. - }
  6211. -
  6212. -
  6213. -@@ -444,3 +463,22 @@ void random_deinit(void)
  6214. - os_free(random_entropy_file);
  6215. - random_entropy_file = NULL;
  6216. - }
  6217. -+
  6218. -+#endif /* CONFIG_NO_RANDOM_POOL */
  6219. -+
  6220. -+
  6221. -+void random_add_randomness(const void *buf, size_t len)
  6222. -+{
  6223. -+#ifdef __linux__
  6224. -+ int fd;
  6225. -+
  6226. -+ fd = open("/dev/random", O_RDWR);
  6227. -+ if (fd >= 0) {
  6228. -+ write(fd, buf, len);
  6229. -+ close(fd);
  6230. -+ }
  6231. -+#endif
  6232. -+#ifndef CONFIG_NO_RANDOM_POOL
  6233. -+ random_pool_add_randomness(buf, len);
  6234. -+#endif
  6235. -+}
  6236. ---- a/wpa_supplicant/Makefile
  6237. -+++ b/wpa_supplicant/Makefile
  6238. -@@ -1226,9 +1226,8 @@ endif
  6239. -
  6240. - ifdef CONFIG_NO_RANDOM_POOL
  6241. - CFLAGS += -DCONFIG_NO_RANDOM_POOL
  6242. --else
  6243. --OBJS += ../src/crypto/random.o
  6244. - endif
  6245. -+OBJS += ../src/crypto/random.o
  6246. -
  6247. - ifdef CONFIG_CTRL_IFACE
  6248. - ifeq ($(CONFIG_CTRL_IFACE), y)
  6249. ---- a/wpa_supplicant/Android.mk
  6250. -+++ b/wpa_supplicant/Android.mk
  6251. -@@ -1191,9 +1191,8 @@ endif
  6252. -
  6253. - ifdef CONFIG_NO_RANDOM_POOL
  6254. - L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  6255. --else
  6256. --OBJS += src/crypto/random.c
  6257. - endif
  6258. -+OBJS += src/crypto/random.c
  6259. -
  6260. - ifdef CONFIG_CTRL_IFACE
  6261. - ifeq ($(CONFIG_CTRL_IFACE), y)
  6262. ---- a/hostapd/Android.mk
  6263. -+++ b/hostapd/Android.mk
  6264. -@@ -775,12 +775,12 @@ endif
  6265. - ifdef CONFIG_NO_RANDOM_POOL
  6266. - L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  6267. - else
  6268. --OBJS += src/crypto/random.c
  6269. --HOBJS += src/crypto/random.c
  6270. - HOBJS += src/utils/eloop.c
  6271. - HOBJS += $(SHA1OBJS)
  6272. - HOBJS += src/crypto/md5.c
  6273. - endif
  6274. -+OBJS += src/crypto/random.c
  6275. -+HOBJS += src/crypto/random.c
  6276. -
  6277. - ifdef CONFIG_RADIUS_SERVER
  6278. - L_CFLAGS += -DRADIUS_SERVER
  6279. ---- a/hostapd/Makefile
  6280. -+++ b/hostapd/Makefile
  6281. -@@ -748,12 +748,12 @@ endif
  6282. - ifdef CONFIG_NO_RANDOM_POOL
  6283. - CFLAGS += -DCONFIG_NO_RANDOM_POOL
  6284. - else
  6285. --OBJS += ../src/crypto/random.o
  6286. --HOBJS += ../src/crypto/random.o
  6287. - HOBJS += ../src/utils/eloop.o
  6288. - HOBJS += $(SHA1OBJS)
  6289. - HOBJS += ../src/crypto/md5.o
  6290. - endif
  6291. -+OBJS += ../src/crypto/random.o
  6292. -+HOBJS += ../src/crypto/random.o
  6293. -
  6294. - ifdef CONFIG_RADIUS_SERVER
  6295. - CFLAGS += -DRADIUS_SERVER
  6296. diff --git a/package/hostapd/patches/510-bring_down_interface.patch b/package/hostapd/patches/510-bring_down_interface.patch
  6297. deleted file mode 100644
  6298. index e92c122..0000000
  6299. --- a/package/hostapd/patches/510-bring_down_interface.patch
  6300. +++ /dev/null
  6301. @@ -1,19 +0,0 @@
  6302. ---- a/src/drivers/driver_nl80211.c
  6303. -+++ b/src/drivers/driver_nl80211.c
  6304. -@@ -7616,8 +7616,6 @@ static int wpa_driver_nl80211_set_mode(s
  6305. - ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
  6306. - if (ret == -EACCES)
  6307. - break;
  6308. -- res = linux_set_iface_flags(drv->global->ioctl_sock,
  6309. -- bss->ifname, 1);
  6310. - if (res && !ret)
  6311. - ret = -1;
  6312. - else if (ret != -EBUSY)
  6313. -@@ -7633,6 +7631,7 @@ static int wpa_driver_nl80211_set_mode(s
  6314. - "interface is down");
  6315. - drv->nlmode = nlmode;
  6316. - drv->ignore_if_down_event = 1;
  6317. -+ linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1);
  6318. - }
  6319. -
  6320. - done:
  6321. diff --git a/package/hostapd/patches/520-fix_wps_pin_crash.patch b/package/hostapd/patches/520-fix_wps_pin_crash.patch
  6322. deleted file mode 100644
  6323. index 80d562c..0000000
  6324. --- a/package/hostapd/patches/520-fix_wps_pin_crash.patch
  6325. +++ /dev/null
  6326. @@ -1,12 +0,0 @@
  6327. ---- a/hostapd/ctrl_iface.c
  6328. -+++ b/hostapd/ctrl_iface.c
  6329. -@@ -479,6 +479,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
  6330. - char *pos;
  6331. - const char *pin_txt;
  6332. -
  6333. -+ if (!hapd->wps)
  6334. -+ return -1;
  6335. -+
  6336. - pos = os_strchr(txt, ' ');
  6337. - if (pos)
  6338. - *pos++ = '\0';
  6339. diff --git a/package/hostapd/patches/530-wps_single_auth_enc_type.patch b/package/hostapd/patches/530-wps_single_auth_enc_type.patch
  6340. deleted file mode 100644
  6341. index 6f4a655..0000000
  6342. --- a/package/hostapd/patches/530-wps_single_auth_enc_type.patch
  6343. +++ /dev/null
  6344. @@ -1,25 +0,0 @@
  6345. ---- a/src/ap/wps_hostapd.c
  6346. -+++ b/src/ap/wps_hostapd.c
  6347. -@@ -989,11 +989,9 @@ int hostapd_init_wps(struct hostapd_data
  6348. -
  6349. - if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
  6350. - wps->encr_types |= WPS_ENCR_AES;
  6351. -- if (conf->rsn_pairwise & WPA_CIPHER_TKIP)
  6352. -+ else if (conf->rsn_pairwise & WPA_CIPHER_TKIP)
  6353. - wps->encr_types |= WPS_ENCR_TKIP;
  6354. -- }
  6355. --
  6356. -- if (conf->wpa & WPA_PROTO_WPA) {
  6357. -+ } else if (conf->wpa & WPA_PROTO_WPA) {
  6358. - if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
  6359. - wps->auth_types |= WPS_AUTH_WPAPSK;
  6360. - if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
  6361. -@@ -1001,7 +999,7 @@ int hostapd_init_wps(struct hostapd_data
  6362. -
  6363. - if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
  6364. - wps->encr_types |= WPS_ENCR_AES;
  6365. -- if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
  6366. -+ else if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
  6367. - wps->encr_types |= WPS_ENCR_TKIP;
  6368. - }
  6369. -
  6370. diff --git a/package/hostapd/patches/540-dynamic_20_40_mhz.patch b/package/hostapd/patches/540-dynamic_20_40_mhz.patch
  6371. deleted file mode 100644
  6372. index a7b39db..0000000
  6373. --- a/package/hostapd/patches/540-dynamic_20_40_mhz.patch
  6374. +++ /dev/null
  6375. @@ -1,206 +0,0 @@
  6376. ---- a/hostapd/config_file.c
  6377. -+++ b/hostapd/config_file.c
  6378. -@@ -2474,6 +2474,10 @@ static int hostapd_config_fill(struct ho
  6379. - "ht_capab", line);
  6380. - errors++;
  6381. - }
  6382. -+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
  6383. -+ conf->dynamic_ht40 = atoi(pos);
  6384. -+ if (conf->dynamic_ht40 == 1)
  6385. -+ conf->dynamic_ht40 = 1500;
  6386. - } else if (os_strcmp(buf, "require_ht") == 0) {
  6387. - conf->require_ht = atoi(pos);
  6388. - #endif /* CONFIG_IEEE80211N */
  6389. ---- a/src/ap/ap_config.h
  6390. -+++ b/src/ap/ap_config.h
  6391. -@@ -515,6 +515,7 @@ struct hostapd_config {
  6392. - int ieee80211n;
  6393. - int secondary_channel;
  6394. - int require_ht;
  6395. -+ int dynamic_ht40;
  6396. - u32 vht_capab;
  6397. - int ieee80211ac;
  6398. - int require_vht;
  6399. ---- a/src/ap/hostapd.c
  6400. -+++ b/src/ap/hostapd.c
  6401. -@@ -22,6 +22,7 @@
  6402. - #include "beacon.h"
  6403. - #include "iapp.h"
  6404. - #include "ieee802_1x.h"
  6405. -+#include "ieee802_11.h"
  6406. - #include "ieee802_11_auth.h"
  6407. - #include "vlan_init.h"
  6408. - #include "wpa_auth.h"
  6409. -@@ -348,6 +349,7 @@ static void hostapd_cleanup_iface_pre(st
  6410. -
  6411. - static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
  6412. - {
  6413. -+ hostapd_deinit_ht(iface);
  6414. - hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
  6415. - iface->hw_features = NULL;
  6416. - os_free(iface->current_rates);
  6417. ---- a/src/ap/hostapd.h
  6418. -+++ b/src/ap/hostapd.h
  6419. -@@ -269,6 +269,9 @@ struct hostapd_iface {
  6420. - /* Overlapping BSS information */
  6421. - int olbc_ht;
  6422. -
  6423. -+ int force_20mhz;
  6424. -+ struct os_time last_20mhz_trigger;
  6425. -+
  6426. - u16 ht_op_mode;
  6427. - void (*scan_cb)(struct hostapd_iface *iface);
  6428. - };
  6429. ---- a/src/ap/ieee802_11.c
  6430. -+++ b/src/ap/ieee802_11.c
  6431. -@@ -1484,6 +1484,9 @@ static void handle_beacon(struct hostapd
  6432. - sizeof(mgmt->u.beacon)), &elems,
  6433. - 0);
  6434. -
  6435. -+ if (!elems.ht_capabilities)
  6436. -+ hostapd_trigger_20mhz(hapd->iface);
  6437. -+
  6438. - ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
  6439. - }
  6440. -
  6441. ---- a/src/ap/ieee802_11.h
  6442. -+++ b/src/ap/ieee802_11.h
  6443. -@@ -81,4 +81,17 @@ int hostapd_update_time_adv(struct hosta
  6444. - void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
  6445. - u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
  6446. -
  6447. -+#ifdef CONFIG_IEEE80211N
  6448. -+void hostapd_trigger_20mhz(struct hostapd_iface *iface);
  6449. -+void hostapd_deinit_ht(struct hostapd_iface *iface);
  6450. -+
  6451. -+#else
  6452. -+static inline void hostapd_deinit_ht(struct hostapd_iface *iface)
  6453. -+{
  6454. -+}
  6455. -+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface)
  6456. -+{
  6457. -+}
  6458. -+#endif /* CONFIG_IEEE80211N */
  6459. -+
  6460. - #endif /* IEEE802_11_H */
  6461. ---- a/src/ap/ieee802_11_ht.c
  6462. -+++ b/src/ap/ieee802_11_ht.c
  6463. -@@ -20,9 +20,11 @@
  6464. - #include "drivers/driver.h"
  6465. - #include "hostapd.h"
  6466. - #include "ap_config.h"
  6467. -+#include "ap_drv_ops.h"
  6468. - #include "sta_info.h"
  6469. - #include "beacon.h"
  6470. - #include "ieee802_11.h"
  6471. -+#include "utils/eloop.h"
  6472. -
  6473. -
  6474. - u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
  6475. -@@ -70,12 +72,15 @@ u8 * hostapd_eid_ht_operation(struct hos
  6476. -
  6477. - oper->control_chan = hapd->iconf->channel;
  6478. - oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
  6479. -- if (hapd->iconf->secondary_channel == 1)
  6480. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  6481. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  6482. -- if (hapd->iconf->secondary_channel == -1)
  6483. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  6484. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  6485. -+
  6486. -+ if (!hapd->iface->force_20mhz) {
  6487. -+ if (hapd->iconf->secondary_channel == 1)
  6488. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  6489. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  6490. -+ if (hapd->iconf->secondary_channel == -1)
  6491. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  6492. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  6493. -+ }
  6494. -
  6495. - pos += sizeof(*oper);
  6496. -
  6497. -@@ -270,3 +275,84 @@ void hostapd_get_ht_capab(struct hostapd
  6498. -
  6499. - neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
  6500. - }
  6501. -+
  6502. -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface);
  6503. -+
  6504. -+static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
  6505. -+{
  6506. -+ struct hostapd_iface *iface = eloop_data;
  6507. -+ struct os_time time;
  6508. -+ int timeout;
  6509. -+
  6510. -+ if (!iface->last_20mhz_trigger.sec)
  6511. -+ return;
  6512. -+
  6513. -+ os_get_time(&time);
  6514. -+ timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 -
  6515. -+ time.sec;
  6516. -+
  6517. -+ if (timeout > 0) {
  6518. -+ eloop_register_timeout(timeout, 0, hostapd_restore_40mhz,
  6519. -+ iface, NULL);
  6520. -+ return;
  6521. -+ }
  6522. -+
  6523. -+ iface->last_20mhz_trigger.sec = 0;
  6524. -+ iface->last_20mhz_trigger.usec = 0;
  6525. -+
  6526. -+ iface->force_20mhz = 0;
  6527. -+ hostapd_set_force_20mhz(iface);
  6528. -+}
  6529. -+
  6530. -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface)
  6531. -+{
  6532. -+ int secondary_channel;
  6533. -+ int i;
  6534. -+
  6535. -+ ieee802_11_set_beacons(iface);
  6536. -+
  6537. -+ for (i = 0; i < iface->num_bss; i++) {
  6538. -+ struct hostapd_data *hapd = iface->bss[i];
  6539. -+
  6540. -+ if (iface->force_20mhz)
  6541. -+ secondary_channel = 0;
  6542. -+ else
  6543. -+ secondary_channel = hapd->iconf->secondary_channel;
  6544. -+
  6545. -+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
  6546. -+ hapd->iconf->channel,
  6547. -+ hapd->iconf->ieee80211n,
  6548. -+ hapd->iconf->ieee80211ac,
  6549. -+ secondary_channel,
  6550. -+ hapd->iconf->vht_oper_chwidth,
  6551. -+ hapd->iconf->vht_oper_centr_freq_seg0_idx,
  6552. -+ hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
  6553. -+ wpa_printf(MSG_ERROR, "Could not set channel for "
  6554. -+ "kernel driver");
  6555. -+ }
  6556. -+ }
  6557. -+}
  6558. -+
  6559. -+void hostapd_deinit_ht(struct hostapd_iface *iface)
  6560. -+{
  6561. -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
  6562. -+}
  6563. -+
  6564. -+void hostapd_trigger_20mhz(struct hostapd_iface *iface)
  6565. -+{
  6566. -+ if (!iface->conf->dynamic_ht40)
  6567. -+ return;
  6568. -+
  6569. -+ if (!iface->force_20mhz) {
  6570. -+ iface->force_20mhz = 1;
  6571. -+ hostapd_set_force_20mhz(iface);
  6572. -+ }
  6573. -+
  6574. -+ if (!iface->last_20mhz_trigger.sec) {
  6575. -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
  6576. -+ eloop_register_timeout(iface->conf->dynamic_ht40, 0,
  6577. -+ hostapd_restore_40mhz, iface, NULL);
  6578. -+ }
  6579. -+
  6580. -+ os_get_time(&iface->last_20mhz_trigger);
  6581. -+}
  6582. diff --git a/package/hostapd/patches/550-limit_debug_messages.patch b/package/hostapd/patches/550-limit_debug_messages.patch
  6583. deleted file mode 100644
  6584. index 659e980..0000000
  6585. --- a/package/hostapd/patches/550-limit_debug_messages.patch
  6586. +++ /dev/null
  6587. @@ -1,213 +0,0 @@
  6588. ---- a/src/utils/wpa_debug.c
  6589. -+++ b/src/utils/wpa_debug.c
  6590. -@@ -201,7 +201,7 @@ void wpa_debug_close_linux_tracing(void)
  6591. - *
  6592. - * Note: New line '\n' is added to the end of the text when printing to stdout.
  6593. - */
  6594. --void wpa_printf(int level, const char *fmt, ...)
  6595. -+void _wpa_printf(int level, const char *fmt, ...)
  6596. - {
  6597. - va_list ap;
  6598. -
  6599. -@@ -248,8 +248,8 @@ void wpa_printf(int level, const char *f
  6600. - }
  6601. -
  6602. -
  6603. --static void _wpa_hexdump(int level, const char *title, const u8 *buf,
  6604. -- size_t len, int show)
  6605. -+void _wpa_hexdump(int level, const char *title, const u8 *buf,
  6606. -+ size_t len, int show)
  6607. - {
  6608. - size_t i;
  6609. -
  6610. -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons
  6611. - #endif /* CONFIG_ANDROID_LOG */
  6612. - }
  6613. -
  6614. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  6615. --{
  6616. -- _wpa_hexdump(level, title, buf, len, 1);
  6617. --}
  6618. --
  6619. --
  6620. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  6621. --{
  6622. -- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
  6623. --}
  6624. -
  6625. --
  6626. --static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  6627. -- size_t len, int show)
  6628. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  6629. -+ size_t len, int show)
  6630. - {
  6631. - size_t i, llen;
  6632. - const u8 *pos = buf;
  6633. -@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level
  6634. - }
  6635. -
  6636. -
  6637. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
  6638. --{
  6639. -- _wpa_hexdump_ascii(level, title, buf, len, 1);
  6640. --}
  6641. --
  6642. --
  6643. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  6644. -- size_t len)
  6645. --{
  6646. -- _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
  6647. --}
  6648. --
  6649. --
  6650. - #ifdef CONFIG_DEBUG_FILE
  6651. - static char *last_path = NULL;
  6652. - #endif /* CONFIG_DEBUG_FILE */
  6653. -@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
  6654. - }
  6655. -
  6656. -
  6657. --void wpa_msg(void *ctx, int level, const char *fmt, ...)
  6658. -+void _wpa_msg(void *ctx, int level, const char *fmt, ...)
  6659. - {
  6660. - va_list ap;
  6661. - char *buf;
  6662. -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const
  6663. - }
  6664. -
  6665. -
  6666. --void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
  6667. -+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
  6668. - {
  6669. - va_list ap;
  6670. - char *buf;
  6671. ---- a/src/utils/wpa_debug.h
  6672. -+++ b/src/utils/wpa_debug.h
  6673. -@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path
  6674. - int wpa_debug_reopen_file(void);
  6675. - void wpa_debug_close_file(void);
  6676. -
  6677. -+/* internal */
  6678. -+void _wpa_hexdump(int level, const char *title, const u8 *buf,
  6679. -+ size_t len, int show);
  6680. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  6681. -+ size_t len, int show);
  6682. -+extern int wpa_debug_show_keys;
  6683. -+
  6684. -+#ifndef CONFIG_MSG_MIN_PRIORITY
  6685. -+#define CONFIG_MSG_MIN_PRIORITY 0
  6686. -+#endif
  6687. -+
  6688. - /**
  6689. - * wpa_debug_printf_timestamp - Print timestamp for debug output
  6690. - *
  6691. -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void);
  6692. - *
  6693. - * Note: New line '\n' is added to the end of the text when printing to stdout.
  6694. - */
  6695. --void wpa_printf(int level, const char *fmt, ...)
  6696. -+void _wpa_printf(int level, const char *fmt, ...)
  6697. - PRINTF_FORMAT(2, 3);
  6698. -
  6699. -+#define wpa_printf(level, ...) \
  6700. -+ do { \
  6701. -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
  6702. -+ _wpa_printf(level, __VA_ARGS__); \
  6703. -+ } while(0)
  6704. -+
  6705. - /**
  6706. - * wpa_hexdump - conditional hex dump
  6707. - * @level: priority level (MSG_*) of the message
  6708. -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3);
  6709. - * output may be directed to stdout, stderr, and/or syslog based on
  6710. - * configuration. The contents of buf is printed out has hex dump.
  6711. - */
  6712. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
  6713. -+static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  6714. -+{
  6715. -+ if (level < CONFIG_MSG_MIN_PRIORITY)
  6716. -+ return;
  6717. -+
  6718. -+ _wpa_hexdump(level, title, buf, len, 1);
  6719. -+}
  6720. -
  6721. - static inline void wpa_hexdump_buf(int level, const char *title,
  6722. - const struct wpabuf *buf)
  6723. -@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l
  6724. - * like wpa_hexdump(), but by default, does not include secret keys (passwords,
  6725. - * etc.) in debug output.
  6726. - */
  6727. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
  6728. -+static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  6729. -+{
  6730. -+ if (level < CONFIG_MSG_MIN_PRIORITY)
  6731. -+ return;
  6732. -+
  6733. -+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
  6734. -+}
  6735. -
  6736. - static inline void wpa_hexdump_buf_key(int level, const char *title,
  6737. - const struct wpabuf *buf)
  6738. -@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i
  6739. - * the hex numbers and ASCII characters (for printable range) are shown. 16
  6740. - * bytes per line will be shown.
  6741. - */
  6742. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  6743. -- size_t len);
  6744. -+static inline void wpa_hexdump_ascii(int level, const char *title,
  6745. -+ const u8 *buf, size_t len)
  6746. -+{
  6747. -+ if (level < CONFIG_MSG_MIN_PRIORITY)
  6748. -+ return;
  6749. -+
  6750. -+ _wpa_hexdump_ascii(level, title, buf, len, 1);
  6751. -+}
  6752. -
  6753. - /**
  6754. - * wpa_hexdump_ascii_key - conditional hex dump, hide keys
  6755. -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const
  6756. - * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
  6757. - * default, does not include secret keys (passwords, etc.) in debug output.
  6758. - */
  6759. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  6760. -- size_t len);
  6761. -+static inline void wpa_hexdump_ascii_key(int level, const char *title,
  6762. -+ const u8 *buf, size_t len)
  6763. -+{
  6764. -+ if (level < CONFIG_MSG_MIN_PRIORITY)
  6765. -+ return;
  6766. -+
  6767. -+ _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
  6768. -+}
  6769. -
  6770. - /*
  6771. - * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
  6772. -@@ -172,7 +213,12 @@ void wpa_hexdump_ascii_key(int level, co
  6773. - *
  6774. - * Note: New line '\n' is added to the end of the text when printing to stdout.
  6775. - */
  6776. --void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
  6777. -+void _wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
  6778. -+#define wpa_msg(ctx, level, ...) \
  6779. -+ do { \
  6780. -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
  6781. -+ _wpa_msg(ctx, level, __VA_ARGS__); \
  6782. -+ } while(0)
  6783. -
  6784. - /**
  6785. - * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
  6786. -@@ -186,8 +232,13 @@ void wpa_msg(void *ctx, int level, const
  6787. - * attached ctrl_iface monitors. In other words, it can be used for frequent
  6788. - * events that do not need to be sent to syslog.
  6789. - */
  6790. --void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
  6791. -+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
  6792. - PRINTF_FORMAT(3, 4);
  6793. -+#define wpa_msg_ctrl(ctx, level, ...) \
  6794. -+ do { \
  6795. -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
  6796. -+ _wpa_msg_ctrl(ctx, level, __VA_ARGS__); \
  6797. -+ } while(0)
  6798. -
  6799. - typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt,
  6800. - size_t len);
  6801. diff --git a/package/hostapd/patches/560-indicate-features.patch b/package/hostapd/patches/560-indicate-features.patch
  6802. deleted file mode 100644
  6803. index 9073bd43..0000000
  6804. --- a/package/hostapd/patches/560-indicate-features.patch
  6805. +++ /dev/null
  6806. @@ -1,82 +0,0 @@
  6807. ---- a/hostapd/main.c
  6808. -+++ b/hostapd/main.c
  6809. -@@ -14,6 +14,7 @@
  6810. -
  6811. - #include "utils/common.h"
  6812. - #include "utils/eloop.h"
  6813. -+#include "utils/build_features.h"
  6814. - #include "crypto/random.h"
  6815. - #include "crypto/tls.h"
  6816. - #include "common/version.h"
  6817. -@@ -584,7 +585,7 @@ int main(int argc, char *argv[])
  6818. -
  6819. - wpa_supplicant_event = hostapd_wpa_event;
  6820. - for (;;) {
  6821. -- c = getopt(argc, argv, "Bde:f:hKP:tvg:G:");
  6822. -+ c = getopt(argc, argv, "Bde:f:hKP:tg:G:v::");
  6823. - if (c < 0)
  6824. - break;
  6825. - switch (c) {
  6826. -@@ -616,6 +617,8 @@ int main(int argc, char *argv[])
  6827. - wpa_debug_timestamp++;
  6828. - break;
  6829. - case 'v':
  6830. -+ if (optarg)
  6831. -+ exit(!has_feature(optarg));
  6832. - show_version();
  6833. - exit(1);
  6834. - break;
  6835. ---- a/wpa_supplicant/main.c
  6836. -+++ b/wpa_supplicant/main.c
  6837. -@@ -12,6 +12,7 @@
  6838. - #endif /* __linux__ */
  6839. -
  6840. - #include "common.h"
  6841. -+#include "build_features.h"
  6842. - #include "wpa_supplicant_i.h"
  6843. - #include "driver_i.h"
  6844. -
  6845. -@@ -156,7 +157,7 @@ int main(int argc, char *argv[])
  6846. -
  6847. - for (;;) {
  6848. - c = getopt(argc, argv,
  6849. -- "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuvW");
  6850. -+ "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuv::W");
  6851. - if (c < 0)
  6852. - break;
  6853. - switch (c) {
  6854. -@@ -248,8 +249,12 @@ int main(int argc, char *argv[])
  6855. - break;
  6856. - #endif /* CONFIG_DBUS */
  6857. - case 'v':
  6858. -- printf("%s\n", wpa_supplicant_version);
  6859. -- exitcode = 0;
  6860. -+ if (optarg) {
  6861. -+ exitcode = !has_feature(optarg);
  6862. -+ } else {
  6863. -+ printf("%s\n", wpa_supplicant_version);
  6864. -+ exitcode = 0;
  6865. -+ }
  6866. - goto out;
  6867. - case 'W':
  6868. - params.wait_for_monitor++;
  6869. ---- /dev/null
  6870. -+++ b/src/utils/build_features.h
  6871. -@@ -0,0 +1,17 @@
  6872. -+#ifndef BUILD_FEATURES_H
  6873. -+#define BUILD_FEATURES_H
  6874. -+
  6875. -+static inline int has_feature(const char *feat)
  6876. -+{
  6877. -+#ifdef IEEE8021X_EAPOL
  6878. -+ if (!strcmp(feat, "eap"))
  6879. -+ return 1;
  6880. -+#endif
  6881. -+#ifdef IEEE80211N
  6882. -+ if (!strcmp(feat, "11n"))
  6883. -+ return 1;
  6884. -+#endif
  6885. -+ return 0;
  6886. -+}
  6887. -+
  6888. -+#endif /* BUILD_FEATURES_H */
  6889. diff --git a/package/hostapd/patches/570-genl_connect_debug.patch b/package/hostapd/patches/570-genl_connect_debug.patch
  6890. deleted file mode 100644
  6891. index 5f14048..0000000
  6892. --- a/package/hostapd/patches/570-genl_connect_debug.patch
  6893. +++ /dev/null
  6894. @@ -1,11 +0,0 @@
  6895. ---- a/src/drivers/driver_nl80211.c
  6896. -+++ b/src/drivers/driver_nl80211.c
  6897. -@@ -127,7 +127,7 @@ static struct nl_handle * nl_create_hand
  6898. - }
  6899. -
  6900. - if (genl_connect(handle)) {
  6901. -- wpa_printf(MSG_ERROR, "nl80211: Failed to connect to generic "
  6902. -+ wpa_printf(MSG_DEBUG, "nl80211: Failed to connect to generic "
  6903. - "netlink (%s)", dbg);
  6904. - nl80211_handle_destroy(handle);
  6905. - return NULL;
  6906. diff --git a/package/hostapd/patches/590-hostapd_cli_ifdef.patch b/package/hostapd/patches/590-hostapd_cli_ifdef.patch
  6907. deleted file mode 100644
  6908. index cbf1e48..0000000
  6909. --- a/package/hostapd/patches/590-hostapd_cli_ifdef.patch
  6910. +++ /dev/null
  6911. @@ -1,50 +0,0 @@
  6912. ---- a/hostapd/hostapd_cli.c
  6913. -+++ b/hostapd/hostapd_cli.c
  6914. -@@ -67,7 +67,6 @@ static const char *commands_help =
  6915. - #ifdef CONFIG_IEEE80211W
  6916. - " sa_query <addr> send SA Query to a station\n"
  6917. - #endif /* CONFIG_IEEE80211W */
  6918. --#ifdef CONFIG_WPS
  6919. - " wps_pin <uuid> <pin> [timeout] [addr] add WPS Enrollee PIN\n"
  6920. - " wps_check_pin <PIN> verify PIN checksum\n"
  6921. - " wps_pbc indicate button pushed to initiate PBC\n"
  6922. -@@ -79,7 +78,6 @@ static const char *commands_help =
  6923. - #endif /* CONFIG_WPS_NFC */
  6924. - " wps_ap_pin <cmd> [params..] enable/disable AP PIN\n"
  6925. - " wps_config <SSID> <auth> <encr> <key> configure AP\n"
  6926. --#endif /* CONFIG_WPS */
  6927. - " get_config show current configuration\n"
  6928. - " help show this usage help\n"
  6929. - " interface [ifname] show interfaces/select interface\n"
  6930. -@@ -340,7 +338,6 @@ static int hostapd_cli_cmd_sa_query(stru
  6931. - #endif /* CONFIG_IEEE80211W */
  6932. -
  6933. -
  6934. --#ifdef CONFIG_WPS
  6935. - static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
  6936. - char *argv[])
  6937. - {
  6938. -@@ -559,7 +556,6 @@ static int hostapd_cli_cmd_wps_config(st
  6939. - ssid_hex, argv[1]);
  6940. - return wpa_ctrl_command(ctrl, buf);
  6941. - }
  6942. --#endif /* CONFIG_WPS */
  6943. -
  6944. -
  6945. - static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
  6946. -@@ -805,7 +801,6 @@ static struct hostapd_cli_cmd hostapd_cl
  6947. - #ifdef CONFIG_IEEE80211W
  6948. - { "sa_query", hostapd_cli_cmd_sa_query },
  6949. - #endif /* CONFIG_IEEE80211W */
  6950. --#ifdef CONFIG_WPS
  6951. - { "wps_pin", hostapd_cli_cmd_wps_pin },
  6952. - { "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
  6953. - { "wps_pbc", hostapd_cli_cmd_wps_pbc },
  6954. -@@ -818,7 +813,6 @@ static struct hostapd_cli_cmd hostapd_cl
  6955. - #endif /* CONFIG_WPS_NFC */
  6956. - { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
  6957. - { "wps_config", hostapd_cli_cmd_wps_config },
  6958. --#endif /* CONFIG_WPS */
  6959. - { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent },
  6960. - { "ess_disassoc", hostapd_cli_cmd_ess_disassoc },
  6961. - { "get_config", hostapd_cli_cmd_get_config },
  6962. diff --git a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  6963. deleted file mode 100644
  6964. index 3345e55..0000000
  6965. --- a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  6966. +++ /dev/null
  6967. @@ -1,209 +0,0 @@
  6968. -From 4bb69d15477e0f2b00e166845341dc933de47c58 Mon Sep 17 00:00:00 2001
  6969. -From: Antonio Quartulli <ordex@autistici.org>
  6970. -Date: Sun, 3 Jun 2012 18:22:56 +0200
  6971. -Subject: [PATCHv2 601/602] wpa_supplicant: add new config params to be used
  6972. - with the ibss join command
  6973. -
  6974. -Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  6975. ----
  6976. - src/drivers/driver.h | 6 +++
  6977. - wpa_supplicant/config.c | 96 +++++++++++++++++++++++++++++++++++++++
  6978. - wpa_supplicant/config_ssid.h | 6 +++
  6979. - wpa_supplicant/wpa_supplicant.c | 23 +++++++---
  6980. - 4 files changed, 124 insertions(+), 7 deletions(-)
  6981. -
  6982. ---- a/src/drivers/driver.h
  6983. -+++ b/src/drivers/driver.h
  6984. -@@ -19,6 +19,7 @@
  6985. -
  6986. - #define WPA_SUPPLICANT_DRIVER_VERSION 4
  6987. -
  6988. -+#include "drivers/nl80211_copy.h"
  6989. - #include "common/defs.h"
  6990. -
  6991. - #define HOSTAPD_CHAN_DISABLED 0x00000001
  6992. -@@ -363,6 +364,11 @@ struct wpa_driver_associate_params {
  6993. - */
  6994. - int freq;
  6995. -
  6996. -+ int beacon_interval;
  6997. -+ int fixed_freq;
  6998. -+ unsigned char rates[NL80211_MAX_SUPP_RATES];
  6999. -+ int mcast_rate;
  7000. -+
  7001. - /**
  7002. - * bg_scan_period - Background scan period in seconds, 0 to disable
  7003. - * background scan, or -1 to indicate no change to default driver
  7004. ---- a/wpa_supplicant/config.c
  7005. -+++ b/wpa_supplicant/config.c
  7006. -@@ -14,6 +14,7 @@
  7007. - #include "rsn_supp/wpa.h"
  7008. - #include "eap_peer/eap.h"
  7009. - #include "p2p/p2p.h"
  7010. -+#include "drivers/nl80211_copy.h"
  7011. - #include "config.h"
  7012. -
  7013. -
  7014. -@@ -1376,6 +1377,97 @@ static char * wpa_config_write_p2p_clien
  7015. -
  7016. - #endif /* CONFIG_P2P */
  7017. -
  7018. -+static int wpa_config_parse_mcast_rate(const struct parse_data *data,
  7019. -+ struct wpa_ssid *ssid, int line,
  7020. -+ const char *value)
  7021. -+{
  7022. -+ ssid->mcast_rate = (int)(strtod(value, NULL) * 10);
  7023. -+
  7024. -+ return 0;
  7025. -+}
  7026. -+
  7027. -+#ifndef NO_CONFIG_WRITE
  7028. -+static char * wpa_config_write_mcast_rate(const struct parse_data *data,
  7029. -+ struct wpa_ssid *ssid)
  7030. -+{
  7031. -+ char *value;
  7032. -+ int res;
  7033. -+
  7034. -+ if (!ssid->mcast_rate == 0)
  7035. -+ return NULL;
  7036. -+
  7037. -+ value = os_malloc(6); /* longest: 300.0 */
  7038. -+ if (value == NULL)
  7039. -+ return NULL;
  7040. -+ res = os_snprintf(value, 5, "%.1f", (double)ssid->mcast_rate / 10);
  7041. -+ if (res < 0) {
  7042. -+ os_free(value);
  7043. -+ return NULL;
  7044. -+ }
  7045. -+ return value;
  7046. -+}
  7047. -+#endif /* NO_CONFIG_WRITE */
  7048. -+
  7049. -+static int wpa_config_parse_rates(const struct parse_data *data,
  7050. -+ struct wpa_ssid *ssid, int line,
  7051. -+ const char *value)
  7052. -+{
  7053. -+ int i;
  7054. -+ char *pos, *r, *sptr, *end;
  7055. -+ double rate;
  7056. -+
  7057. -+ pos = (char *)value;
  7058. -+ r = strtok_r(pos, ",", &sptr);
  7059. -+ i = 0;
  7060. -+ while (pos && i < NL80211_MAX_SUPP_RATES) {
  7061. -+ rate = 0.0;
  7062. -+ if (r)
  7063. -+ rate = strtod(r, &end);
  7064. -+ ssid->rates[i] = rate * 2;
  7065. -+ if (*end != '\0' || rate * 2 != ssid->rates[i])
  7066. -+ return 1;
  7067. -+
  7068. -+ i++;
  7069. -+ r = strtok_r(NULL, ",", &sptr);
  7070. -+ }
  7071. -+
  7072. -+ return 0;
  7073. -+}
  7074. -+
  7075. -+#ifndef NO_CONFIG_WRITE
  7076. -+static char * wpa_config_write_rates(const struct parse_data *data,
  7077. -+ struct wpa_ssid *ssid)
  7078. -+{
  7079. -+ char *value, *pos;
  7080. -+ int res, i;
  7081. -+
  7082. -+ if (ssid->rates[0] <= 0)
  7083. -+ return NULL;
  7084. -+
  7085. -+ value = os_malloc(6 * NL80211_MAX_SUPP_RATES + 1);
  7086. -+ if (value == NULL)
  7087. -+ return NULL;
  7088. -+ pos = value;
  7089. -+ for (i = 0; i < NL80211_MAX_SUPP_RATES - 1; i++) {
  7090. -+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2);
  7091. -+ if (res < 0) {
  7092. -+ os_free(value);
  7093. -+ return NULL;
  7094. -+ }
  7095. -+ pos += res;
  7096. -+ }
  7097. -+ res = os_snprintf(pos, 6, "%.1f",
  7098. -+ (double)ssid->rates[NL80211_MAX_SUPP_RATES - 1] / 2);
  7099. -+ if (res < 0) {
  7100. -+ os_free(value);
  7101. -+ return NULL;
  7102. -+ }
  7103. -+
  7104. -+ value[6 * NL80211_MAX_SUPP_RATES] = '\0';
  7105. -+ return value;
  7106. -+}
  7107. -+#endif /* NO_CONFIG_WRITE */
  7108. -+
  7109. - /* Helper macros for network block parser */
  7110. -
  7111. - #ifdef OFFSET
  7112. -@@ -1574,6 +1666,9 @@ static const struct parse_data ssid_fiel
  7113. - { INT(ap_max_inactivity) },
  7114. - { INT(dtim_period) },
  7115. - { INT(beacon_int) },
  7116. -+ { INT_RANGE(fixed_freq, 0, 1) },
  7117. -+ { FUNC(rates) },
  7118. -+ { FUNC(mcast_rate) },
  7119. - };
  7120. -
  7121. - #undef OFFSET
  7122. ---- a/wpa_supplicant/config_ssid.h
  7123. -+++ b/wpa_supplicant/config_ssid.h
  7124. -@@ -11,6 +11,7 @@
  7125. -
  7126. - #include "common/defs.h"
  7127. - #include "eap_peer/eap_config.h"
  7128. -+#include "drivers/nl80211_copy.h"
  7129. -
  7130. - #define MAX_SSID_LEN 32
  7131. -
  7132. -@@ -600,6 +601,10 @@ struct wpa_ssid {
  7133. - * dereferences since it may not be updated in all cases.
  7134. - */
  7135. - void *parent_cred;
  7136. -+
  7137. -+ int fixed_freq;
  7138. -+ unsigned char rates[NL80211_MAX_SUPP_RATES];
  7139. -+ double mcast_rate;
  7140. - };
  7141. -
  7142. - #endif /* CONFIG_SSID_H */
  7143. ---- a/wpa_supplicant/wpa_supplicant.c
  7144. -+++ b/wpa_supplicant/wpa_supplicant.c
  7145. -@@ -1597,15 +1597,24 @@ void wpa_supplicant_associate(struct wpa
  7146. - params.ssid_len = ssid->ssid_len;
  7147. - }
  7148. -
  7149. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
  7150. -- wpa_s->conf->ap_scan == 2) {
  7151. -- params.bssid = ssid->bssid;
  7152. -- params.fixed_bssid = 1;
  7153. -+ if (ssid->mode == WPAS_MODE_IBSS) {
  7154. -+ if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) {
  7155. -+ params.bssid = ssid->bssid;
  7156. -+ params.fixed_bssid = 1;
  7157. -+ }
  7158. -+ if (ssid->frequency > 0 && params.freq == 0)
  7159. -+ /* Initial channel for IBSS */
  7160. -+ params.freq = ssid->frequency;
  7161. -+ params.fixed_freq = ssid->fixed_freq;
  7162. -+ params.beacon_interval = ssid->beacon_int;
  7163. -+ i = 0;
  7164. -+ while (i < NL80211_MAX_SUPP_RATES) {
  7165. -+ params.rates[i] = ssid->rates[i];
  7166. -+ i++;
  7167. -+ }
  7168. -+ params.mcast_rate = ssid->mcast_rate;
  7169. - }
  7170. -
  7171. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
  7172. -- params.freq == 0)
  7173. -- params.freq = ssid->frequency; /* Initial channel for IBSS */
  7174. - params.wpa_ie = wpa_ie;
  7175. - params.wpa_ie_len = wpa_ie_len;
  7176. - params.pairwise_suite = cipher_pairwise;
  7177. diff --git a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch
  7178. deleted file mode 100644
  7179. index 5a6eb5e..0000000
  7180. --- a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch
  7181. +++ /dev/null
  7182. @@ -1,59 +0,0 @@
  7183. -From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001
  7184. -From: Antonio Quartulli <ordex@autistici.org>
  7185. -Date: Sun, 3 Jun 2012 18:42:25 +0200
  7186. -Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join
  7187. -
  7188. -Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  7189. ----
  7190. - src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++-
  7191. - 1 file changed, 32 insertions(+), 1 deletion(-)
  7192. -
  7193. ---- a/src/drivers/driver_nl80211.c
  7194. -+++ b/src/drivers/driver_nl80211.c
  7195. -@@ -7040,7 +7040,7 @@ static int wpa_driver_nl80211_ibss(struc
  7196. - struct wpa_driver_associate_params *params)
  7197. - {
  7198. - struct nl_msg *msg;
  7199. -- int ret = -1;
  7200. -+ int ret = -1, i;
  7201. - int count = 0;
  7202. -
  7203. - wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
  7204. -@@ -7073,6 +7073,37 @@ retry:
  7205. - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
  7206. - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
  7207. -
  7208. -+ if (params->fixed_freq) {
  7209. -+ wpa_printf(MSG_DEBUG, " * fixed_freq");
  7210. -+ NLA_PUT_FLAG(msg, NL80211_ATTR_FREQ_FIXED);
  7211. -+ }
  7212. -+
  7213. -+ if (params->beacon_interval > 0) {
  7214. -+ wpa_printf(MSG_DEBUG, " * beacon_interval=%d",
  7215. -+ params->beacon_interval);
  7216. -+ NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL,
  7217. -+ params->beacon_interval);
  7218. -+ }
  7219. -+
  7220. -+ if (params->rates[0] > 0) {
  7221. -+ wpa_printf(MSG_DEBUG, " * basic_rates:");
  7222. -+ i = 0;
  7223. -+ while (i < NL80211_MAX_SUPP_RATES &&
  7224. -+ params->rates[i] > 0) {
  7225. -+ wpa_printf(MSG_DEBUG, " %.1f",
  7226. -+ (double)params->rates[i] / 2);
  7227. -+ i++;
  7228. -+ }
  7229. -+ NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, i,
  7230. -+ params->rates);
  7231. -+ }
  7232. -+
  7233. -+ if (params->mcast_rate > 0) {
  7234. -+ wpa_printf(MSG_DEBUG, " * mcast_rates=%.1f",
  7235. -+ (double)params->mcast_rate / 10);
  7236. -+ NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  7237. -+ }
  7238. -+
  7239. - ret = nl80211_set_conn_keys(params, msg);
  7240. - if (ret)
  7241. - goto nla_put_failure;
  7242. diff --git a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch b/package/hostapd/patches/604-wpa_s-support-htmode-param.patch
  7243. deleted file mode 100644
  7244. index 267bde8..0000000
  7245. --- a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch
  7246. +++ /dev/null
  7247. @@ -1,156 +0,0 @@
  7248. -From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001
  7249. -From: Antonio Quartulli <ordex@autistici.org>
  7250. -Date: Tue, 3 Jul 2012 00:36:24 +0200
  7251. -Subject: [PATCH] wpa_s: support htmode param
  7252. -
  7253. -possible values are HT20, HT40-, HT40+ and NOHT
  7254. -
  7255. -Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  7256. ----
  7257. - src/drivers/driver.h | 2 ++
  7258. - src/drivers/driver_nl80211.c | 16 ++++++++++
  7259. - wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++
  7260. - wpa_supplicant/config_ssid.h | 2 ++
  7261. - wpa_supplicant/wpa_supplicant.c | 2 ++
  7262. - 5 files changed, 88 insertions(+)
  7263. -
  7264. ---- a/src/drivers/driver.h
  7265. -+++ b/src/drivers/driver.h
  7266. -@@ -368,6 +368,8 @@ struct wpa_driver_associate_params {
  7267. - int fixed_freq;
  7268. - unsigned char rates[NL80211_MAX_SUPP_RATES];
  7269. - int mcast_rate;
  7270. -+ int ht_set;
  7271. -+ unsigned int htmode;
  7272. -
  7273. - /**
  7274. - * bg_scan_period - Background scan period in seconds, 0 to disable
  7275. ---- a/src/drivers/driver_nl80211.c
  7276. -+++ b/src/drivers/driver_nl80211.c
  7277. -@@ -7104,6 +7104,22 @@ retry:
  7278. - NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  7279. - }
  7280. -
  7281. -+ if (params->ht_set) {
  7282. -+ switch(params->htmode) {
  7283. -+ case NL80211_CHAN_HT20:
  7284. -+ wpa_printf(MSG_DEBUG, " * ht=HT20");
  7285. -+ break;
  7286. -+ case NL80211_CHAN_HT40PLUS:
  7287. -+ wpa_printf(MSG_DEBUG, " * ht=HT40+");
  7288. -+ break;
  7289. -+ case NL80211_CHAN_HT40MINUS:
  7290. -+ wpa_printf(MSG_DEBUG, " * ht=HT40-");
  7291. -+ break;
  7292. -+ }
  7293. -+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
  7294. -+ params->htmode);
  7295. -+ }
  7296. -+
  7297. - ret = nl80211_set_conn_keys(params, msg);
  7298. - if (ret)
  7299. - goto nla_put_failure;
  7300. ---- a/wpa_supplicant/config.c
  7301. -+++ b/wpa_supplicant/config.c
  7302. -@@ -1408,6 +1408,71 @@ static char * wpa_config_write_mcast_rat
  7303. - }
  7304. - #endif /* NO_CONFIG_WRITE */
  7305. -
  7306. -+static int wpa_config_parse_htmode(const struct parse_data *data,
  7307. -+ struct wpa_ssid *ssid, int line,
  7308. -+ const char *value)
  7309. -+{
  7310. -+ int i;
  7311. -+ static const struct {
  7312. -+ const char *name;
  7313. -+ unsigned int val;
  7314. -+ } htmap[] = {
  7315. -+ { .name = "HT20", .val = NL80211_CHAN_HT20, },
  7316. -+ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, },
  7317. -+ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, },
  7318. -+ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, },
  7319. -+ };
  7320. -+ ssid->ht_set = 0;;
  7321. -+ for (i = 0; i < 4; i++) {
  7322. -+ if (strcasecmp(htmap[i].name, value) == 0) {
  7323. -+ ssid->htmode = htmap[i].val;
  7324. -+ ssid->ht_set = 1;
  7325. -+ break;
  7326. -+ }
  7327. -+ }
  7328. -+
  7329. -+ return 0;
  7330. -+}
  7331. -+
  7332. -+#ifndef NO_CONFIG_WRITE
  7333. -+static char * wpa_config_write_htmode(const struct parse_data *data,
  7334. -+ struct wpa_ssid *ssid)
  7335. -+{
  7336. -+ char *value;
  7337. -+ int res;
  7338. -+
  7339. -+ value = os_malloc(6); /* longest: HT40+ */
  7340. -+ if (value == NULL)
  7341. -+ return NULL;
  7342. -+
  7343. -+ switch(ssid->htmode) {
  7344. -+ case NL80211_CHAN_HT20:
  7345. -+ res = os_snprintf(value, 4, "HT20");
  7346. -+ break;
  7347. -+ case NL80211_CHAN_HT40PLUS:
  7348. -+ res = os_snprintf(value, 5, "HT40+");
  7349. -+ break;
  7350. -+ case NL80211_CHAN_HT40MINUS:
  7351. -+ res = os_snprintf(value, 5, "HT40-");
  7352. -+ break;
  7353. -+ case NL80211_CHAN_NO_HT:
  7354. -+ res = os_snprintf(value, 4, "NOHT");
  7355. -+ break;
  7356. -+ default:
  7357. -+ os_free(value);
  7358. -+ return NULL;
  7359. -+ }
  7360. -+
  7361. -+ if (res < 0) {
  7362. -+ os_free(value);
  7363. -+ return NULL;
  7364. -+ }
  7365. -+
  7366. -+ return value;
  7367. -+}
  7368. -+#endif /* NO_CONFIG_WRITE */
  7369. -+
  7370. -+
  7371. - static int wpa_config_parse_rates(const struct parse_data *data,
  7372. - struct wpa_ssid *ssid, int line,
  7373. - const char *value)
  7374. -@@ -1669,6 +1734,7 @@ static const struct parse_data ssid_fiel
  7375. - { INT_RANGE(fixed_freq, 0, 1) },
  7376. - { FUNC(rates) },
  7377. - { FUNC(mcast_rate) },
  7378. -+ { FUNC(htmode) },
  7379. - };
  7380. -
  7381. - #undef OFFSET
  7382. ---- a/wpa_supplicant/config_ssid.h
  7383. -+++ b/wpa_supplicant/config_ssid.h
  7384. -@@ -605,6 +605,8 @@ struct wpa_ssid {
  7385. - int fixed_freq;
  7386. - unsigned char rates[NL80211_MAX_SUPP_RATES];
  7387. - double mcast_rate;
  7388. -+ int ht_set;
  7389. -+ unsigned int htmode;
  7390. - };
  7391. -
  7392. - #endif /* CONFIG_SSID_H */
  7393. ---- a/wpa_supplicant/wpa_supplicant.c
  7394. -+++ b/wpa_supplicant/wpa_supplicant.c
  7395. -@@ -1613,6 +1613,8 @@ void wpa_supplicant_associate(struct wpa
  7396. - i++;
  7397. - }
  7398. - params.mcast_rate = ssid->mcast_rate;
  7399. -+ params.ht_set = ssid->ht_set;
  7400. -+ params.htmode = ssid->htmode;
  7401. - }
  7402. -
  7403. - params.wpa_ie = wpa_ie;
  7404. diff --git a/package/hostapd/patches/610-max_num_sta_probe.patch b/package/hostapd/patches/610-max_num_sta_probe.patch
  7405. deleted file mode 100644
  7406. index 141eb5b..0000000
  7407. --- a/package/hostapd/patches/610-max_num_sta_probe.patch
  7408. +++ /dev/null
  7409. @@ -1,13 +0,0 @@
  7410. ---- a/src/ap/beacon.c
  7411. -+++ b/src/ap/beacon.c
  7412. -@@ -455,6 +455,10 @@ void handle_probe_req(struct hostapd_dat
  7413. - return;
  7414. - }
  7415. -
  7416. -+ if (!sta && hapd->num_sta >= hapd->conf->max_num_sta)
  7417. -+ wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " ignored,"
  7418. -+ " too many connected stations.", MAC2STR(mgmt->sa));
  7419. -+
  7420. - #ifdef CONFIG_INTERWORKING
  7421. - if (elems.interworking && elems.interworking_len >= 1) {
  7422. - u8 ant = elems.interworking[0] & 0x0f;
  7423. diff --git a/package/hostapd/patches/620-scan_wait.patch b/package/hostapd/patches/620-scan_wait.patch
  7424. deleted file mode 100644
  7425. index ac2d445..0000000
  7426. --- a/package/hostapd/patches/620-scan_wait.patch
  7427. +++ /dev/null
  7428. @@ -1,65 +0,0 @@
  7429. ---- a/hostapd/main.c
  7430. -+++ b/hostapd/main.c
  7431. -@@ -33,6 +33,8 @@
  7432. - extern int wpa_debug_level;
  7433. - extern int wpa_debug_show_keys;
  7434. - extern int wpa_debug_timestamp;
  7435. -+static int daemonize = 0;
  7436. -+static char *pid_file = NULL;
  7437. -
  7438. - extern struct wpa_driver_ops *wpa_drivers[];
  7439. -
  7440. -@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
  7441. - }
  7442. - #endif /* CONFIG_NO_HOSTAPD_LOGGER */
  7443. -
  7444. -+static void hostapd_setup_complete_cb(void *ctx)
  7445. -+{
  7446. -+ if (daemonize && os_daemonize(pid_file)) {
  7447. -+ perror("daemon");
  7448. -+ return;
  7449. -+ }
  7450. -+ daemonize = 0;
  7451. -+}
  7452. -
  7453. - /**
  7454. - * hostapd_init - Allocate and initialize per-interface data
  7455. -@@ -190,6 +200,7 @@ static struct hostapd_iface * hostapd_in
  7456. - if (hapd == NULL)
  7457. - goto fail;
  7458. - hapd->msg_ctx = hapd;
  7459. -+ hapd->setup_complete_cb = hostapd_setup_complete_cb;
  7460. - }
  7461. -
  7462. - return hapd_iface;
  7463. -@@ -429,8 +440,6 @@ static void hostapd_global_deinit(const
  7464. - #endif /* CONFIG_NATIVE_WINDOWS */
  7465. -
  7466. - eap_server_unregister_methods();
  7467. --
  7468. -- os_daemonize_terminate(pid_file);
  7469. - }
  7470. -
  7471. -
  7472. -@@ -456,11 +465,6 @@ static int hostapd_global_run(struct hap
  7473. - }
  7474. - #endif /* EAP_SERVER_TNC */
  7475. -
  7476. -- if (daemonize && os_daemonize(pid_file)) {
  7477. -- perror("daemon");
  7478. -- return -1;
  7479. -- }
  7480. --
  7481. - eloop_run();
  7482. -
  7483. - return 0;
  7484. -@@ -564,8 +568,7 @@ int main(int argc, char *argv[])
  7485. - struct hapd_interfaces interfaces;
  7486. - int ret = 1;
  7487. - size_t i;
  7488. -- int c, debug = 0, daemonize = 0;
  7489. -- char *pid_file = NULL;
  7490. -+ int c, debug = 0;
  7491. - const char *log_file = NULL;
  7492. - const char *entropy_file = NULL;
  7493. -
  7494. diff --git a/package/hostapd/patches/630-bool_fix.patch b/package/hostapd/patches/630-bool_fix.patch
  7495. deleted file mode 100644
  7496. index 510b000..0000000
  7497. --- a/package/hostapd/patches/630-bool_fix.patch
  7498. +++ /dev/null
  7499. @@ -1,14 +0,0 @@
  7500. ---- a/src/ap/ieee802_1x.c
  7501. -+++ b/src/ap/ieee802_1x.c
  7502. -@@ -2043,9 +2043,9 @@ void ieee802_1x_notify_pre_auth(struct e
  7503. - }
  7504. -
  7505. -
  7506. --static const char * bool_txt(Boolean bool)
  7507. -+static const char * bool_txt(Boolean bool_val)
  7508. - {
  7509. -- return bool ? "TRUE" : "FALSE";
  7510. -+ return bool_val ? "TRUE" : "FALSE";
  7511. - }
  7512. -
  7513. - #ifdef CONFIG_CTRL_IFACE_MIB
  7514. diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
  7515. deleted file mode 100644
  7516. index e4fa925..0000000
  7517. --- a/package/mac80211/Makefile
  7518. +++ /dev/null
  7519. @@ -1,1630 +0,0 @@
  7520. -#
  7521. -# Copyright (C) 2007-2012 OpenWrt.org
  7522. -#
  7523. -# This is free software, licensed under the GNU General Public License v2.
  7524. -# See /LICENSE for more information.
  7525. -#
  7526. -
  7527. -include $(TOPDIR)/rules.mk
  7528. -include $(INCLUDE_DIR)/kernel.mk
  7529. -
  7530. -PKG_NAME:=mac80211
  7531. -
  7532. -PKG_VERSION:=2013-06-27
  7533. -PKG_RELEASE:=1
  7534. -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
  7535. -PKG_BACKPORT_VERSION:=.1
  7536. -PKG_MD5SUM:=73bd220c64c5c6fdc22b3bb7f180644f
  7537. -
  7538. -PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2
  7539. -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
  7540. -PKG_BUILD_PARALLEL:=1
  7541. -
  7542. -PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  7543. -
  7544. -PKG_DRIVERS = \
  7545. - adm8211 ath5k libertas-usb libertas-sd p54-common p54-pci p54-usb p54-spi \
  7546. - rt2x00-lib rt2x00-pci rt2x00-usb rt2x00-soc rt2800-lib rt2400-pci \
  7547. - rt2500-pci rt2500-usb rt61-pci rt73-usb rt2800-pci rt2800-usb \
  7548. - rtl8180 rtl8187 zd1211rw mac80211-hwsim carl9170 b43 b43legacy \
  7549. - ath9k-common ath9k ath9k-htc ath net-libipw net-ipw2100 net-ipw2200 \
  7550. - mwl8k net-hermes net-hermes-pci net-hermes-plx net-hermes-pcmcia \
  7551. - iwl-legacy iwl3945 iwl4965 iwlagn wl12xx lib80211
  7552. -
  7553. -PKG_CONFIG_DEPENDS:= \
  7554. - CONFIG_PACKAGE_kmod-mac80211 \
  7555. - $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS)) \
  7556. - CONFIG_PACKAGE_MAC80211_DEBUGFS \
  7557. - CONFIG_PACKAGE_MAC80211_MESH \
  7558. - CONFIG_PACKAGE_ATH_DEBUG \
  7559. - CONFIG_PACKAGE_B43_DEBUG \
  7560. - CONFIG_PACKAGE_B43_PIO \
  7561. - CONFIG_PACKAGE_B43_N_PHY \
  7562. - CONFIG_ATH_USER_REGD \
  7563. -
  7564. -CARL9170_FW_VERSION:=1.9.6
  7565. -
  7566. -include $(INCLUDE_DIR)/package.mk
  7567. -
  7568. -WMENU:=Wireless Drivers
  7569. -
  7570. -define KernelPackage/mac80211/Default
  7571. - SUBMENU:=$(WMENU)
  7572. - URL:=http://linuxwireless.org/
  7573. - MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  7574. - DEPENDS:=@(!(TARGET_avr32||TARGET_ps3||TARGET_pxcab)||BROKEN)
  7575. -endef
  7576. -
  7577. -define KernelPackage/cfg80211
  7578. - $(call KernelPackage/mac80211/Default)
  7579. - TITLE:=cfg80211 - wireless configuration API
  7580. - DEPENDS+= +iw
  7581. - FILES:= \
  7582. - $(PKG_BUILD_DIR)/compat/compat.ko \
  7583. - $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
  7584. - AUTOLOAD:=$(call AutoLoad,20,compat cfg80211)
  7585. -endef
  7586. -
  7587. -define KernelPackage/cfg80211/description
  7588. -cfg80211 is the Linux wireless LAN (802.11) configuration API.
  7589. -endef
  7590. -
  7591. -define KernelPackage/mac80211
  7592. - $(call KernelPackage/mac80211/Default)
  7593. - TITLE:=Linux 802.11 Wireless Networking Stack
  7594. - DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211
  7595. - KCONFIG:=\
  7596. - CONFIG_AVERAGE=y
  7597. - FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
  7598. - AUTOLOAD:=$(call AutoLoad,21,mac80211)
  7599. - MENU:=1
  7600. -endef
  7601. -
  7602. -define KernelPackage/mac80211/config
  7603. - if PACKAGE_kmod-mac80211
  7604. -
  7605. - config PACKAGE_MAC80211_DEBUGFS
  7606. - bool "Export mac80211 internals in DebugFS"
  7607. - select KERNEL_DEBUG_FS
  7608. - select KERNEL_RELAY if PACKAGE_kmod-ath9k-common
  7609. - default y
  7610. - help
  7611. - Select this to see extensive information about
  7612. - the internal state of mac80211 in debugfs.
  7613. -
  7614. - config PACKAGE_MAC80211_MESH
  7615. - bool "Enable 802.11s mesh support"
  7616. - default y
  7617. -
  7618. - endif
  7619. -endef
  7620. -
  7621. -define KernelPackage/mac80211/description
  7622. -Generic IEEE 802.11 Networking Stack (mac80211)
  7623. -endef
  7624. -
  7625. -PKG_LINUX_FIRMWARE_NAME:=linux-firmware
  7626. -PKG_LINUX_FIRMWARE_VERSION:=6942dba419d2ebf8c15514972e89734fd7a8cebc
  7627. -PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2
  7628. -PKG_LINUX_FIRMWARE_PROTO:=git
  7629. -PKG_LINUX_FIRMWARE_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
  7630. -PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION)
  7631. -PKG_LINUX_FIRMWARE_MIRROR_MD5SUM:=a5f8c27af9e43f0ad24d7f821c5a781e
  7632. -
  7633. -define Download/linux-firmware
  7634. - FILE:=$(PKG_LINUX_FIRMWARE_SOURCE)
  7635. - URL:=$(PKG_LINUX_FIRMWARE_SOURCE_URL)
  7636. - MD5SUM:=$(PKG_LINUX_FIRMWARE_MD5SUM)
  7637. - PROTO:=$(PKG_LINUX_FIRMWARE_PROTO)
  7638. - VERSION:=$(PKG_LINUX_FIRMWARE_VERSION)
  7639. - SUBDIR:=$(PKG_LINUX_FIRMWARE_SUBDIR)
  7640. - MIRROR_MD5SUM:=$(PKG_LINUX_FIRMWARE_MIRROR_MD5SUM)
  7641. -endef
  7642. -$(eval $(call Download,linux-firmware))
  7643. -
  7644. -# Prism54 drivers
  7645. -P54PCIFW:=2.13.12.0.arm
  7646. -P54USBFW:=2.13.24.0.lm87.arm
  7647. -P54SPIFW:=2.13.0.0.a.13.14.arm
  7648. -CARL9170_FW:=carl9170-1.fw
  7649. -
  7650. -define Download/p54usb
  7651. - FILE:=$(P54USBFW)
  7652. - URL:=http://daemonizer.de/prism54/prism54-fw/fw-usb
  7653. - MD5SUM:=8e8ab005a4f8f0123bcdc51bc25b47f6
  7654. -endef
  7655. -$(eval $(call Download,p54usb))
  7656. -
  7657. -define Download/p54pci
  7658. - FILE:=$(P54PCIFW)
  7659. - URL:=http://daemonizer.de/prism54/prism54-fw/fw-softmac
  7660. - MD5SUM:=ff7536af2092b1c4b21315bd103ef4c4
  7661. -endef
  7662. -$(eval $(call Download,p54pci))
  7663. -
  7664. -define Download/p54spi
  7665. - FILE:=$(P54SPIFW)
  7666. - URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
  7667. - MD5SUM:=42661f8ecbadd88012807493f596081d
  7668. -endef
  7669. -$(eval $(call Download,p54spi))
  7670. -
  7671. -define Download/carl9170
  7672. - FILE:=$(CARL9170_FW)-$(CARL9170_FW_VERSION)
  7673. - URL:=http://downloads.openwrt.org/sources/
  7674. - MD5SUM:=2fa6ed98d53d0b5fbcc136d1cf5e9609
  7675. -endef
  7676. -$(eval $(call Download,carl9170))
  7677. -
  7678. -define KernelPackage/p54/Default
  7679. - $(call KernelPackage/mac80211/Default)
  7680. - TITLE:=Prism54 Drivers
  7681. -endef
  7682. -
  7683. -define KernelPackage/p54/description
  7684. - Kernel module for Prism54 chipsets (mac80211)
  7685. -endef
  7686. -
  7687. -define KernelPackage/p54-common
  7688. - $(call KernelPackage/p54/Default)
  7689. - DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
  7690. - TITLE+= (COMMON)
  7691. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
  7692. - AUTOLOAD:=$(call AutoLoad,30,p54common)
  7693. -endef
  7694. -
  7695. -define KernelPackage/p54-pci
  7696. - $(call KernelPackage/p54/Default)
  7697. - TITLE+= (PCI)
  7698. - DEPENDS+= @PCI_SUPPORT +kmod-p54-common
  7699. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
  7700. - AUTOLOAD:=$(call AutoLoad,31,p54pci)
  7701. -endef
  7702. -
  7703. -define KernelPackage/p54-usb
  7704. - $(call KernelPackage/p54/Default)
  7705. - TITLE+= (USB)
  7706. - DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
  7707. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
  7708. - AUTOLOAD:=$(call AutoLoad,31,p54usb)
  7709. -endef
  7710. -
  7711. -define KernelPackage/p54-spi
  7712. - $(call KernelPackage/p54/Default)
  7713. - TITLE+= (SPI)
  7714. - DEPENDS+= @TARGET_omap24xx +kmod-p54-common
  7715. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
  7716. - AUTOLOAD:=$(call AutoLoad,31,p54spi)
  7717. -endef
  7718. -
  7719. -define KernelPackage/rt2x00/Default
  7720. - $(call KernelPackage/mac80211/Default)
  7721. - TITLE:=Ralink Drivers for RT2x00 cards
  7722. -endef
  7723. -
  7724. -define KernelPackage/rt2x00-lib
  7725. -$(call KernelPackage/rt2x00/Default)
  7726. - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-lib-crc-itu-t
  7727. - TITLE+= (LIB)
  7728. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
  7729. - AUTOLOAD:=$(call AutoLoad,24,rt2x00lib)
  7730. - MENU:=1
  7731. -endef
  7732. -
  7733. -define KernelPackage/rt2x00-lib/config
  7734. - if PACKAGE_kmod-rt2x00-lib
  7735. -
  7736. - config PACKAGE_RT2X00_LIB_DEBUGFS
  7737. - bool "Enable rt2x00 debugfs support"
  7738. - depends on PACKAGE_MAC80211_DEBUGFS
  7739. - help
  7740. - Enable creation of debugfs files for the rt2x00 drivers.
  7741. - These debugfs files support both reading and writing of the
  7742. - most important register types of the rt2x00 hardware.
  7743. -
  7744. - config PACKAGE_RT2X00_DEBUG
  7745. - bool "Enable rt2x00 debug output"
  7746. - help
  7747. - Enable debugging output for all rt2x00 modules
  7748. -
  7749. - endif
  7750. -endef
  7751. -
  7752. -define KernelPackage/rt2x00-mmio
  7753. -$(call KernelPackage/rt2x00/Default)
  7754. - DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
  7755. - TITLE+= (MMIO)
  7756. - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00mmio.ko
  7757. - AUTOLOAD:=$(call AutoLoad,25,rt2x00mmio)
  7758. -endef
  7759. -
  7760. -define KernelPackage/rt2x00-pci
  7761. -$(call KernelPackage/rt2x00/Default)
  7762. - DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-mmio +kmod-rt2x00-lib
  7763. - TITLE+= (PCI)
  7764. - FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
  7765. - AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
  7766. -endef
  7767. -
  7768. -define KernelPackage/rt2x00-usb
  7769. -$(call KernelPackage/rt2x00/Default)
  7770. - DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
  7771. - TITLE+= (USB)
  7772. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
  7773. - AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
  7774. -endef
  7775. -
  7776. -define KernelPackage/rt2x00-soc
  7777. -$(call KernelPackage/rt2x00/Default)
  7778. - DEPENDS+= @TARGET_ramips @!TARGET_ramips_mt7620a @!TARGET_ramips_rt3883 +kmod-rt2x00-mmio +kmod-rt2x00-lib
  7779. - TITLE+= (SoC)
  7780. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko
  7781. - AUTOLOAD:=$(call AutoLoad,26,rt2x00soc)
  7782. -endef
  7783. -
  7784. -define KernelPackage/rt2800-lib
  7785. -$(call KernelPackage/rt2x00/Default)
  7786. - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +TARGET_ramips:kmod-rt2x00-soc +@DRIVER_11N_SUPPORT
  7787. - TITLE+= (rt2800 LIB)
  7788. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
  7789. - AUTOLOAD:=$(call AutoLoad,27,rt2800lib)
  7790. -endef
  7791. -
  7792. -define KernelPackage/rt2400-pci
  7793. -$(call KernelPackage/rt2x00/Default)
  7794. - DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
  7795. - TITLE+= (RT2400 PCI)
  7796. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
  7797. - AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
  7798. -endef
  7799. -
  7800. -define KernelPackage/rt2500-pci
  7801. -$(call KernelPackage/rt2x00/Default)
  7802. - DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
  7803. - TITLE+= (RT2500 PCI)
  7804. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
  7805. - AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
  7806. -endef
  7807. -
  7808. -define KernelPackage/rt2500-usb
  7809. -$(call KernelPackage/rt2x00/Default)
  7810. - DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
  7811. - TITLE+= (RT2500 USB)
  7812. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
  7813. - AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
  7814. -endef
  7815. -
  7816. -define KernelPackage/rt61-pci
  7817. -$(call KernelPackage/rt2x00/Default)
  7818. - DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
  7819. - TITLE+= (RT2x61 PCI)
  7820. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
  7821. - AUTOLOAD:=$(call AutoLoad,27,rt61pci)
  7822. -endef
  7823. -
  7824. -define KernelPackage/rt73-usb
  7825. - $(call KernelPackage/rt2x00/Default)
  7826. - DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
  7827. - TITLE+= (RT73 USB)
  7828. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
  7829. - AUTOLOAD:=$(call AutoLoad,27,rt73usb)
  7830. -endef
  7831. -
  7832. -define KernelPackage/rt2800-pci
  7833. -$(call KernelPackage/rt2x00/Default)
  7834. - DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +PCI_SUPPORT:kmod-rt2x00-pci +kmod-rt2800-lib +kmod-lib-crc-ccitt +TARGET_ramips:kmod-rt2x00-soc
  7835. - TITLE+= (RT2860 PCI)
  7836. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
  7837. - AUTOLOAD:=$(call AutoLoad,28,rt2800pci)
  7838. -endef
  7839. -
  7840. -define KernelPackage/rt2800-usb
  7841. -$(call KernelPackage/rt2x00/Default)
  7842. - DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-lib-crc-ccitt
  7843. - TITLE+= (RT2870 USB)
  7844. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
  7845. - AUTOLOAD:=$(call AutoLoad,28,rt2800usb)
  7846. -endef
  7847. -
  7848. -define KernelPackage/rtl818x/Default
  7849. - $(call KernelPackage/mac80211/Default)
  7850. - TITLE:=Realtek Drivers for RTL818x devices
  7851. - URL:=http://wireless.kernel.org/en/users/Drivers/rtl8187
  7852. - DEPENDS+= +kmod-eeprom-93cx6 +kmod-mac80211
  7853. -endef
  7854. -
  7855. -define KernelPackage/rtl8180
  7856. - $(call KernelPackage/rtl818x/Default)
  7857. - DEPENDS+= @PCI_SUPPORT
  7858. - TITLE+= (RTL8180 PCI)
  7859. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180/rtl8180.ko
  7860. - AUTOLOAD:=$(call AutoLoad,27,rtl8180)
  7861. -endef
  7862. -
  7863. -define KernelPackage/rtl8187
  7864. -$(call KernelPackage/rtl818x/Default)
  7865. - DEPENDS+= @USB_SUPPORT +kmod-usb-core
  7866. - TITLE+= (RTL8187 USB)
  7867. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
  7868. - AUTOLOAD:=$(call AutoLoad,27,rtl8187)
  7869. -endef
  7870. -
  7871. -ZD1211FW_NAME:=zd1211-firmware
  7872. -ZD1211FW_VERSION:=1.4
  7873. -define Download/zd1211rw
  7874. - FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
  7875. - URL:=@SF/zd1211/
  7876. - MD5SUM:=19f28781d76569af8551c9d11294c870
  7877. -endef
  7878. -$(eval $(call Download,zd1211rw))
  7879. -
  7880. -define KernelPackage/zd1211rw
  7881. - $(call KernelPackage/mac80211/Default)
  7882. - TITLE:=Zydas ZD1211 support
  7883. - DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
  7884. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
  7885. - AUTOLOAD:=$(call AutoLoad,60,zd1211rw)
  7886. -endef
  7887. -
  7888. -define KernelPackage/adm8211
  7889. - $(call KernelPackage/mac80211/Default)
  7890. - TITLE:=ADMTek 8211 support
  7891. - DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
  7892. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/adm8211.ko
  7893. - AUTOLOAD:=$(call AutoLoad,60,adm8211)
  7894. -endef
  7895. -
  7896. -define KernelPackage/ath/config
  7897. - if PACKAGE_kmod-ath
  7898. - config ATH_USER_REGD
  7899. - bool "Force Atheros drivers to respect the user's regdomain settings"
  7900. - help
  7901. - Atheros' idea of regulatory handling is that the EEPROM of the card defines
  7902. - the regulatory limits and the user is only allowed to restrict the settings
  7903. - even further, even if the country allows frequencies or power levels that
  7904. - are forbidden by the EEPROM settings.
  7905. -
  7906. - Select this option if you want the driver to respect the user's decision about
  7907. - regulatory settings.
  7908. -
  7909. - config PACKAGE_ATH_DEBUG
  7910. - bool "Atheros wireless debugging"
  7911. - help
  7912. - Say Y, if you want to debug atheros wireless drivers.
  7913. - Right now only ath9k makes use of this.
  7914. - endif
  7915. -endef
  7916. -
  7917. -define KernelPackage/ath
  7918. - $(call KernelPackage/mac80211/Default)
  7919. - TITLE:=Atheros common driver part
  7920. - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_atheros +kmod-mac80211
  7921. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
  7922. - AUTOLOAD:=$(call AutoLoad,26,ath)
  7923. - MENU:=1
  7924. -endef
  7925. -
  7926. -define KernelPackage/ath/description
  7927. - This module contains some common parts needed by Atheros Wireless drivers.
  7928. -endef
  7929. -
  7930. -define KernelPackage/ath5k
  7931. - $(call KernelPackage/mac80211/Default)
  7932. - TITLE:=Atheros 5xxx wireless cards support
  7933. - URL:=http://linuxwireless.org/en/users/Drivers/ath5k
  7934. - DEPENDS+= @PCI_SUPPORT||@TARGET_atheros +kmod-ath
  7935. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
  7936. - AUTOLOAD:=$(call AutoLoad,27,ath5k)
  7937. -endef
  7938. -
  7939. -define KernelPackage/ath5k/description
  7940. - This module adds support for wireless adapters based on
  7941. - Atheros 5xxx chipset.
  7942. -endef
  7943. -
  7944. -define KernelPackage/ath9k-common
  7945. - $(call KernelPackage/mac80211/Default)
  7946. - TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
  7947. - URL:=http://linuxwireless.org/en/users/Drivers/ath9k
  7948. - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT
  7949. - FILES:= \
  7950. - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
  7951. - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
  7952. - AUTOLOAD:=$(call AutoLoad,27,ath9k_hw ath9k_common)
  7953. -endef
  7954. -
  7955. -define KernelPackage/ath9k
  7956. - $(call KernelPackage/mac80211/Default)
  7957. - TITLE:=Atheros 802.11n PCI wireless cards support
  7958. - URL:=http://linuxwireless.org/en/users/Drivers/ath9k
  7959. - DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx +kmod-ath9k-common
  7960. - FILES:= \
  7961. - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
  7962. - AUTOLOAD:=$(call AutoLoad,28,ath9k)
  7963. -endef
  7964. -
  7965. -define KernelPackage/ath9k/description
  7966. -This module adds support for wireless adapters based on
  7967. -Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
  7968. -endef
  7969. -
  7970. -define KernelPackage/ath9k-htc
  7971. - $(call KernelPackage/mac80211/Default)
  7972. - TITLE:=Atheros 802.11n USB device support
  7973. - URL:=http://linuxwireless.org/en/users/Drivers/ath9k
  7974. - DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core
  7975. - FILES:= \
  7976. - $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
  7977. - AUTOLOAD:=$(call AutoLoad,55,ath9k_htc)
  7978. -endef
  7979. -
  7980. -define KernelPackage/ath9k-htc/description
  7981. -This module adds support for wireless adapters based on
  7982. -Atheros USB AR9271 and AR7010 family of chipsets.
  7983. -endef
  7984. -
  7985. -define KernelPackage/carl9170
  7986. - $(call KernelPackage/mac80211/Default)
  7987. - TITLE:=Driver for Atheros AR9170 USB sticks
  7988. - DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT
  7989. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
  7990. - AUTOLOAD:=$(call AutoLoad,60,carl9170)
  7991. -endef
  7992. -
  7993. -define KernelPackage/carl9170/install
  7994. - $(INSTALL_DIR) $(1)/lib/firmware
  7995. - $(INSTALL_DATA) $(DL_DIR)/$(CARL9170_FW)-$(CARL9170_FW_VERSION) $(1)/lib/firmware/$(CARL9170_FW)
  7996. -endef
  7997. -
  7998. -define KernelPackage/lib80211
  7999. - $(call KernelPackage/mac80211/Default)
  8000. - TITLE:=802.11 Networking stack
  8001. - FILES:= \
  8002. - $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
  8003. - $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
  8004. - $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
  8005. - $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
  8006. - AUTOLOAD:=$(call AutoLoad,21, \
  8007. - lib80211 \
  8008. - lib80211_crypt_wep \
  8009. - lib80211_crypt_ccmp \
  8010. - lib80211_crypt_tkip \
  8011. - )
  8012. -endef
  8013. -
  8014. -define KernelPackage/lib80211/description
  8015. - Kernel modules for 802.11 Networking stack
  8016. - Includes:
  8017. - - lib80211
  8018. - - lib80211_crypt_wep
  8019. - - lib80211_crypt_tkip
  8020. - - lib80211_crytp_ccmp
  8021. -endef
  8022. -
  8023. -define KernelPackage/libertas-usb
  8024. - $(call KernelPackage/mac80211/Default)
  8025. - DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT
  8026. - TITLE:=Marvell 88W8015 Wireless Driver
  8027. - FILES:= \
  8028. - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
  8029. - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
  8030. - AUTOLOAD:=$(call AutoLoad,27,libertas usb8xxx)
  8031. -endef
  8032. -
  8033. -define KernelPackage/libertas-sd
  8034. - $(call KernelPackage/mac80211/Default)
  8035. - DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT
  8036. - TITLE:=Marvell 88W8686 Wireless Driver
  8037. - FILES:= \
  8038. - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
  8039. - $(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
  8040. - AUTOLOAD:=$(call AutoLoad,91,libertas libertas_sdio)
  8041. -endef
  8042. -
  8043. -define KernelPackage/mac80211-hwsim
  8044. - $(call KernelPackage/mac80211/Default)
  8045. - TITLE:=mac80211 HW simulation device
  8046. - DEPENDS+= +kmod-mac80211
  8047. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
  8048. - AUTOLOAD:=$(call AutoLoad,60,mac80211_hwsim)
  8049. -endef
  8050. -
  8051. -define KernelPackage/net-libipw
  8052. - $(call KernelPackage/mac80211/Default)
  8053. - TITLE:=libipw for ipw2100 and ipw2200
  8054. - DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT
  8055. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/libipw.ko
  8056. - AUTOLOAD:=$(call AutoLoad,49,libipw)
  8057. -endef
  8058. -
  8059. -define KernelPackage/net-libipw/description
  8060. - Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200.
  8061. -endef
  8062. -
  8063. -IPW2100_NAME:=ipw2100-fw
  8064. -IPW2100_VERSION:=1.3
  8065. -
  8066. -define Download/net-ipw2100
  8067. - URL:=http://bughost.org/firmware/
  8068. - FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
  8069. - MD5SUM=46aa75bcda1a00efa841f9707bbbd113
  8070. -endef
  8071. -$(eval $(call Download,net-ipw2100))
  8072. -
  8073. -define KernelPackage/net-ipw2100
  8074. - $(call KernelPackage/mac80211/Default)
  8075. - TITLE:=Intel IPW2100 driver
  8076. - DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
  8077. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko
  8078. - AUTOLOAD:=$(call AutoLoad,50,ipw2100)
  8079. -endef
  8080. -
  8081. -define KernelPackage/net-ipw2100/description
  8082. - Kernel support for Intel IPW2100
  8083. - Includes:
  8084. - - ipw2100
  8085. -endef
  8086. -
  8087. -IPW2200_NAME:=ipw2200-fw
  8088. -IPW2200_VERSION:=3.1
  8089. -
  8090. -define Download/net-ipw2200
  8091. - URL:=http://bughost.org/firmware/
  8092. - FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
  8093. - MD5SUM=eaba788643c7cc7483dd67ace70f6e99
  8094. -endef
  8095. -$(eval $(call Download,net-ipw2200))
  8096. -
  8097. -define KernelPackage/net-ipw2200
  8098. - $(call KernelPackage/mac80211/Default)
  8099. - TITLE:=Intel IPW2200 driver
  8100. - DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
  8101. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko
  8102. - AUTOLOAD:=$(call AutoLoad,50,ipw2200)
  8103. -endef
  8104. -
  8105. -define KernelPackage/net-ipw2200/description
  8106. - Kernel support for Intel IPW2200
  8107. - Includes:
  8108. - - ipw2200
  8109. -endef
  8110. -
  8111. -
  8112. -define KernelPackage/net-hermes
  8113. - $(call KernelPackage/mac80211/Default)
  8114. - TITLE:=Hermes 802.11b chipset support
  8115. - DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT
  8116. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco.ko
  8117. - AUTOLOAD:=$(call AutoLoad,50,orinoco)
  8118. -endef
  8119. -
  8120. -define KernelPackage/net-hermes/description
  8121. - Kernel support for Hermes 802.11b chipsets
  8122. -endef
  8123. -
  8124. -define KernelPackage/net-hermes-pci
  8125. - $(call KernelPackage/mac80211/Default)
  8126. - TITLE:=Intersil Prism 2.5 PCI support
  8127. - DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
  8128. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_pci.ko
  8129. - AUTOLOAD:=$(call AutoLoad,55,orinoco_pci)
  8130. -endef
  8131. -
  8132. -define KernelPackage/net-hermes-pci/description
  8133. - Kernel modules for Intersil Prism 2.5 PCI support
  8134. -endef
  8135. -
  8136. -define KernelPackage/net-hermes-plx
  8137. - $(call KernelPackage/mac80211/Default)
  8138. - TITLE:=PLX9052 based PCI adaptor
  8139. - DEPENDS:=@PCI_SUPPORT +kmod-net-hermes
  8140. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_plx.ko
  8141. - AUTOLOAD:=$(call AutoLoad,55,orinoco_plx)
  8142. -endef
  8143. -
  8144. -define KernelPackage/net-hermes-plx/description
  8145. - Kernel modules for Hermes in PLX9052 based PCI adaptors
  8146. -endef
  8147. -
  8148. -define KernelPackage/net-hermes-pcmcia
  8149. - $(call KernelPackage/mac80211/Default)
  8150. - TITLE:=Hermes based PCMCIA adaptors
  8151. - DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes @BROKEN
  8152. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/orinoco/orinoco_cs.ko
  8153. - AUTOLOAD:=$(call AutoLoad,55,orinoco_cs)
  8154. -endef
  8155. -
  8156. -define KernelPackage/net-hermes-pcmcia/description
  8157. - Kernel modules for Hermes based PCMCIA adaptors
  8158. -endef
  8159. -
  8160. -define KernelPackage/iwlagn
  8161. - $(call KernelPackage/mac80211/Default)
  8162. - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT
  8163. - TITLE:=Intel AGN Wireless support
  8164. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlwifi/iwlwifi.ko
  8165. - AUTOLOAD:=$(call AutoLoad,60,iwlwifi)
  8166. - MENU:=1
  8167. -endef
  8168. -
  8169. -define KernelPackage/iwlagn/description
  8170. - iwlagn kernel module for Intel 5000/5150/1000/6000/6050/6005/6030/100 support
  8171. -endef
  8172. -
  8173. -define KernelPackage/iwlagn/config
  8174. - if PACKAGE_kmod-iwlagn
  8175. -
  8176. - config IWL5000_FW
  8177. - bool "Intel 5000 Firmware"
  8178. - default y
  8179. - help
  8180. - Download and install firmware for:
  8181. - Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
  8182. -
  8183. - config IWL5150_FW
  8184. - bool "Intel 5150 Firmware"
  8185. - default y
  8186. - help
  8187. - Download and install firmware for:
  8188. - Intel Wireless WiFi 5150AGN
  8189. -
  8190. - config IWL1000_FW
  8191. - bool "Intel 1000 Firmware"
  8192. - default y
  8193. - help
  8194. - Download and install firmware for:
  8195. - Intel Centrino Wireless-N 1000
  8196. -
  8197. - config IWL6000_FW
  8198. - bool "Intel 6000 Firmware"
  8199. - default y
  8200. - help
  8201. - Download and install firmware for:
  8202. - Intel Centrino Ultimate-N 6300 and Advanced-N 6200
  8203. -
  8204. - config IWL6050_FW
  8205. - bool "Intel 6050 Firmware"
  8206. - default y
  8207. - help
  8208. - Download and install firmware for:
  8209. - Intel Centrino Advanced-N + WiMAX 6250 and Wireless-N + WiMAX 6150
  8210. -
  8211. - config IWL6005_FW
  8212. - bool "Intel 6005 Firmware"
  8213. - default y
  8214. - help
  8215. - Download and install firmware for:
  8216. - Intel Centrino Advanced-N 6205
  8217. -
  8218. - config IWL6030_FW
  8219. - bool "Intel 6030 Firmware"
  8220. - default y
  8221. - help
  8222. - Download and install firmware for:
  8223. - Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235
  8224. -
  8225. - config IWL100_FW
  8226. - bool "Intel 100 Firmware"
  8227. - default y
  8228. - help
  8229. - Download and install firmware for:
  8230. - Intel Centrino Wireless-N 100
  8231. -
  8232. - config IWL2000_FW
  8233. - bool "Intel 2000 Firmware"
  8234. - default y
  8235. - help
  8236. - Download and install firmware for:
  8237. - Intel Centrino Wireless-N 2200
  8238. -
  8239. - config IWL2030_FW
  8240. - bool "Intel 2030 Firmware"
  8241. - default y
  8242. - help
  8243. - Download and install firmware for:
  8244. - Intel Centrino Wireless-N 2230
  8245. -
  8246. - config IWL105_FW
  8247. - bool "Intel 105 Firmware"
  8248. - default y
  8249. - help
  8250. - Download and install firmware for:
  8251. - Intel Centrino Wireless-N 105
  8252. -
  8253. - config IWL135_FW
  8254. - bool "Intel 135 Firmware"
  8255. - default y
  8256. - help
  8257. - Download and install firmware for:
  8258. - Intel Centrino Wireless-N 135
  8259. - endif
  8260. -endef
  8261. -
  8262. -define KernelPackage/iwl-legacy
  8263. - $(call KernelPackage/mac80211/Default)
  8264. - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT
  8265. - TITLE:=Intel legacy Wireless support
  8266. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwlegacy.ko
  8267. - AUTOLOAD:=$(call AutoLoad,60,iwlegacy)
  8268. -endef
  8269. -
  8270. -define KernelPackage/iwl-legacy/description
  8271. - iwl-legacy kernel module for legacy Intel wireless support
  8272. -endef
  8273. -
  8274. -define KernelPackage/iwl3945
  8275. - $(call KernelPackage/mac80211/Default)
  8276. - DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy
  8277. - TITLE:=Intel iwl3945 Wireless support
  8278. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl3945.ko
  8279. - AUTOLOAD:=$(call AutoLoad,61,iwl3945)
  8280. -endef
  8281. -
  8282. -define KernelPackage/iwl3945/description
  8283. - iwl3945 kernel module for Intel 3945 support
  8284. -endef
  8285. -
  8286. -define KernelPackage/iwl4965
  8287. - $(call KernelPackage/mac80211/Default)
  8288. - DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +@DRIVER_11N_SUPPORT
  8289. - TITLE:=Intel iwl4965 Wireless support
  8290. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/iwlegacy/iwl4965.ko
  8291. - AUTOLOAD:=$(call AutoLoad,61,iwl4965)
  8292. -endef
  8293. -
  8294. -define KernelPackage/iwl4965/description
  8295. - iwl4965 kernel module for Intel 4965 support
  8296. -endef
  8297. -
  8298. -
  8299. -define KernelPackage/mwl8k
  8300. - $(call KernelPackage/mac80211/Default)
  8301. - TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
  8302. - URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k
  8303. - DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT
  8304. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.ko
  8305. - AUTOLOAD:=$(call AutoLoad,27,mwl8k)
  8306. -endef
  8307. -
  8308. -define KernelPackage/mwl8k/description
  8309. - Kernel modules for Marvell TOPDOG 802.11 Wireless cards
  8310. -endef
  8311. -
  8312. -
  8313. -define KernelPackage/wl12xx
  8314. - $(call KernelPackage/mac80211/Default)
  8315. - TITLE:=Driver for TI WL12xx
  8316. - URL:=http://wireless.kernel.org/en/users/Drivers/wl12xx
  8317. - DEPENDS+= @TARGET_omap4 +kmod-mac80211
  8318. - FILES:= \
  8319. - $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko \
  8320. - $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
  8321. - $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
  8322. - AUTOLOAD:=$(call AutoLoad,61,wlcore wlcore_sdio wl12xx)
  8323. -endef
  8324. -
  8325. -define KernelPackage/wl12xx/description
  8326. - Kernel modules for TI WL12xx
  8327. -endef
  8328. -
  8329. -#Broadcom firmware
  8330. -ifneq ($(CONFIG_B43_FW_5_10),)
  8331. - PKG_B43_FWV4_NAME:=broadcom-wl
  8332. - PKG_B43_FWV4_VERSION:=5.10.56.27.3
  8333. - PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
  8334. - PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
  8335. - PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
  8336. - PKG_B43_FWV4_MD5SUM:=3363e3a6b3d9d73c49dea870c7834eac
  8337. -else
  8338. -ifneq ($(CONFIG_B43_FW_4_178),)
  8339. - PKG_B43_FWV4_NAME:=broadcom-wl
  8340. - PKG_B43_FWV4_VERSION:=4.178.10.4
  8341. - PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
  8342. - PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
  8343. - PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
  8344. - PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
  8345. -else
  8346. -ifneq ($(CONFIG_B43_FW_5_100_138),)
  8347. - PKG_B43_FWV4_NAME:=broadcom-wl
  8348. - PKG_B43_FWV4_VERSION:=5.100.138
  8349. - PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
  8350. - PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
  8351. - PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
  8352. - PKG_B43_FWV4_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
  8353. -else
  8354. - PKG_B43_FWV4_NAME:=broadcom-wl
  8355. - PKG_B43_FWV4_VERSION:=4.150.10.5
  8356. - PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
  8357. - PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
  8358. - PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
  8359. - PKG_B43_FWV4_MD5SUM:=0c6ba9687114c6b598e8019e262d9a60
  8360. -endif
  8361. -endif
  8362. -endif
  8363. -ifneq ($(CONFIG_B43_OPENFIRMWARE),)
  8364. - PKG_B43_FWV4_NAME:=broadcom-wl
  8365. - PKG_B43_FWV4_VERSION:=5.2
  8366. - PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
  8367. - PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
  8368. - PKG_B43_FWV4_SOURCE_URL:=http://www.ing.unibs.it/openfwwf/firmware/
  8369. - PKG_B43_FWV4_MD5SUM:=e045a135453274e439ae183f8498b0fa
  8370. -endif
  8371. -
  8372. -
  8373. -PKG_B43_FWV3_NAME:=wl_apsta
  8374. -PKG_B43_FWV3_VERSION:=3.130.20.0
  8375. -PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
  8376. -PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
  8377. -PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
  8378. -
  8379. -define Download/b43
  8380. - FILE:=$(PKG_B43_FWV4_SOURCE)
  8381. - URL:=$(PKG_B43_FWV4_SOURCE_URL)
  8382. - MD5SUM:=$(PKG_B43_FWV4_MD5SUM)
  8383. -endef
  8384. -$(eval $(call Download,b43))
  8385. -
  8386. -define Download/b43legacy
  8387. - FILE:=$(PKG_B43_FWV3_SOURCE)
  8388. - URL:=$(PKG_B43_FWV3_SOURCE_URL)
  8389. - MD5SUM:=$(PKG_B43_FWV3_MD5SUM)
  8390. -endef
  8391. -$(eval $(call Download,b43legacy))
  8392. -
  8393. -
  8394. -define KernelPackage/b43
  8395. - $(call KernelPackage/mac80211/Default)
  8396. - TITLE:=Broadcom 43xx wireless support
  8397. - URL:=http://linuxwireless.org/en/users/Drivers/b43
  8398. - KCONFIG:= \
  8399. - CONFIG_HW_RANDOM=y
  8400. - DEPENDS+= +kmod-mac80211 +!TARGET_brcm47xx:kmod-bcma +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
  8401. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
  8402. - AUTOLOAD:=$(call AutoLoad,30,b43)
  8403. - MENU:=1
  8404. -endef
  8405. -
  8406. -define KernelPackage/b43/config
  8407. - if PACKAGE_kmod-b43
  8408. -
  8409. - choice
  8410. - prompt "b43 firmware version"
  8411. - default B43_FW_5_100_138
  8412. - help
  8413. - This option allows you to select the version of the b43 firmware.
  8414. -
  8415. - config B43_FW_4_150
  8416. - bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
  8417. - help
  8418. - Stable firmware for BCM43xx devices.
  8419. -
  8420. - If unsure, select this.
  8421. -
  8422. - config B43_FW_4_178
  8423. - bool "Firmware 478.104 from driver 4.178.10.4"
  8424. - help
  8425. - Experimental firmware for BCM43xx devices.
  8426. -
  8427. - This firmware is not tested as much as the "stable" firmware.
  8428. -
  8429. - If unsure, select the "stable" firmware.
  8430. -
  8431. - config B43_FW_5_10
  8432. - bool "Firmware 508.1084 from driver 5.10.56.27"
  8433. - help
  8434. - Newer experimental firmware for BCM43xx devices.
  8435. -
  8436. - This firmware is mostly untested. It is needed for some N-PHY devices.
  8437. -
  8438. - If unsure, select the "stable" firmware.
  8439. -
  8440. - config B43_FW_5_100_138
  8441. - bool "Firmware 666.2 from driver 5.100.138 (stable)"
  8442. - help
  8443. - Newer experimental firmware for BCM43xx devices.
  8444. -
  8445. - This firmware is mostly untested. It is needed for some N-PHY devices.
  8446. -
  8447. - If unsure, select the "stable" firmware.
  8448. -
  8449. - config B43_OPENFIRMWARE
  8450. - bool "Open FirmWare for WiFi networks"
  8451. - help
  8452. - Opensource firmware for BCM43xx devices.
  8453. -
  8454. - Do _not_ select this, unless you know what you are doing.
  8455. - The Opensource firmware is not suitable for embedded devices, yet.
  8456. - It does not support QoS, which is bad for AccessPoints.
  8457. - It does not support hardware crypto acceleration, which is a showstopper
  8458. - for embedded devices with low CPU resources.
  8459. -
  8460. - If unsure, select the "stable" firmware.
  8461. -
  8462. - endchoice
  8463. -
  8464. - config B43_FW_SQUASH
  8465. - bool "Remove unnecessary firmware files"
  8466. - depends on !B43_OPENFIRMWARE
  8467. - default y
  8468. - help
  8469. - This options allows you to remove unnecessary b43 firmware files
  8470. - from the final rootfs image. This can reduce the rootfs size by
  8471. - up to 200k.
  8472. -
  8473. - If unsure, say Y.
  8474. -
  8475. - config B43_FW_SQUASH_COREREVS
  8476. - string "Core revisions to include"
  8477. - depends on B43_FW_SQUASH
  8478. - default "5,6,7,8,9,10,11,13,15,16,29"
  8479. - help
  8480. - This is a comma seperated list of core revision numbers.
  8481. -
  8482. - Example (keep files for rev5 only):
  8483. - 5
  8484. -
  8485. - Example (keep files for rev5 and rev11):
  8486. - 5,11
  8487. -
  8488. - config B43_FW_SQUASH_PHYTYPES
  8489. - string "PHY types to include"
  8490. - depends on B43_FW_SQUASH
  8491. - default "G,LP,N,HT"
  8492. - help
  8493. - This is a comma seperated list of PHY types:
  8494. - A => A-PHY
  8495. - AG => Dual A-PHY G-PHY
  8496. - G => G-PHY
  8497. - LP => LP-PHY
  8498. - N => N-PHY
  8499. - HT => HT-PHY
  8500. - LCN => LCN-PHY
  8501. -
  8502. - Example (keep files for G-PHY only):
  8503. - G
  8504. -
  8505. - Example (keep files for G-PHY and N-PHY):
  8506. - G,N
  8507. -
  8508. - config PACKAGE_B43_DEBUG
  8509. - bool "Enable debug output and debugfs for b43"
  8510. - default n
  8511. - help
  8512. - Enable additional debug output and runtime sanity checks for b43
  8513. - and enables the debugfs interface.
  8514. -
  8515. - If unsure, say N.
  8516. -
  8517. - config PACKAGE_B43_PIO
  8518. - bool "Enable support for PIO transfer mode"
  8519. - default n
  8520. - help
  8521. - Enable support for using PIO instead of DMA. Unless you have DMA
  8522. - transfer problems you don't need this.
  8523. -
  8524. - If unsure, say N.
  8525. -
  8526. - config PACKAGE_B43_PHY_N
  8527. - bool "Enable support for N-PHYs"
  8528. - default y
  8529. - help
  8530. - Enable support for N-PHY. This includes support for the following devices:
  8531. - PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
  8532. - SoC: BCM4716, BCM4717, BCM4718
  8533. -
  8534. - Currently only 11g speed is available.
  8535. -
  8536. - If unsure, say Y.
  8537. -
  8538. - config PACKAGE_B43_PHY_HT
  8539. - bool "Enable support for HT-PHYs"
  8540. - default y
  8541. - help
  8542. - Enable support for HT-PHY. This includes support for the following devices:
  8543. - PCI: BCM4331
  8544. -
  8545. - Currently only 11g speed is available.
  8546. -
  8547. - If unsure, say Y.
  8548. -
  8549. - config PACKAGE_B43_PHY_LCN
  8550. - bool "Enable support for LCN-PHYs"
  8551. - depends on BROKEN
  8552. - default n
  8553. - help
  8554. - Currently broken.
  8555. -
  8556. - If unsure, say N.
  8557. -
  8558. - endif
  8559. -endef
  8560. -
  8561. -define KernelPackage/b43/description
  8562. -Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
  8563. -endef
  8564. -
  8565. -define KernelPackage/b43legacy
  8566. - $(call KernelPackage/mac80211/Default)
  8567. - TITLE:=Broadcom 43xx-legacy wireless support
  8568. - URL:=http://linuxwireless.org/en/users/Drivers/b43
  8569. - KCONFIG:= \
  8570. - CONFIG_HW_RANDOM=y
  8571. - DEPENDS+= +kmod-mac80211 +!(TARGET_brcm47xx||TARGET_brcm63xx):kmod-ssb
  8572. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
  8573. - AUTOLOAD:=$(call AutoLoad,30,b43legacy)
  8574. - MENU:=1
  8575. -endef
  8576. -
  8577. -define KernelPackage/b43legacy/config
  8578. - if PACKAGE_kmod-b43legacy
  8579. -
  8580. - config B43LEGACY_FW_SQUASH
  8581. - bool "Remove unnecessary firmware files"
  8582. - default y
  8583. - help
  8584. - This options allows you to remove unnecessary b43legacy firmware files
  8585. - from the final rootfs image. This can reduce the rootfs size by
  8586. - up to 50k.
  8587. -
  8588. - If unsure, say Y.
  8589. -
  8590. - config B43LEGACY_FW_SQUASH_COREREVS
  8591. - string "Core revisions to include"
  8592. - depends on B43LEGACY_FW_SQUASH
  8593. - default "1,2,3,4"
  8594. - help
  8595. - This is a comma seperated list of core revision numbers.
  8596. -
  8597. - Example (keep files for rev4 only):
  8598. - 4
  8599. -
  8600. - Example (keep files for rev2 and rev4):
  8601. - 2,4
  8602. -
  8603. - endif
  8604. -endef
  8605. -
  8606. -define KernelPackage/b43legacy/description
  8607. -Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
  8608. -endef
  8609. -
  8610. -
  8611. -define KernelPackage/brcmutil
  8612. - $(call KernelPackage/mac80211/Default)
  8613. - TITLE:=Broadcom IEEE802.11n common driver parts
  8614. - URL:=http://linuxwireless.org/en/users/Drivers/brcm80211
  8615. - DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
  8616. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
  8617. - AUTOLOAD:=$(call AutoLoad,30,brcmutil)
  8618. - MENU:=1
  8619. -endef
  8620. -
  8621. -define KernelPackage/brcmutil/description
  8622. - This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
  8623. -endef
  8624. -
  8625. -define KernelPackage/brcmutil/config
  8626. - if PACKAGE_kmod-brcmutil
  8627. -
  8628. - config PACKAGE_BRCM80211_DEBUG
  8629. - bool "Broadcom wireless driver debugging"
  8630. - help
  8631. - Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
  8632. -
  8633. - endif
  8634. -endef
  8635. -
  8636. -PKG_BRCMSMAC_FW_NAME:=broadcom-wl
  8637. -PKG_BRCMSMAC_FW_VERSION:=5.100.138
  8638. -PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
  8639. -PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
  8640. -PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
  8641. -PKG_BRCMSMAC_FW_MD5SUM:=f4e357b09eaf5d8b1f1920cf3493a555
  8642. -
  8643. -define Download/brcmsmac
  8644. - FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
  8645. - URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
  8646. - MD5SUM:=$(PKG_BRCMSMAC_FW_MD5SUM)
  8647. -endef
  8648. -$(eval $(call Download,brcmsmac))
  8649. -
  8650. -define KernelPackage/brcmsmac
  8651. - $(call KernelPackage/mac80211/Default)
  8652. - TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
  8653. - URL:=http://linuxwireless.org/en/users/Drivers/brcm80211
  8654. - DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil
  8655. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko
  8656. - AUTOLOAD:=$(call AutoLoad,31,brcmsmac)
  8657. - MENU:=1
  8658. -endef
  8659. -
  8660. -define KernelPackage/brcmsmac/description
  8661. - Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
  8662. -endef
  8663. -
  8664. -define KernelPackage/brcmsmac/config
  8665. - if PACKAGE_kmod-brcmsmac
  8666. -
  8667. - config BRCMSMAC_USE_FW_FROM_WL
  8668. - bool "Use firmware extracted from broadcom proprietary driver"
  8669. - default y
  8670. - help
  8671. - Instead of using the official brcmsmac firmware a firmware
  8672. - version 666.2 extracted from the proprietary Broadcom driver
  8673. - is used. This is needed to get core rev 17 used in bcm4716
  8674. - to work.
  8675. -
  8676. - If unsure, say Y.
  8677. -
  8678. - endif
  8679. -endef
  8680. -
  8681. -
  8682. -define KernelPackage/brcmfmac
  8683. - $(call KernelPackage/mac80211/Default)
  8684. - TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
  8685. - URL:=http://linuxwireless.org/en/users/Drivers/brcm80211
  8686. - DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-cfg80211 +@DRIVER_11N_SUPPORT +kmod-brcmutil
  8687. - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
  8688. - AUTOLOAD:=$(call AutoLoad,60,brcmfmac)
  8689. -endef
  8690. -
  8691. -define KernelPackage/brcmfmac/description
  8692. - Kernel module for Broadcom IEEE802.11n USB Wireless cards
  8693. -endef
  8694. -
  8695. -config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
  8696. -
  8697. -config-y:= \
  8698. - WLAN \
  8699. - NL80211_TESTMODE \
  8700. - CFG80211_WEXT \
  8701. - CFG80211_INTERNAL_REGDB \
  8702. - MAC80211_RC_MINSTREL \
  8703. - MAC80211_RC_MINSTREL_HT \
  8704. - MAC80211_RC_DEFAULT_MINSTREL \
  8705. -
  8706. -config-$(call config_package,cfg80211) += CFG80211
  8707. -
  8708. -config-$(call config_package,mac80211) += MAC80211
  8709. -config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
  8710. -ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
  8711. - config-y += \
  8712. - CFG80211_DEBUGFS \
  8713. - MAC80211_DEBUGFS \
  8714. - ATH9K_DEBUGFS \
  8715. - ATH9K_HTC_DEBUGFS \
  8716. - CARL9170_DEBUGFS \
  8717. - ATH5K_DEBUG
  8718. -endif
  8719. -
  8720. -config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
  8721. -
  8722. -config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
  8723. -config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG
  8724. -
  8725. -config-$(call config_package,ath9k) += ATH9K
  8726. -config-$(call config_package,ath9k-common) += ATH9K_COMMON
  8727. -config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB
  8728. -config-$(CONFIG_PCI) += ATH9K_PCI
  8729. -config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
  8730. -
  8731. -config-$(call config_package,ath9k-htc) += ATH9K_HTC
  8732. -
  8733. -config-$(call config_package,ath5k) += ATH5K
  8734. -ifdef CONFIG_TARGET_atheros
  8735. - config-y += ATH5K_AHB
  8736. -else
  8737. - config-y += ATH5K_PCI
  8738. -endif
  8739. -
  8740. -config-$(call config_package,carl9170) += CARL9170
  8741. -
  8742. -config-$(call config_package,b43) += B43
  8743. -config-y += B43_SSB B43_BCMA B43_PHY_LP
  8744. -config-$(CONFIG_PACKAGE_B43_PHY_N) += B43_PHY_N
  8745. -config-$(CONFIG_PACKAGE_B43_PHY_HT) += B43_PHY_HT
  8746. -config-$(CONFIG_PACKAGE_B43_PIO) += B43_PIO
  8747. -config-$(CONFIG_PACKAGE_B43_DEBUG) += B43_DEBUG
  8748. -
  8749. -config-$(call config_package,b43legacy) += B43LEGACY
  8750. -config-y += B43LEGACY_DMA_MODE
  8751. -
  8752. -config-$(call config_package,brcmutil) += BRCMUTIL
  8753. -config-$(call config_package,brcmsmac) += BRCMSMAC
  8754. -config-$(call config_package,brcmfmac) += BRCMFMAC BRCMFMAC_USB
  8755. -config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
  8756. -
  8757. -config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
  8758. -
  8759. -config-$(call config_package,rt2x00-lib) += RT2X00 RT2X00_LIB
  8760. -config-$(call config_package,rt2x00-pci) += RT2X00_LIB_PCI
  8761. -config-$(call config_package,rt2x00-mmio) += RT2X00_LIB_MMIO
  8762. -config-$(call config_package,rt2x00-usb) += RT2X00_LIB_USB
  8763. -config-$(call config_package,rt2x00-soc) += RT2X00_LIB_SOC
  8764. -config-$(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS) += RT2X00_LIB_DEBUGFS
  8765. -config-$(CONFIG_PACKAGE_RT2X00_DEBUG) += RT2X00_DEBUG
  8766. -
  8767. -config-$(call config_package,rt2400-pci) += RT2400PCI
  8768. -config-$(call config_package,rt2500-pci) += RT2500PCI
  8769. -config-$(call config_package,rt2500-usb) += RT2500USB
  8770. -config-$(call config_package,rt61-pci) += RT61PCI
  8771. -config-$(call config_package,rt73-usb) += RT73USB
  8772. -
  8773. -config-$(call config_package,rt2800-lib) += RT2800_LIB
  8774. -config-y += RT2800PCI_RT33XX RT2800PCI_RT35XX RT2800PCI_RT53XX RT2800PCI_RT3290
  8775. -
  8776. -config-$(call config_package,rt2800-pci) += RT2800PCI
  8777. -config-$(call config_package,rt2800-usb) += RT2800USB
  8778. -
  8779. -config-$(call config_package,iwl-legacy) += IWLEGACY
  8780. -config-$(call config_package,iwl3945) += IWL3945
  8781. -config-$(call config_package,iwl4965) += IWL4965
  8782. -config-$(call config_package,iwlagn) += IWLWIFI
  8783. -
  8784. -config-$(call config_package,net-libipw) += LIBIPW
  8785. -config-$(call config_package,net-ipw2100) += IPW2100
  8786. -config-$(call config_package,net-ipw2200) += IPW2200
  8787. -
  8788. -config-$(call config_package,p54-common) += P54_COMMON
  8789. -config-$(call config_package,p54-pci) += P54_PCI
  8790. -config-$(call config_package,p54-usb) += P54_USB
  8791. -config-$(call config_package,p54-spi) += P54_SPI
  8792. -
  8793. -config-$(call config_package,net-hermes) += HERMES
  8794. -config-$(call config_package,net-hermes-pci) += PCI_HERMES
  8795. -config-$(call config_package,net-hermes-plx) += PLX_HERMES
  8796. -config-$(call config_package,net-hermes-pcmcia) += PCMCIA_HERMES
  8797. -config-y += HERMES_PRISM
  8798. -
  8799. -config-$(call config_package,adm8211) += ADM8211
  8800. -config-$(call config_package,libertas-sd) += LIBERTAS LIBERTAS_SDIO
  8801. -config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
  8802. -config-$(call config_package,mwl8k) += MWL8K
  8803. -config-$(call config_package,rtl8180) += RTL8180
  8804. -config-$(call config_package,rtl8187) += RTL8187
  8805. -config-$(call config_package,wl12xx) += WL_TI WLCORE WLCORE_SDIO WL12XX
  8806. -config-$(call config_package,zd1211rw) += ZD1211RW
  8807. -
  8808. -config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS B43_LEDS B43LEGACY_LEDS
  8809. -
  8810. -MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
  8811. - CROSS_COMPILE="$(KERNEL_CROSS)" \
  8812. - ARCH="$(LINUX_KARCH)" \
  8813. - EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include" \
  8814. - KLIB_BUILD="$(LINUX_DIR)" \
  8815. - MODPROBE=true \
  8816. - KLIB=$(TARGET_MODULES_DIR) \
  8817. - KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
  8818. - KBUILD_LDFLAGS_MODULE_PREREQ=
  8819. -
  8820. -define ConfigVars
  8821. -$(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
  8822. -))
  8823. -endef
  8824. -
  8825. -define mac80211_config
  8826. -$(call ConfigVars,m)$(call ConfigVars,y)
  8827. -endef
  8828. -$(eval $(call shexport,mac80211_config))
  8829. -
  8830. -define Build/Prepare
  8831. - rm -rf $(PKG_BUILD_DIR)
  8832. - mkdir -p $(PKG_BUILD_DIR)
  8833. - $(PKG_UNPACK)
  8834. - $(Build/Patch)
  8835. - $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
  8836. - $(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
  8837. - $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
  8838. - $(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE)
  8839. - rm -rf \
  8840. - $(PKG_BUILD_DIR)/include/linux/ssb \
  8841. - $(PKG_BUILD_DIR)/include/linux/bcma \
  8842. - $(PKG_BUILD_DIR)/include/net/bluetooth
  8843. -
  8844. - rm -f \
  8845. - $(PKG_BUILD_DIR)/include/linux/cordic.h \
  8846. - $(PKG_BUILD_DIR)/include/linux/crc8.h \
  8847. - $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
  8848. - $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
  8849. - $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
  8850. - $(PKG_BUILD_DIR)/include/net/ieee80211.h
  8851. -
  8852. - echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
  8853. - $(CP) ./files/regdb.txt $(PKG_BUILD_DIR)/net/wireless/db.txt
  8854. -endef
  8855. -
  8856. -ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
  8857. - define Build/Compile/kmod
  8858. - rm -rf $(PKG_BUILD_DIR)/modules
  8859. - +$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
  8860. - endef
  8861. -endif
  8862. -
  8863. -define Build/Configure
  8864. - cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
  8865. - cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
  8866. - cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
  8867. -endef
  8868. -
  8869. -define Build/Compile
  8870. - $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
  8871. - $(MAKE) $(MAKE_OPTS) allnoconfig
  8872. - $(call Build/Compile/kmod)
  8873. -endef
  8874. -
  8875. -define Build/InstallDev
  8876. - mkdir -p \
  8877. - $(1)/usr/include/mac80211 \
  8878. - $(1)/usr/include/mac80211-backport \
  8879. - $(1)/usr/include/mac80211/ath \
  8880. - $(1)/usr/include/net/mac80211
  8881. - $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
  8882. - $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
  8883. - $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
  8884. - $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
  8885. -endef
  8886. -
  8887. -define KernelPackage/libertas-usb/install
  8888. - $(INSTALL_DIR) $(1)/lib/firmware/libertas
  8889. - $(INSTALL_DATA) \
  8890. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8388_v9.bin \
  8891. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/usb8682.bin \
  8892. - $(1)/lib/firmware/libertas/
  8893. -endef
  8894. -
  8895. -define KernelPackage/libertas-sd/install
  8896. - $(INSTALL_DIR) $(1)/lib/firmware/libertas
  8897. - $(INSTALL_DATA) \
  8898. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385_helper.bin \
  8899. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8385.bin \
  8900. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9_helper.bin \
  8901. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8686_v9.bin \
  8902. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688_helper.bin \
  8903. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/libertas/sd8688.bin \
  8904. - $(1)/lib/firmware/libertas
  8905. -endef
  8906. -
  8907. -define KernelPackage/cfg80211/install
  8908. - $(INSTALL_DIR) $(1)/lib/wifi
  8909. - $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
  8910. -endef
  8911. -
  8912. -define KernelPackage/p54-pci/install
  8913. - $(INSTALL_DIR) $(1)/lib/firmware
  8914. - $(INSTALL_DATA) $(DL_DIR)/$(P54PCIFW) $(1)/lib/firmware/isl3886pci
  8915. -endef
  8916. -
  8917. -define KernelPackage/p54-usb/install
  8918. - $(INSTALL_DIR) $(1)/lib/firmware
  8919. - $(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
  8920. -endef
  8921. -
  8922. -define KernelPackage/p54-spi/install
  8923. - $(INSTALL_DIR) $(1)/lib/firmware
  8924. - $(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
  8925. -endef
  8926. -
  8927. -define KernelPackage/rt61-pci/install
  8928. - $(INSTALL_DIR) $(1)/lib/firmware
  8929. - $(INSTALL_DATA) \
  8930. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561.bin \
  8931. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2561s.bin \
  8932. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2661.bin \
  8933. - $(1)/lib/firmware/
  8934. -endef
  8935. -
  8936. -define KernelPackage/rt73-usb/install
  8937. - $(INSTALL_DIR) $(1)/lib/firmware
  8938. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt73.bin $(1)/lib/firmware/
  8939. -endef
  8940. -
  8941. -define KernelPackage/rt2800-pci/install
  8942. - $(INSTALL_DIR) $(1)/lib/firmware
  8943. - $(INSTALL_DATA) \
  8944. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2860.bin \
  8945. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt3290.bin \
  8946. - $(1)/lib/firmware
  8947. -endef
  8948. -
  8949. -define KernelPackage/rt2800-usb/install
  8950. - $(INSTALL_DIR) $(1)/lib/firmware
  8951. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/rt2870.bin $(1)/lib/firmware/
  8952. -endef
  8953. -
  8954. -define KernelPackage/wl12xx/install
  8955. - $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
  8956. - $(INSTALL_DATA) \
  8957. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-mr.bin \
  8958. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-plt.bin \
  8959. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl127x-fw-5-sr.bin \
  8960. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl1271-nvs.bin \
  8961. - $(1)/lib/firmware/ti-connectivity
  8962. -endef
  8963. -
  8964. -
  8965. -define KernelPackage/zd1211rw/install
  8966. - $(INSTALL_DIR) $(1)/lib/firmware/zd1211
  8967. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
  8968. -endef
  8969. -
  8970. -define KernelPackage/ath9k-htc/install
  8971. - $(INSTALL_DIR) $(1)/lib/firmware
  8972. - $(INSTALL_DATA) \
  8973. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_9271.fw \
  8974. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/htc_7010.fw \
  8975. - $(1)/lib/firmware/
  8976. -endef
  8977. -
  8978. -define KernelPackage/mwl8k/install
  8979. - $(INSTALL_DIR) $(1)/lib/firmware/mwl8k
  8980. - $(INSTALL_DATA) \
  8981. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366_ap-3.fw \
  8982. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8366.fw \
  8983. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8366.fw \
  8984. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/fmimage_8687.fw \
  8985. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/mwl8k/helper_8687.fw \
  8986. - $(1)/lib/firmware/mwl8k/
  8987. -endef
  8988. -
  8989. -define KernelPackage/net-ipw2100/install
  8990. - $(INSTALL_DIR) $(1)/lib/firmware
  8991. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware
  8992. -endef
  8993. -
  8994. -define KernelPackage/net-ipw2200/install
  8995. - $(INSTALL_DIR) $(1)/lib/firmware
  8996. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
  8997. -endef
  8998. -
  8999. -define KernelPackage/iwlagn/install
  9000. - $(INSTALL_DIR) $(1)/lib/firmware
  9001. -ifneq ($(CONFIG_IWL5000_FW),)
  9002. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware
  9003. -endif
  9004. -ifneq ($(CONFIG_IWL5150_FW),)
  9005. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware
  9006. -endif
  9007. -ifneq ($(CONFIG_IWL1000_FW),)
  9008. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
  9009. -endif
  9010. -ifneq ($(CONFIG_IWL6000_FW),)
  9011. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware
  9012. -endif
  9013. -ifneq ($(CONFIG_IWL6050_FW),)
  9014. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
  9015. -endif
  9016. -ifneq ($(CONFIG_IWL6005_FW),)
  9017. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware
  9018. -endif
  9019. -ifneq ($(CONFIG_IWL6030_FW),)
  9020. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware
  9021. -endif
  9022. -ifneq ($(CONFIG_IWL100_FW),)
  9023. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
  9024. -endif
  9025. -ifneq ($(CONFIG_IWL2000_FW),)
  9026. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
  9027. -endif
  9028. -ifneq ($(CONFIG_IWL2030_FW),)
  9029. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
  9030. -endif
  9031. -ifneq ($(CONFIG_IWL105_FW),)
  9032. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
  9033. -endif
  9034. -ifneq ($(CONFIG_IWL135_FW),)
  9035. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
  9036. -endif
  9037. -endef
  9038. -
  9039. -define KernelPackage/iwl3945/install
  9040. - $(INSTALL_DIR) $(1)/lib/firmware
  9041. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware
  9042. -endef
  9043. -
  9044. -define KernelPackage/iwl4965/install
  9045. - $(INSTALL_DIR) $(1)/lib/firmware
  9046. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware
  9047. -endef
  9048. -
  9049. -define KernelPackage/b43/install
  9050. - rm -rf $(1)/lib/firmware/
  9051. -ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
  9052. - tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
  9053. -else
  9054. - tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
  9055. -endif
  9056. - $(INSTALL_DIR) $(1)/lib/firmware/
  9057. -ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
  9058. - $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
  9059. - $(INSTALL_DIR) $(1)/lib/firmware/b43-open/
  9060. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
  9061. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
  9062. - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
  9063. -else
  9064. - b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
  9065. -endif
  9066. -ifneq ($(CONFIG_B43_FW_SQUASH),)
  9067. - b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
  9068. -endif
  9069. -endef
  9070. -
  9071. -define KernelPackage/b43legacy/install
  9072. - $(INSTALL_DIR) $(1)/lib/firmware/
  9073. - b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(DL_DIR)/$(PKG_B43_FWV3_SOURCE)
  9074. -ifneq ($(CONFIG_B43LEGACY_FW_SQUASH),)
  9075. - b43-fwsquash.py "G" "$(CONFIG_B43LEGACY_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43legacy"
  9076. -endif
  9077. -endef
  9078. -
  9079. -define KernelPackage/brcmsmac/install
  9080. - $(INSTALL_DIR) $(1)/lib/firmware/brcm
  9081. -ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
  9082. - tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
  9083. - b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
  9084. -else
  9085. - $(INSTALL_DATA) \
  9086. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
  9087. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
  9088. - $(1)/lib/firmware/brcm/
  9089. -endif
  9090. -endef
  9091. -
  9092. -define KernelPackage/brcmfmac/install
  9093. - $(INSTALL_DIR) $(1)/lib/firmware/brcm
  9094. - $(INSTALL_DATA) \
  9095. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/brcmfmac43236b.bin \
  9096. - $(1)/lib/firmware/brcm/
  9097. -endef
  9098. -
  9099. -$(eval $(call KernelPackage,adm8211))
  9100. -$(eval $(call KernelPackage,ath5k))
  9101. -$(eval $(call KernelPackage,lib80211))
  9102. -$(eval $(call KernelPackage,libertas-usb))
  9103. -$(eval $(call KernelPackage,libertas-sd))
  9104. -$(eval $(call KernelPackage,cfg80211))
  9105. -$(eval $(call KernelPackage,mac80211))
  9106. -$(eval $(call KernelPackage,p54-common))
  9107. -$(eval $(call KernelPackage,p54-pci))
  9108. -$(eval $(call KernelPackage,p54-usb))
  9109. -$(eval $(call KernelPackage,p54-spi))
  9110. -$(eval $(call KernelPackage,rt2x00-lib))
  9111. -$(eval $(call KernelPackage,rt2x00-mmio))
  9112. -$(eval $(call KernelPackage,rt2x00-pci))
  9113. -$(eval $(call KernelPackage,rt2x00-usb))
  9114. -$(eval $(call KernelPackage,rt2x00-soc))
  9115. -$(eval $(call KernelPackage,rt2800-lib))
  9116. -$(eval $(call KernelPackage,rt2400-pci))
  9117. -$(eval $(call KernelPackage,rt2500-pci))
  9118. -$(eval $(call KernelPackage,rt2500-usb))
  9119. -$(eval $(call KernelPackage,rt61-pci))
  9120. -$(eval $(call KernelPackage,rt73-usb))
  9121. -$(eval $(call KernelPackage,rt2800-pci))
  9122. -$(eval $(call KernelPackage,rt2800-usb))
  9123. -$(eval $(call KernelPackage,rtl8180))
  9124. -$(eval $(call KernelPackage,rtl8187))
  9125. -$(eval $(call KernelPackage,zd1211rw))
  9126. -$(eval $(call KernelPackage,mac80211-hwsim))
  9127. -$(eval $(call KernelPackage,ath9k-common))
  9128. -$(eval $(call KernelPackage,ath9k))
  9129. -$(eval $(call KernelPackage,ath9k-htc))
  9130. -$(eval $(call KernelPackage,ath))
  9131. -$(eval $(call KernelPackage,carl9170))
  9132. -$(eval $(call KernelPackage,b43))
  9133. -$(eval $(call KernelPackage,b43legacy))
  9134. -$(eval $(call KernelPackage,brcmutil))
  9135. -$(eval $(call KernelPackage,brcmsmac))
  9136. -$(eval $(call KernelPackage,brcmfmac))
  9137. -$(eval $(call KernelPackage,net-libipw))
  9138. -$(eval $(call KernelPackage,net-ipw2100))
  9139. -$(eval $(call KernelPackage,net-ipw2200))
  9140. -$(eval $(call KernelPackage,iwlagn))
  9141. -$(eval $(call KernelPackage,iwl-legacy))
  9142. -$(eval $(call KernelPackage,iwl4965))
  9143. -$(eval $(call KernelPackage,iwl3945))
  9144. -$(eval $(call KernelPackage,mwl8k))
  9145. -$(eval $(call KernelPackage,net-hermes))
  9146. -$(eval $(call KernelPackage,net-hermes-pci))
  9147. -$(eval $(call KernelPackage,net-hermes-plx))
  9148. -$(eval $(call KernelPackage,net-hermes-pcmcia))
  9149. -$(eval $(call KernelPackage,wl12xx))
  9150. diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
  9151. deleted file mode 100644
  9152. index 20f6bfa..0000000
  9153. --- a/package/mac80211/files/lib/wifi/mac80211.sh
  9154. +++ /dev/null
  9155. @@ -1,641 +0,0 @@
  9156. -#!/bin/sh
  9157. -append DRIVERS "mac80211"
  9158. -
  9159. -mac80211_hostapd_setup_base() {
  9160. - local phy="$1"
  9161. - local ifname="$2"
  9162. -
  9163. - cfgfile="/var/run/hostapd-$phy.conf"
  9164. -
  9165. - config_get device "$vif" device
  9166. - config_get country "$device" country
  9167. - config_get hwmode "$device" hwmode
  9168. - config_get channel "$device" channel
  9169. - config_get beacon_int "$device" beacon_int
  9170. - config_get basic_rate_list "$device" basic_rate
  9171. - config_get_bool noscan "$device" noscan
  9172. -
  9173. - hostapd_set_log_options base_cfg "$device"
  9174. -
  9175. - [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
  9176. -
  9177. - [ "$channel" = auto ] && {
  9178. - channel=$(iw phy "$phy" info | \
  9179. - sed -ne '/MHz/ { /disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }')
  9180. - config_set "$device" channel "$channel"
  9181. - }
  9182. -
  9183. - [ -n "$hwmode" ] && {
  9184. - config_get hwmode_11n "$device" hwmode_11n
  9185. - [ -n "$hwmode_11n" ] && {
  9186. - hwmode="$hwmode_11n"
  9187. - append base_cfg "ieee80211n=1" "$N"
  9188. - config_get htmode "$device" htmode
  9189. - config_get ht_capab_list "$device" ht_capab
  9190. - case "$htmode" in
  9191. - HT20|HT40+|HT40-) ht_capab="[$htmode]";;
  9192. - *)ht_capab=;;
  9193. - esac
  9194. - for cap in $ht_capab_list; do
  9195. - ht_capab="$ht_capab[$cap]"
  9196. - done
  9197. - [ -n "$ht_capab" ] && append base_cfg "ht_capab=$ht_capab" "$N"
  9198. - }
  9199. - }
  9200. -
  9201. - local country_ie=0
  9202. - [ -n "$country" ] && country_ie=1
  9203. - config_get_bool country_ie "$device" country_ie "$country_ie"
  9204. - [ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
  9205. -
  9206. - local br brval brstr
  9207. - [ -n "$basic_rate_list" ] && {
  9208. - for br in $basic_rate_list; do
  9209. - brval="$(($br / 100))"
  9210. - [ -n "$brstr" ] && brstr="$brstr "
  9211. - brstr="$brstr$brval"
  9212. - done
  9213. - }
  9214. -
  9215. - cat >> "$cfgfile" <<EOF
  9216. -ctrl_interface=/var/run/hostapd-$phy
  9217. -driver=nl80211
  9218. -wmm_ac_bk_cwmin=4
  9219. -wmm_ac_bk_cwmax=10
  9220. -wmm_ac_bk_aifs=7
  9221. -wmm_ac_bk_txop_limit=0
  9222. -wmm_ac_bk_acm=0
  9223. -wmm_ac_be_aifs=3
  9224. -wmm_ac_be_cwmin=4
  9225. -wmm_ac_be_cwmax=10
  9226. -wmm_ac_be_txop_limit=0
  9227. -wmm_ac_be_acm=0
  9228. -wmm_ac_vi_aifs=2
  9229. -wmm_ac_vi_cwmin=3
  9230. -wmm_ac_vi_cwmax=4
  9231. -wmm_ac_vi_txop_limit=94
  9232. -wmm_ac_vi_acm=0
  9233. -wmm_ac_vo_aifs=2
  9234. -wmm_ac_vo_cwmin=2
  9235. -wmm_ac_vo_cwmax=3
  9236. -wmm_ac_vo_txop_limit=47
  9237. -wmm_ac_vo_acm=0
  9238. -tx_queue_data3_aifs=7
  9239. -tx_queue_data3_cwmin=15
  9240. -tx_queue_data3_cwmax=1023
  9241. -tx_queue_data3_burst=0
  9242. -tx_queue_data2_aifs=3
  9243. -tx_queue_data2_cwmin=15
  9244. -tx_queue_data2_cwmax=63
  9245. -tx_queue_data2_burst=0
  9246. -tx_queue_data1_aifs=1
  9247. -tx_queue_data1_cwmin=7
  9248. -tx_queue_data1_cwmax=15
  9249. -tx_queue_data1_burst=3.0
  9250. -tx_queue_data0_aifs=1
  9251. -tx_queue_data0_cwmin=3
  9252. -tx_queue_data0_cwmax=7
  9253. -tx_queue_data0_burst=1.5
  9254. -${hwmode:+hw_mode=$hwmode}
  9255. -${channel:+channel=$channel}
  9256. -${beacon_int:+beacon_int=$beacon_int}
  9257. -${country:+country_code=$country}
  9258. -${noscan:+noscan=$noscan}
  9259. -${brstr:+basic_rates=$brstr}
  9260. -$base_cfg
  9261. -
  9262. -EOF
  9263. -}
  9264. -
  9265. -mac80211_hostapd_setup_bss() {
  9266. - local phy="$1"
  9267. - local vif="$2"
  9268. -
  9269. - hostapd_cfg=
  9270. - cfgfile="/var/run/hostapd-$phy.conf"
  9271. - config_get ifname "$vif" ifname
  9272. -
  9273. - if [ -f "$cfgfile" ]; then
  9274. - append hostapd_cfg "bss=$ifname" "$N"
  9275. - else
  9276. - mac80211_hostapd_setup_base "$phy" "$ifname"
  9277. - append hostapd_cfg "interface=$ifname" "$N"
  9278. - fi
  9279. -
  9280. - local net_cfg bridge
  9281. - net_cfg="$(find_net_config "$vif")"
  9282. - [ -z "$net_cfg" ] || bridge="$(bridge_interface "$net_cfg")"
  9283. - config_set "$vif" bridge "$bridge"
  9284. -
  9285. - hostapd_set_bss_options hostapd_cfg "$vif"
  9286. -
  9287. - config_get_bool wds "$vif" wds 0
  9288. - [ "$wds" -gt 0 ] && append hostapd_cfg "wds_sta=1" "$N"
  9289. -
  9290. - local macaddr hidden maxassoc wmm
  9291. - config_get macaddr "$vif" macaddr
  9292. - config_get maxassoc "$vif" maxassoc
  9293. - config_get dtim_period "$vif" dtim_period
  9294. - config_get max_listen_int "$vif" max_listen_int
  9295. - config_get_bool hidden "$vif" hidden 0
  9296. - config_get_bool wmm "$vif" wmm 1
  9297. - cat >> /var/run/hostapd-$phy.conf <<EOF
  9298. -$hostapd_cfg
  9299. -wmm_enabled=$wmm
  9300. -bssid=$macaddr
  9301. -ignore_broadcast_ssid=$hidden
  9302. -${dtim_period:+dtim_period=$dtim_period}
  9303. -${max_listen_int:+max_listen_interval=$max_listen_int}
  9304. -${maxassoc:+max_num_sta=$maxassoc}
  9305. -EOF
  9306. -}
  9307. -
  9308. -mac80211_start_vif() {
  9309. - local vif="$1"
  9310. - local ifname="$2"
  9311. -
  9312. - local net_cfg
  9313. - net_cfg="$(find_net_config "$vif")"
  9314. - [ -z "$net_cfg" ] || start_net "$ifname" "$net_cfg"
  9315. -
  9316. - set_wifi_up "$vif" "$ifname"
  9317. -}
  9318. -
  9319. -lookup_phy() {
  9320. - [ -n "$phy" ] && {
  9321. - [ -d /sys/class/ieee80211/$phy ] && return
  9322. - }
  9323. -
  9324. - local devpath
  9325. - config_get devpath "$device" path
  9326. - [ -n "$devpath" -a -d "/sys/devices/$devpath/ieee80211" ] && {
  9327. - phy="$(ls /sys/devices/$devpath/ieee80211 | grep -m 1 phy)"
  9328. - [ -n "$phy" ] && return
  9329. - }
  9330. -
  9331. - local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
  9332. - [ -n "$macaddr" ] && {
  9333. - for _phy in $(ls /sys/class/ieee80211 2>/dev/null); do
  9334. - [ "$macaddr" = "$(cat /sys/class/ieee80211/${_phy}/macaddress)" ] || continue
  9335. - phy="$_phy"
  9336. - return
  9337. - done
  9338. - }
  9339. - phy=
  9340. - return
  9341. -}
  9342. -
  9343. -find_mac80211_phy() {
  9344. - local device="$1"
  9345. -
  9346. - config_get phy "$device" phy
  9347. - lookup_phy
  9348. - [ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || {
  9349. - echo "PHY for wifi device $1 not found"
  9350. - return 1
  9351. - }
  9352. - config_set "$device" phy "$phy"
  9353. -
  9354. - config_get macaddr "$device" macaddr
  9355. - [ -z "$macaddr" ] && {
  9356. - config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
  9357. - }
  9358. -
  9359. - return 0
  9360. -}
  9361. -
  9362. -scan_mac80211() {
  9363. - local device="$1"
  9364. - local adhoc sta ap monitor mesh disabled
  9365. -
  9366. - config_get vifs "$device" vifs
  9367. - for vif in $vifs; do
  9368. - config_get_bool disabled "$vif" disabled 0
  9369. - [ $disabled = 0 ] || continue
  9370. -
  9371. - config_get mode "$vif" mode
  9372. - case "$mode" in
  9373. - adhoc|sta|ap|monitor|mesh)
  9374. - append $mode "$vif"
  9375. - ;;
  9376. - *) echo "$device($vif): Invalid mode, ignored."; continue;;
  9377. - esac
  9378. - done
  9379. -
  9380. - config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${sta:+$sta }${monitor:+$monitor }${mesh:+$mesh}"
  9381. -}
  9382. -
  9383. -list_phy_interfaces() {
  9384. - local phy="$1"
  9385. - if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then
  9386. - ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null;
  9387. - else
  9388. - ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g'
  9389. - fi
  9390. -}
  9391. -
  9392. -disable_mac80211() (
  9393. - local device="$1"
  9394. -
  9395. - find_mac80211_phy "$device" || return 0
  9396. - config_get phy "$device" phy
  9397. -
  9398. - set_wifi_down "$device"
  9399. - # kill all running hostapd and wpa_supplicant processes that
  9400. - # are running on atheros/mac80211 vifs
  9401. - for pid in `pidof hostapd`; do
  9402. - grep -E "$phy" /proc/$pid/cmdline >/dev/null && \
  9403. - kill $pid
  9404. - done
  9405. -
  9406. - include /lib/network
  9407. - for wdev in $(list_phy_interfaces "$phy"); do
  9408. - [ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1
  9409. - for pid in `pidof wpa_supplicant`; do
  9410. - grep "$wdev" /proc/$pid/cmdline >/dev/null && \
  9411. - kill $pid
  9412. - done
  9413. - ifconfig "$wdev" down 2>/dev/null
  9414. - unbridge "$dev"
  9415. - iw dev "$wdev" del
  9416. - done
  9417. -
  9418. - return 0
  9419. -)
  9420. -
  9421. -get_freq() {
  9422. - local phy="$1"
  9423. - local chan="$2"
  9424. - iw "$phy" info | grep -E -m1 "(\* ${chan:-....} MHz${chan:+|\\[$chan\\]})" | grep MHz | awk '{print $2}'
  9425. -}
  9426. -
  9427. -mac80211_generate_mac() {
  9428. - local id="$1"
  9429. - local ref="$2"
  9430. - local mask="$3"
  9431. -
  9432. - [ "$mask" = "00:00:00:00:00:00" ] && mask="ff:ff:ff:ff:ff:ff";
  9433. - local oIFS="$IFS"; IFS=":"; set -- $mask; IFS="$oIFS"
  9434. -
  9435. - local mask1=$1
  9436. - local mask6=$6
  9437. -
  9438. - local oIFS="$IFS"; IFS=":"; set -- $ref; IFS="$oIFS"
  9439. - [ "$((0x$mask1))" -gt 0 ] && {
  9440. - b1="0x$1"
  9441. - [ "$id" -gt 0 ] && \
  9442. - b1=$(($b1 ^ ((($id - 1) << 2) | 0x2)))
  9443. - printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6
  9444. - return
  9445. - }
  9446. -
  9447. - [ "$((0x$mask6))" -lt 255 ] && {
  9448. - printf "%s:%s:%s:%s:%s:%02x" $1 $2 $3 $4 $5 $(( 0x$6 ^ $id ))
  9449. - return
  9450. - }
  9451. -
  9452. - off2=$(( (0x$6 + $id) / 0x100 ))
  9453. - printf "%s:%s:%s:%s:%02x:%02x" \
  9454. - $1 $2 $3 $4 \
  9455. - $(( (0x$5 + $off2) % 0x100 )) \
  9456. - $(( (0x$6 + $id) % 0x100 ))
  9457. -}
  9458. -
  9459. -enable_mac80211() {
  9460. - local device="$1"
  9461. - config_get channel "$device" channel
  9462. - config_get vifs "$device" vifs
  9463. - config_get txpower "$device" txpower
  9464. - config_get country "$device" country
  9465. - config_get distance "$device" distance
  9466. - config_get txantenna "$device" txantenna all
  9467. - config_get rxantenna "$device" rxantenna all
  9468. - config_get antenna_gain "$device" antenna_gain 0
  9469. - config_get frag "$device" frag
  9470. - config_get rts "$device" rts
  9471. - find_mac80211_phy "$device" || return 0
  9472. - config_get phy "$device" phy
  9473. - local i=0
  9474. - local macidx=0
  9475. - local apidx=0
  9476. - fixed=""
  9477. - local hostapd_ctrl=""
  9478. -
  9479. - [ -n "$country" ] && {
  9480. - iw reg get | grep -q "^country $country:" || {
  9481. - iw reg set "$country"
  9482. - sleep 1
  9483. - }
  9484. - }
  9485. -
  9486. - config_get chanbw "$device" chanbw
  9487. - [ -n "$chanbw" -a -d /sys/kernel/debug/ieee80211/$phy/ath9k ] && echo "$chanbw" > /sys/kernel/debug/ieee80211/$phy/ath9k/chanbw
  9488. - [ -n "$chanbw" -a -d /sys/kernel/debug/ieee80211/$phy/ath5k ] && echo "$chanbw" > /sys/kernel/debug/ieee80211/$phy/ath5k/bwmode
  9489. -
  9490. - [ "$channel" = "auto" -o "$channel" = "0" ] || {
  9491. - fixed=1
  9492. - }
  9493. -
  9494. - iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
  9495. - iw phy "$phy" set antenna_gain $antenna_gain
  9496. -
  9497. - [ -n "$distance" ] && iw phy "$phy" set distance "$distance"
  9498. - [ -n "$frag" ] && iw phy "$phy" set frag "${frag%%.*}"
  9499. - [ -n "$rts" ] && iw phy "$phy" set rts "${rts%%.*}"
  9500. -
  9501. - export channel fixed
  9502. - # convert channel to frequency
  9503. - local freq="$(get_freq "$phy" "${fixed:+$channel}")"
  9504. -
  9505. - wifi_fixup_hwmode "$device" "g"
  9506. - for vif in $vifs; do
  9507. - config_get ifname "$vif" ifname
  9508. - [ -n "$ifname" ] || {
  9509. - [ $i -gt 0 ] && ifname="wlan${phy#phy}-$i" || ifname="wlan${phy#phy}"
  9510. - }
  9511. - config_set "$vif" ifname "$ifname"
  9512. -
  9513. - config_get mode "$vif" mode
  9514. - config_get ssid "$vif" ssid
  9515. -
  9516. - # It is far easier to delete and create the desired interface
  9517. - case "$mode" in
  9518. - adhoc)
  9519. - iw phy "$phy" interface add "$ifname" type adhoc
  9520. - ;;
  9521. - ap)
  9522. - # Hostapd will handle recreating the interface and
  9523. - # it's accompanying monitor
  9524. - apidx="$(($apidx + 1))"
  9525. - [ "$apidx" -gt 1 ] || iw phy "$phy" interface add "$ifname" type managed
  9526. - ;;
  9527. - mesh)
  9528. - config_get mesh_id "$vif" mesh_id
  9529. - iw phy "$phy" interface add "$ifname" type mp mesh_id "$mesh_id"
  9530. - ;;
  9531. - monitor)
  9532. - iw phy "$phy" interface add "$ifname" type monitor
  9533. - ;;
  9534. - sta)
  9535. - local wdsflag
  9536. - config_get_bool wds "$vif" wds 0
  9537. - [ "$wds" -gt 0 ] && wdsflag="4addr on"
  9538. - iw phy "$phy" interface add "$ifname" type managed $wdsflag
  9539. - config_get_bool powersave "$vif" powersave 0
  9540. - [ "$powersave" -gt 0 ] && powersave="on" || powersave="off"
  9541. - iw "$ifname" set power_save "$powersave"
  9542. - ;;
  9543. - esac
  9544. -
  9545. - # All interfaces must have unique mac addresses
  9546. - # which can either be explicitly set in the device
  9547. - # section, or automatically generated
  9548. - config_get macaddr "$device" macaddr
  9549. - config_get vif_mac "$vif" macaddr
  9550. - [ -n "$vif_mac" ] || {
  9551. - vif_mac="$(mac80211_generate_mac $macidx $macaddr $(cat /sys/class/ieee80211/${phy}/address_mask))"
  9552. - macidx="$(($macidx + 1))"
  9553. - }
  9554. - [ "$mode" = "ap" ] || ifconfig "$ifname" hw ether "$vif_mac"
  9555. - config_set "$vif" macaddr "$vif_mac"
  9556. -
  9557. - # !! ap !!
  9558. - #
  9559. - # ALL ap functionality will be passed to hostapd
  9560. - #
  9561. - # !! station !!
  9562. - #
  9563. - # ALL station functionality will be passed to wpa_supplicant
  9564. - #
  9565. - if [ ! "$mode" = "ap" ]; then
  9566. - # We attempt to set the channel for all interfaces, although
  9567. - # mac80211 may not support it or the driver might not yet
  9568. - # for ap mode this is handled by hostapd
  9569. - config_get htmode "$device" htmode
  9570. - case "$htmode" in
  9571. - HT20|HT40+|HT40-) ;;
  9572. - *) htmode= ;;
  9573. - esac
  9574. - [ -n "$fixed" -a -n "$channel" ] && iw dev "$ifname" set channel "$channel" $htmode
  9575. - fi
  9576. -
  9577. - i=$(($i + 1))
  9578. - done
  9579. -
  9580. - local start_hostapd=
  9581. - rm -f /var/run/hostapd-$phy.conf
  9582. - for vif in $vifs; do
  9583. - config_get mode "$vif" mode
  9584. - [ "$mode" = "ap" ] || continue
  9585. - mac80211_hostapd_setup_bss "$phy" "$vif"
  9586. - start_hostapd=1
  9587. - done
  9588. -
  9589. - [ -n "$start_hostapd" ] && {
  9590. - hostapd -P /var/run/wifi-$phy.pid -B /var/run/hostapd-$phy.conf || {
  9591. - echo "Failed to start hostapd for $phy"
  9592. - return
  9593. - }
  9594. - sleep 2
  9595. -
  9596. - for vif in $vifs; do
  9597. - config_get mode "$vif" mode
  9598. - config_get ifname "$vif" ifname
  9599. - [ "$mode" = "ap" ] || continue
  9600. - hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd-$phy/$ifname}"
  9601. - mac80211_start_vif "$vif" "$ifname"
  9602. - done
  9603. - }
  9604. -
  9605. - for vif in $vifs; do
  9606. - config_get mode "$vif" mode
  9607. - config_get ifname "$vif" ifname
  9608. - [ "$mode" = "ap" ] || ifconfig "$ifname" up
  9609. -
  9610. - config_get vif_txpower "$vif" txpower
  9611. - # use vif_txpower (from wifi-iface) to override txpower (from
  9612. - # wifi-device) if the latter doesn't exist
  9613. - txpower="${txpower:-$vif_txpower}"
  9614. - [ -z "$txpower" ] || iw dev "$ifname" set txpower fixed "${txpower%%.*}00"
  9615. -
  9616. - case "$mode" in
  9617. - adhoc)
  9618. - config_get bssid "$vif" bssid
  9619. - config_get ssid "$vif" ssid
  9620. - config_get beacon_int "$device" beacon_int
  9621. - config_get basic_rate_list "$device" basic_rate
  9622. - config_get encryption "$vif" encryption
  9623. - config_get key "$vif" key 1
  9624. - config_get mcast_rate "$vif" mcast_rate
  9625. - config_get htmode "$device" htmode
  9626. - case "$htmode" in
  9627. - HT20|HT40+|HT40-) ;;
  9628. - *) htmode= ;;
  9629. - esac
  9630. -
  9631. -
  9632. - local keyspec=""
  9633. - [ "$encryption" == "psk" -o "$encryption" == "psk2" ] && {
  9634. - if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
  9635. - wpa_supplicant_setup_vif "$vif" nl80211 "${hostapd_ctrl:+-H $hostapd_ctrl}" $freq $htmode || {
  9636. - echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
  9637. - # make sure this wifi interface won't accidentally stay open without encryption
  9638. - ifconfig "$ifname" down
  9639. - }
  9640. - mac80211_start_vif "$vif" "$ifname"
  9641. - continue
  9642. - fi
  9643. - }
  9644. -
  9645. - [ "$encryption" == "wep" ] && {
  9646. - case "$key" in
  9647. - [1234])
  9648. - local idx
  9649. - for idx in 1 2 3 4; do
  9650. - local ikey
  9651. - config_get ikey "$vif" "key$idx"
  9652. -
  9653. - [ -n "$ikey" ] && {
  9654. - ikey="$(($idx - 1)):$(prepare_key_wep "$ikey")"
  9655. - [ $idx -eq $key ] && ikey="d:$ikey"
  9656. - append keyspec "$ikey"
  9657. - }
  9658. - done
  9659. - ;;
  9660. - *) append keyspec "d:0:$(prepare_key_wep "$key")" ;;
  9661. - esac
  9662. - }
  9663. -
  9664. - local br brval brsub brstr
  9665. - [ -n "$basic_rate_list" ] && {
  9666. - for br in $basic_rate_list; do
  9667. - brval="$(($br / 1000))"
  9668. - brsub="$((($br / 100) % 10))"
  9669. - [ "$brsub" -gt 0 ] && brval="$brval.$brsub"
  9670. - [ -n "$brstr" ] && brstr="$brstr,"
  9671. - brstr="$brstr$brval"
  9672. - done
  9673. - }
  9674. -
  9675. - local mcval=""
  9676. - [ -n "$mcast_rate" ] && {
  9677. - mcval="$(($mcast_rate / 1000))"
  9678. - mcsub="$(( ($mcast_rate / 100) % 10 ))"
  9679. - [ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
  9680. - }
  9681. -
  9682. - iw dev "$ifname" ibss join "$ssid" $freq $htmode \
  9683. - ${fixed:+fixed-freq} $bssid \
  9684. - ${beacon_int:+beacon-interval $beacon_int} \
  9685. - ${brstr:+basic-rates $brstr} \
  9686. - ${mcval:+mcast-rate $mcval} \
  9687. - ${keyspec:+keys $keyspec}
  9688. - ;;
  9689. - mesh)
  9690. - mp_list="mesh_retry_timeout mesh_confirm_timeout mesh_holding_timeout mesh_max_peer_links
  9691. - mesh_max_retries mesh_ttl mesh_element_ttl mesh_auto_open_plinks mesh_hwmp_max_preq_retries
  9692. - mesh_path_refresh_time mesh_min_discovery_timeout mesh_hwmp_active_path_timeout
  9693. - mesh_hwmp_preq_min_interval mesh_hwmp_net_diameter_traversal_time mesh_hwmp_rootmode
  9694. - mesh_hwmp_rann_interval mesh_gate_announcements mesh_fwding mesh_sync_offset_max_neighor
  9695. - mesh_rssi_threshold mesh_hwmp_active_path_to_root_timeout mesh_hwmp_root_interval
  9696. - mesh_hwmp_confirmation_interval mesh_power_mode mesh_awake_window"
  9697. - for mp in $mp_list
  9698. - do
  9699. - config_get mp_val "$vif" "$mp" ""
  9700. - [ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$mp" "$mp_val"
  9701. - done
  9702. - ;;
  9703. - sta)
  9704. - if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
  9705. - wpa_supplicant_setup_vif "$vif" nl80211 "${hostapd_ctrl:+-H $hostapd_ctrl}" || {
  9706. - echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
  9707. - # make sure this wifi interface won't accidentally stay open without encryption
  9708. - ifconfig "$ifname" down
  9709. - continue
  9710. - }
  9711. - fi
  9712. - ;;
  9713. - esac
  9714. - [ "$mode" = "ap" ] || mac80211_start_vif "$vif" "$ifname"
  9715. - done
  9716. -
  9717. -}
  9718. -
  9719. -
  9720. -check_mac80211_device() {
  9721. - config_get phy "$1" phy
  9722. - [ -z "$phy" ] && {
  9723. - find_mac80211_phy "$1" >/dev/null || return 0
  9724. - config_get phy "$1" phy
  9725. - }
  9726. - [ "$phy" = "$dev" ] && found=1
  9727. -}
  9728. -
  9729. -detect_mac80211() {
  9730. - devidx=0
  9731. - config_load wireless
  9732. - while :; do
  9733. - config_get type "radio$devidx" type
  9734. - [ -n "$type" ] || break
  9735. - devidx=$(($devidx + 1))
  9736. - done
  9737. - for dev in $(ls /sys/class/ieee80211); do
  9738. - found=0
  9739. - config_foreach check_mac80211_device wifi-device
  9740. - [ "$found" -gt 0 ] && continue
  9741. -
  9742. - mode_11n=""
  9743. - mode_band="g"
  9744. - channel="11"
  9745. - ht_cap=0
  9746. - for cap in $(iw phy "$dev" info | grep 'Capabilities:' | cut -d: -f2); do
  9747. - ht_cap="$(($ht_cap | $cap))"
  9748. - done
  9749. - ht_capab="";
  9750. - [ "$ht_cap" -gt 0 ] && {
  9751. - mode_11n="n"
  9752. - append ht_capab " option htmode HT20" "$N"
  9753. -
  9754. - list=" list ht_capab"
  9755. - [ "$(($ht_cap & 1))" -eq 1 ] && append ht_capab "$list LDPC" "$N"
  9756. - [ "$(($ht_cap & 16))" -eq 16 ] && append ht_capab "$list GF" "$N"
  9757. - [ "$(($ht_cap & 32))" -eq 32 ] && append ht_capab "$list SHORT-GI-20" "$N"
  9758. - [ "$(($ht_cap & 64))" -eq 64 ] && append ht_capab "$list SHORT-GI-40" "$N"
  9759. - [ "$(($ht_cap & 128))" -eq 128 ] && append ht_capab "$list TX-STBC" "$N"
  9760. - [ "$(($ht_cap & 768))" -eq 256 ] && append ht_capab "$list RX-STBC1" "$N"
  9761. - [ "$(($ht_cap & 768))" -eq 512 ] && append ht_capab "$list RX-STBC12" "$N"
  9762. - [ "$(($ht_cap & 768))" -eq 768 ] && append ht_capab "$list RX-STBC123" "$N"
  9763. - [ "$(($ht_cap & 4096))" -eq 4096 ] && append ht_capab "$list DSSS_CCK-40" "$N"
  9764. - }
  9765. - iw phy "$dev" info | grep -q '2412 MHz' || { mode_band="a"; channel="36"; }
  9766. -
  9767. - if [ -x /usr/bin/readlink ]; then
  9768. - path="$(readlink -f /sys/class/ieee80211/${dev}/device)"
  9769. - path="${path##/sys/devices/}"
  9770. - dev_id=" option path '$path'"
  9771. - else
  9772. - dev_id=" option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)"
  9773. - fi
  9774. -
  9775. - cat <<EOF
  9776. -config wifi-device radio$devidx
  9777. - option type mac80211
  9778. - option channel ${channel}
  9779. - option hwmode 11${mode_11n}${mode_band}
  9780. -$dev_id
  9781. -$ht_capab
  9782. - # REMOVE THIS LINE TO ENABLE WIFI:
  9783. - option disabled 1
  9784. -
  9785. -config wifi-iface
  9786. - option device radio$devidx
  9787. - option network lan
  9788. - option mode ap
  9789. - option ssid OpenWrt
  9790. - option encryption none
  9791. -
  9792. -EOF
  9793. - devidx=$(($devidx + 1))
  9794. - done
  9795. -}
  9796. -
  9797. diff --git a/package/mac80211/files/regdb.txt b/package/mac80211/files/regdb.txt
  9798. deleted file mode 100644
  9799. index b250e69..0000000
  9800. --- a/package/mac80211/files/regdb.txt
  9801. +++ /dev/null
  9802. @@ -1,697 +0,0 @@
  9803. -# This is the world regulatory domain
  9804. -country 00:
  9805. - (2402 - 2472 @ 40), (3, 20)
  9806. - # Channel 12 - 13. No HT40 channel fits here
  9807. - (2457 - 2482 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS
  9808. - # Channel 14. Only JP enables this and for 802.11b only
  9809. - (2474 - 2494 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS, NO-OFDM
  9810. - # Channel 36 - 48
  9811. - (5170 - 5250 @ 40), (3, 20)
  9812. - # NB: 5260 MHz - 5700 MHz requies DFS
  9813. - # Channel 149 - 165
  9814. - (5735 - 5835 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
  9815. -
  9816. -
  9817. -country AE:
  9818. - (2402 - 2482 @ 40), (N/A, 20)
  9819. - (5170 - 5250 @ 40), (N/A, 20)
  9820. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9821. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9822. -
  9823. -country AL:
  9824. - (2402 - 2482 @ 20), (N/A, 20)
  9825. -
  9826. -country AM:
  9827. - (2402 - 2482 @ 40), (N/A, 20)
  9828. - (5170 - 5250 @ 20), (N/A, 18)
  9829. - (5250 - 5330 @ 20), (N/A, 18), DFS
  9830. -
  9831. -country AN:
  9832. - (2402 - 2482 @ 40), (N/A, 20)
  9833. - (5170 - 5250 @ 40), (N/A, 20)
  9834. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9835. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9836. -
  9837. -country AR:
  9838. - (2402 - 2482 @ 40), (N/A, 20)
  9839. - (5170 - 5250 @ 40), (3, 17)
  9840. - (5250 - 5330 @ 40), (3, 20), DFS
  9841. - (5490 - 5710 @ 40), (3, 20), DFS
  9842. - (5735 - 5835 @ 40), (3, 30)
  9843. -
  9844. -country AT: DFS-ETSI
  9845. - (2402 - 2482 @ 40), (N/A, 20)
  9846. - (5170 - 5250 @ 40), (N/A, 20)
  9847. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9848. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9849. -
  9850. -country AU:
  9851. - (2402 - 2482 @ 40), (N/A, 20)
  9852. - (5170 - 5250 @ 40), (3, 23)
  9853. - (5250 - 5330 @ 40), (3, 23), DFS
  9854. - (5735 - 5835 @ 40), (3, 30)
  9855. -
  9856. -country AW:
  9857. - (2402 - 2482 @ 40), (N/A, 20)
  9858. - (5170 - 5250 @ 40), (N/A, 20)
  9859. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9860. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9861. -
  9862. -country AZ:
  9863. - (2402 - 2482 @ 40), (N/A, 20)
  9864. - (5170 - 5250 @ 40), (N/A, 18)
  9865. - (5250 - 5330 @ 40), (N/A, 18), DFS
  9866. -
  9867. -country BA: DFS-ETSI
  9868. - (2402 - 2482 @ 40), (N/A, 20)
  9869. - (5170 - 5250 @ 40), (N/A, 20)
  9870. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9871. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9872. -
  9873. -country BB:
  9874. - (2402 - 2482 @ 40), (N/A, 20)
  9875. - (5170 - 5250 @ 40), (3, 23)
  9876. - (5250 - 5330 @ 40), (3, 23), DFS
  9877. - (5735 - 5835 @ 40), (3, 30)
  9878. -
  9879. -country BD:
  9880. - (2402 - 2482 @ 40), (N/A, 20)
  9881. -
  9882. -country BE: DFS-ETSI
  9883. - (2402 - 2482 @ 40), (N/A, 20)
  9884. - (5170 - 5250 @ 40), (N/A, 20)
  9885. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9886. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9887. -
  9888. -country BG: DFS-ETSI
  9889. - (2402 - 2482 @ 40), (N/A, 20)
  9890. - (5170 - 5250 @ 40), (N/A, 23)
  9891. - (5250 - 5290 @ 40), (N/A, 23), DFS
  9892. - (5490 - 5710 @ 40), (N/A, 30), DFS
  9893. -
  9894. -country BH:
  9895. - (2402 - 2482 @ 40), (N/A, 20)
  9896. - (5170 - 5250 @ 20), (N/A, 20)
  9897. - (5250 - 5330 @ 20), (N/A, 20), DFS
  9898. - (5735 - 5835 @ 20), (N/A, 20)
  9899. -
  9900. -country BL:
  9901. - (2402 - 2482 @ 40), (N/A, 20)
  9902. - (5170 - 5250 @ 40), (N/A, 18)
  9903. - (5250 - 5330 @ 40), (N/A, 18), DFS
  9904. -
  9905. -country BN:
  9906. - (2402 - 2482 @ 40), (N/A, 20)
  9907. - (5170 - 5250 @ 40), (N/A, 20)
  9908. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9909. - (5735 - 5835 @ 40), (N/A, 30)
  9910. -
  9911. -country BO:
  9912. - (2402 - 2482 @ 40), (N/A, 30)
  9913. - (5735 - 5835 @ 40), (N/A, 30)
  9914. -
  9915. -country BR:
  9916. - (2402 - 2482 @ 40), (N/A, 20)
  9917. - (5170 - 5250 @ 40), (3, 17)
  9918. - (5250 - 5330 @ 40), (3, 20), DFS
  9919. - (5490 - 5710 @ 40), (3, 20), DFS
  9920. - (5735 - 5835 @ 40), (3, 30)
  9921. -
  9922. -country BY:
  9923. - (2402 - 2482 @ 40), (N/A, 20)
  9924. - (5170 - 5250 @ 40), (N/A, 20)
  9925. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9926. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9927. -
  9928. -country BZ:
  9929. - (2402 - 2482 @ 40), (N/A, 30)
  9930. - (5735 - 5835 @ 40), (N/A, 30)
  9931. -
  9932. -country CA:
  9933. - (2402 - 2472 @ 40), (3, 27)
  9934. - (5170 - 5250 @ 40), (3, 17)
  9935. - (5250 - 5330 @ 40), (3, 20), DFS
  9936. - (5490 - 5710 @ 40), (3, 20), DFS
  9937. - (5735 - 5835 @ 40), (3, 30)
  9938. -
  9939. -country CH: DFS-ETSI
  9940. - (2402 - 2482 @ 40), (N/A, 20)
  9941. - (5170 - 5250 @ 40), (N/A, 20)
  9942. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9943. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9944. -
  9945. -country CL:
  9946. - (2402 - 2482 @ 40), (N/A, 20)
  9947. - (5170 - 5250 @ 40), (N/A, 20)
  9948. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9949. - (5735 - 5835 @ 40), (N/A, 20)
  9950. -
  9951. -country CN:
  9952. - (2402 - 2482 @ 40), (N/A, 20)
  9953. - (5735 - 5835 @ 40), (N/A, 30)
  9954. -
  9955. -country CO:
  9956. - (2402 - 2472 @ 40), (3, 27)
  9957. - (5170 - 5250 @ 40), (3, 17)
  9958. - (5250 - 5330 @ 40), (3, 23), DFS
  9959. - (5735 - 5835 @ 40), (3, 30)
  9960. -
  9961. -country CR:
  9962. - (2402 - 2482 @ 40), (N/A, 20)
  9963. - (5170 - 5250 @ 20), (3, 17)
  9964. - (5250 - 5330 @ 20), (3, 23), DFS
  9965. - (5735 - 5835 @ 20), (3, 30)
  9966. -
  9967. -country CS:
  9968. - (2402 - 2482 @ 40), (N/A, 20)
  9969. - (5170 - 5250 @ 40), (N/A, 20)
  9970. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9971. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9972. -
  9973. -country CY: DFS-ETSI
  9974. - (2402 - 2482 @ 40), (N/A, 20)
  9975. - (5170 - 5250 @ 40), (N/A, 20)
  9976. - (5250 - 5330 @ 40), (N/A, 20), DFS
  9977. - (5490 - 5710 @ 40), (N/A, 27), DFS
  9978. -
  9979. -# Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf
  9980. -# and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf
  9981. -# Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is
  9982. -# implemented.
  9983. -country CZ: DFS-ETSI
  9984. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  9985. - (5150 - 5250 @ 40), (N/A, 200 mW), NO-OUTDOOR
  9986. - (5250 - 5350 @ 40), (N/A, 100 mW), NO-OUTDOOR, DFS
  9987. - (5470 - 5725 @ 40), (N/A, 500 mW), DFS
  9988. -
  9989. -# Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from
  9990. -# http://www.bundesnetzagentur.de/cae/servlet/contentblob/38448/publicationFile/2659/Frequenznutzungsplan2008_Id17448pdf.pdf
  9991. -# For the 5GHz range also see
  9992. -# http://www.bundesnetzagentur.de/cae/servlet/contentblob/38216/publicationFile/6579/WLAN5GHzVfg7_2010_28042010pdf.pdf
  9993. -# The values have been reduced by a factor of 2 (3db) for non TPC devices
  9994. -# (in other words: devices with TPC can use twice the tx power of this table).
  9995. -# Note that the docs do not require TPC for 5150--5250; the reduction to
  9996. -# 100mW thus is not strictly required -- however the conservative 100mW
  9997. -# limit is used here as the non-interference with radar and satellite
  9998. -# apps relies on the attenuation by the building walls only in the
  9999. -# absence of DFS; the neighbour countries have 100mW limit here as well.
  10000. -
  10001. -country DE: DFS-ETSI
  10002. - # entries 279004 and 280006
  10003. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  10004. - # entry 303005
  10005. - (5150 - 5250 @ 40), (N/A, 100 mW), NO-OUTDOOR
  10006. - # entries 304002 and 305002
  10007. - (5250 - 5350 @ 40), (N/A, 100 mW), NO-OUTDOOR, DFS
  10008. - # entries 308002, 309001 and 310003
  10009. - (5470 - 5725 @ 40), (N/A, 500 mW), DFS
  10010. -
  10011. -country DK: DFS-ETSI
  10012. - (2402 - 2482 @ 40), (N/A, 20)
  10013. - (5170 - 5250 @ 40), (N/A, 20)
  10014. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10015. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10016. -
  10017. -country DO:
  10018. - (2402 - 2472 @ 40), (3, 27)
  10019. - (5170 - 5250 @ 40), (3, 17)
  10020. - (5250 - 5330 @ 40), (3, 23), DFS
  10021. - (5735 - 5835 @ 40), (3, 30)
  10022. -
  10023. -country DZ:
  10024. - (2402 - 2482 @ 40), (N/A, 20)
  10025. -
  10026. -country EC:
  10027. - (2402 - 2482 @ 40), (N/A, 20)
  10028. - (5170 - 5250 @ 20), (3, 17)
  10029. - (5250 - 5330 @ 20), (3, 23), DFS
  10030. - (5735 - 5835 @ 20), (3, 30)
  10031. -
  10032. -country EE: DFS-ETSI
  10033. - (2402 - 2482 @ 40), (N/A, 20)
  10034. - (5170 - 5250 @ 40), (N/A, 20)
  10035. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10036. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10037. -
  10038. -country EG:
  10039. - (2402 - 2482 @ 40), (N/A, 20)
  10040. - (5170 - 5250 @ 20), (N/A, 20)
  10041. - (5250 - 5330 @ 20), (N/A, 20), DFS
  10042. -
  10043. -country ES: DFS-ETSI
  10044. - (2402 - 2482 @ 40), (N/A, 20)
  10045. - (5170 - 5250 @ 40), (N/A, 20)
  10046. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10047. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10048. -
  10049. -country FI: DFS-ETSI
  10050. - (2402 - 2482 @ 40), (N/A, 20)
  10051. - (5170 - 5250 @ 40), (N/A, 20)
  10052. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10053. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10054. -
  10055. -country FR: DFS-ETSI
  10056. - (2402 - 2482 @ 40), (N/A, 20)
  10057. - (5170 - 5250 @ 40), (N/A, 20)
  10058. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10059. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10060. -
  10061. -country GE:
  10062. - (2402 - 2482 @ 40), (N/A, 20)
  10063. - (5170 - 5250 @ 40), (N/A, 18)
  10064. - (5250 - 5330 @ 40), (N/A, 18), DFS
  10065. -
  10066. -country GB: DFS-ETSI
  10067. - (2402 - 2482 @ 40), (N/A, 20)
  10068. - (5170 - 5250 @ 40), (N/A, 20)
  10069. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10070. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10071. -
  10072. -country GD:
  10073. - (2402 - 2472 @ 40), (3, 27)
  10074. - (5170 - 5250 @ 40), (3, 17)
  10075. - (5250 - 5330 @ 40), (3, 20), DFS
  10076. - (5490 - 5710 @ 40), (3, 20), DFS
  10077. - (5735 - 5835 @ 40), (3, 30)
  10078. -
  10079. -country GR: DFS-ETSI
  10080. - (2402 - 2482 @ 40), (N/A, 20)
  10081. - (5170 - 5250 @ 40), (N/A, 20)
  10082. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10083. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10084. -
  10085. -country GL: DFS-ETSI
  10086. - (2402 - 2482 @ 40), (N/A, 20)
  10087. - (5170 - 5250 @ 20), (N/A, 20)
  10088. - (5250 - 5330 @ 20), (N/A, 20), DFS
  10089. - (5490 - 5710 @ 20), (N/A, 27), DFS
  10090. -
  10091. -country GT:
  10092. - (2402 - 2472 @ 40), (3, 27)
  10093. - (5170 - 5250 @ 40), (3, 17)
  10094. - (5250 - 5330 @ 40), (3, 23), DFS
  10095. - (5735 - 5835 @ 40), (3, 30)
  10096. -
  10097. -country GU:
  10098. - (2402 - 2472 @ 40), (3, 27)
  10099. - (5170 - 5250 @ 20), (3, 17)
  10100. - (5250 - 5330 @ 20), (3, 23), DFS
  10101. - (5735 - 5835 @ 20), (3, 30)
  10102. -
  10103. -country HN:
  10104. - (2402 - 2482 @ 40), (N/A, 20)
  10105. - (5170 - 5250 @ 40), (3, 17)
  10106. - (5250 - 5330 @ 40), (3, 20), DFS
  10107. - (5490 - 5710 @ 40), (3, 20), DFS
  10108. - (5735 - 5835 @ 40), (3, 30)
  10109. -
  10110. -country HK:
  10111. - (2402 - 2482 @ 40), (N/A, 20)
  10112. - (5170 - 5250 @ 40), (3, 17)
  10113. - (5250 - 5330 @ 40), (3, 20), DFS
  10114. - (5490 - 5710 @ 40), (3, 20), DFS
  10115. - (5735 - 5835 @ 40), (3, 30)
  10116. -
  10117. -country HR: DFS-ETSI
  10118. - (2402 - 2482 @ 40), (N/A, 20)
  10119. - (5170 - 5250 @ 40), (N/A, 20)
  10120. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10121. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10122. -
  10123. -country HT:
  10124. - (2402 - 2482 @ 40), (N/A, 20)
  10125. - (5170 - 5250 @ 40), (N/A, 20)
  10126. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10127. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10128. -
  10129. -country HU: DFS-ETSI
  10130. - (2402 - 2482 @ 40), (N/A, 20)
  10131. - (5170 - 5250 @ 40), (N/A, 20)
  10132. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10133. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10134. -
  10135. -country ID:
  10136. - (2402 - 2482 @ 40), (N/A, 20)
  10137. -
  10138. -country IE: DFS-ETSI
  10139. - (2402 - 2482 @ 40), (N/A, 20)
  10140. - (5170 - 5250 @ 40), (N/A, 20)
  10141. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10142. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10143. -
  10144. -country IL:
  10145. - (2402 - 2482 @ 40), (N/A, 20)
  10146. - (5150 - 5250 @ 40), (N/A, 200 mW), NO-OUTDOOR
  10147. - (5250 - 5350 @ 40), (N/A, 200 mW), NO-OUTDOOR, DFS
  10148. -
  10149. -country IN:
  10150. - (2402 - 2482 @ 40), (N/A, 20)
  10151. - (5170 - 5250 @ 40), (N/A, 20)
  10152. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10153. - (5735 - 5835 @ 40), (N/A, 20)
  10154. -
  10155. -country IS: DFS-ETSI
  10156. - (2402 - 2482 @ 40), (N/A, 20)
  10157. - (5170 - 5250 @ 40), (N/A, 20)
  10158. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10159. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10160. -
  10161. -country IR:
  10162. - (2402 - 2482 @ 40), (N/A, 20)
  10163. - (5735 - 5835 @ 40), (N/A, 30)
  10164. -
  10165. -country IT: DFS-ETSI
  10166. - (2402 - 2482 @ 40), (N/A, 20)
  10167. - (5170 - 5250 @ 40), (N/A, 20)
  10168. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10169. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10170. -
  10171. -country JM:
  10172. - (2402 - 2482 @ 40), (N/A, 20)
  10173. - (5170 - 5250 @ 40), (3, 17)
  10174. - (5250 - 5330 @ 40), (3, 20), DFS
  10175. - (5490 - 5710 @ 40), (3, 20), DFS
  10176. - (5735 - 5835 @ 40), (3, 30)
  10177. -
  10178. -country JP:
  10179. - (2402 - 2472 @ 40), (N/A, 20)
  10180. - (2457 - 2482 @ 20), (N/A, 20)
  10181. - (2474 - 2494 @ 20), (N/A, 20), NO-OFDM
  10182. - (4910 - 4930 @ 10), (N/A, 23)
  10183. - (4910 - 4990 @ 40), (N/A, 23)
  10184. - (4930 - 4950 @ 10), (N/A, 23)
  10185. - (5030 - 5045 @ 10), (N/A, 23)
  10186. - (5030 - 5090 @ 40), (N/A, 23)
  10187. - (5050 - 5060 @ 10), (N/A, 23)
  10188. - (5170 - 5250 @ 40), (N/A, 20)
  10189. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10190. - (5490 - 5710 @ 40), (N/A, 23), DFS
  10191. -
  10192. -country JO:
  10193. - (2402 - 2482 @ 40), (N/A, 20)
  10194. - (5170 - 5250 @ 40), (N/A, 18)
  10195. -
  10196. -country KE:
  10197. - (2402 - 2482 @ 40), (N/A, 20)
  10198. - (5735 - 5835 @ 40), (N/A, 30)
  10199. -
  10200. -country KH:
  10201. - (2402 - 2482 @ 40), (N/A, 20)
  10202. - (5170 - 5250 @ 40), (N/A, 20)
  10203. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10204. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10205. -
  10206. -country KP:
  10207. - (2402 - 2482 @ 40), (N/A, 20)
  10208. - (5170 - 5330 @ 40), (3, 20)
  10209. - (5160 - 5250 @ 40), (3, 20), DFS
  10210. - (5490 - 5630 @ 40), (3, 30), DFS
  10211. - (5735 - 5815 @ 40), (3, 30)
  10212. -
  10213. -country KR:
  10214. - (2402 - 2482 @ 20), (N/A, 20)
  10215. - (5170 - 5250 @ 20), (3, 20)
  10216. - (5250 - 5330 @ 20), (3, 20), DFS
  10217. - (5490 - 5630 @ 20), (3, 30), DFS
  10218. - (5735 - 5815 @ 20), (3, 30)
  10219. -
  10220. -country KW:
  10221. - (2402 - 2482 @ 40), (N/A, 20)
  10222. - (5170 - 5250 @ 40), (N/A, 20)
  10223. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10224. -
  10225. -country KZ:
  10226. - (2402 - 2482 @ 40), (N/A, 20)
  10227. -
  10228. -country LB:
  10229. - (2402 - 2482 @ 40), (N/A, 20)
  10230. - (5735 - 5835 @ 40), (N/A, 30)
  10231. -
  10232. -country LI: DFS-ETSI
  10233. - (2402 - 2482 @ 40), (N/A, 20)
  10234. - (5170 - 5250 @ 40), (N/A, 20)
  10235. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10236. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10237. -
  10238. -country LK:
  10239. - (2402 - 2482 @ 40), (N/A, 20)
  10240. - (5170 - 5250 @ 20), (3, 17)
  10241. - (5250 - 5330 @ 20), (3, 20), DFS
  10242. - (5490 - 5710 @ 20), (3, 20), DFS
  10243. - (5735 - 5835 @ 20), (3, 30)
  10244. -
  10245. -country LT: DFS-ETSI
  10246. - (2402 - 2482 @ 40), (N/A, 20)
  10247. - (5170 - 5250 @ 40), (N/A, 20)
  10248. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10249. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10250. -
  10251. -country LU: DFS-ETSI
  10252. - (2402 - 2482 @ 40), (N/A, 20)
  10253. - (5170 - 5250 @ 40), (N/A, 20)
  10254. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10255. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10256. -
  10257. -country LV: DFS-ETSI
  10258. - (2402 - 2482 @ 40), (N/A, 20)
  10259. - (5170 - 5250 @ 40), (N/A, 20)
  10260. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10261. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10262. -
  10263. -country MC: DFS-ETSI
  10264. - (2402 - 2482 @ 40), (N/A, 20)
  10265. - (5170 - 5250 @ 40), (N/A, 18)
  10266. - (5250 - 5330 @ 40), (N/A, 18), DFS
  10267. -
  10268. -country MA:
  10269. - (2402 - 2482 @ 40), (N/A, 20)
  10270. -
  10271. -country MO:
  10272. - (2402 - 2482 @ 40), (N/A, 20)
  10273. - (5170 - 5250 @ 40), (3, 23)
  10274. - (5250 - 5330 @ 40), (3, 23), DFS
  10275. - (5735 - 5835 @ 40), (3, 30)
  10276. -
  10277. -country MK: DFS-ETSI
  10278. - (2402 - 2482 @ 40), (N/A, 20)
  10279. - (5170 - 5250 @ 40), (N/A, 20)
  10280. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10281. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10282. -
  10283. -country MT: DFS-ETSI
  10284. - (2402 - 2482 @ 40), (N/A, 20)
  10285. - (5170 - 5250 @ 40), (N/A, 20)
  10286. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10287. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10288. -
  10289. -country MY:
  10290. - (2402 - 2482 @ 40), (N/A, 20)
  10291. - (5250 - 5330 @ 40), (N/A, 30), DFS
  10292. - (5735 - 5835 @ 40), (N/A, 30)
  10293. -
  10294. -country MX:
  10295. - (2402 - 2472 @ 40), (3, 27)
  10296. - (5170 - 5250 @ 40), (3, 17)
  10297. - (5250 - 5330 @ 40), (3, 23), DFS
  10298. - (5735 - 5835 @ 40), (3, 30)
  10299. -
  10300. -country NL: DFS-ETSI
  10301. - (2402 - 2482 @ 40), (N/A, 20)
  10302. - (5170 - 5250 @ 40), (N/A, 20), NO-OUTDOOR
  10303. - (5250 - 5330 @ 40), (N/A, 20), NO-OUTDOOR, DFS
  10304. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10305. -
  10306. -country NO: DFS-ETSI
  10307. - (2402 - 2482 @ 40), (N/A, 20)
  10308. - (5170 - 5250 @ 40), (N/A, 20)
  10309. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10310. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10311. -
  10312. -country NP:
  10313. - (2402 - 2482 @ 40), (N/A, 20)
  10314. - (5735 - 5835 @ 40), (N/A, 30)
  10315. -
  10316. -country NZ:
  10317. - (2402 - 2482 @ 40), (N/A, 30)
  10318. - (5170 - 5250 @ 20), (3, 23)
  10319. - (5250 - 5330 @ 20), (3, 23), DFS
  10320. - (5735 - 5835 @ 20), (3, 30)
  10321. -
  10322. -country OM:
  10323. - (2402 - 2482 @ 40), (N/A, 20)
  10324. - (5170 - 5250 @ 40), (3, 17)
  10325. - (5250 - 5330 @ 40), (3, 20), DFS
  10326. - (5490 - 5710 @ 40), (3, 20), DFS
  10327. - (5735 - 5835 @ 40), (3, 30)
  10328. -
  10329. -country PA:
  10330. - (2402 - 2472 @ 40), (3, 27)
  10331. - (5170 - 5250 @ 40), (3, 17)
  10332. - (5250 - 5330 @ 40), (3, 23), DFS
  10333. - (5735 - 5835 @ 40), (3, 30)
  10334. -
  10335. -country PE:
  10336. - (2402 - 2482 @ 40), (N/A, 20)
  10337. - (5735 - 5835 @ 40), (N/A, 30)
  10338. -
  10339. -country PG:
  10340. - (2402 - 2482 @ 40), (N/A, 20)
  10341. - (5170 - 5250 @ 40), (3, 17)
  10342. - (5250 - 5330 @ 40), (3, 23), DFS
  10343. - (5735 - 5835 @ 40), (3, 30)
  10344. -
  10345. -country PH:
  10346. - (2402 - 2482 @ 40), (N/A, 20)
  10347. - (5735 - 5835 @ 40), (N/A, 30)
  10348. -
  10349. -country PK:
  10350. - (2402 - 2482 @ 40), (N/A, 20)
  10351. - (5735 - 5835 @ 40), (N/A, 30)
  10352. -
  10353. -country PL: DFS-ETSI
  10354. - (2402 - 2482 @ 40), (N/A, 20)
  10355. - (5170 - 5250 @ 40), (N/A, 20)
  10356. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10357. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10358. -
  10359. -country PT: DFS-ETSI
  10360. - (2402 - 2482 @ 40), (N/A, 20)
  10361. - (5170 - 5250 @ 40), (N/A, 20)
  10362. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10363. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10364. -
  10365. -country PR:
  10366. - (2402 - 2472 @ 40), (3, 27)
  10367. - (5170 - 5250 @ 40), (3, 17)
  10368. - (5250 - 5330 @ 40), (3, 23), DFS
  10369. - (5735 - 5835 @ 40), (3, 30)
  10370. -
  10371. -country QA:
  10372. - (2402 - 2482 @ 40), (N/A, 20)
  10373. - (5735 - 5835 @ 40), (N/A, 30)
  10374. -
  10375. -country RO: DFS-ETSI
  10376. - (2402 - 2482 @ 40), (N/A, 20)
  10377. - (5170 - 5250 @ 40), (N/A, 20)
  10378. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10379. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10380. -
  10381. -country RU:
  10382. - (2402 - 2482 @ 40), (N/A, 20)
  10383. - (5735 - 5835 @ 20), (N/A, 30)
  10384. -
  10385. -country SA:
  10386. - (2402 - 2482 @ 40), (N/A, 20)
  10387. - (5170 - 5250 @ 20), (3, 23)
  10388. - (5250 - 5330 @ 20), (3, 23), DFS
  10389. - (5735 - 5835 @ 20), (3, 30)
  10390. -
  10391. -country SE: DFS-ETSI
  10392. - (2402 - 2482 @ 40), (N/A, 20)
  10393. - (5170 - 5250 @ 40), (N/A, 20)
  10394. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10395. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10396. -
  10397. -country SG:
  10398. - (2402 - 2482 @ 40), (N/A, 20)
  10399. - (5170 - 5250 @ 40), (N/A, 20)
  10400. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10401. - (5735 - 5835 @ 40), (N/A, 20)
  10402. -
  10403. -country SI: DFS-ETSI
  10404. - (2402 - 2482 @ 40), (N/A, 20)
  10405. - (5170 - 5250 @ 40), (N/A, 20)
  10406. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10407. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10408. -
  10409. -country SK: DFS-ETSI
  10410. - (2402 - 2482 @ 40), (N/A, 20)
  10411. - (5170 - 5250 @ 40), (N/A, 20)
  10412. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10413. - (5490 - 5710 @ 40), (N/A, 27), DFS
  10414. -
  10415. -country SV:
  10416. - (2402 - 2482 @ 40), (N/A, 20)
  10417. - (5170 - 5250 @ 20), (3, 17)
  10418. - (5250 - 5330 @ 20), (3, 23), DFS
  10419. - (5735 - 5835 @ 20), (3, 30)
  10420. -
  10421. -country SY:
  10422. - (2402 - 2482 @ 40), (N/A, 20)
  10423. -
  10424. -country TW:
  10425. - (2402 - 2472 @ 40), (3, 27)
  10426. - (5270 - 5330 @ 40), (3, 17), DFS
  10427. - (5735 - 5815 @ 40), (3, 30)
  10428. -
  10429. -country TH:
  10430. - (2402 - 2482 @ 40), (N/A, 20)
  10431. - (5170 - 5250 @ 40), (3, 17)
  10432. - (5250 - 5330 @ 40), (3, 20), DFS
  10433. - (5490 - 5710 @ 40), (3, 20), DFS
  10434. - (5735 - 5835 @ 40), (3, 30)
  10435. -
  10436. -country TT:
  10437. - (2402 - 2482 @ 40), (N/A, 20)
  10438. - (5170 - 5250 @ 40), (3, 17)
  10439. - (5250 - 5330 @ 40), (3, 20), DFS
  10440. - (5490 - 5710 @ 40), (3, 20), DFS
  10441. - (5735 - 5835 @ 40), (3, 30)
  10442. -
  10443. -country TN:
  10444. - (2402 - 2482 @ 40), (N/A, 20)
  10445. - (5170 - 5250 @ 20), (N/A, 20)
  10446. - (5250 - 5330 @ 20), (N/A, 20), DFS
  10447. -
  10448. -country TR: DFS-ETSI
  10449. - (2402 - 2482 @ 40), (N/A, 20)
  10450. - (5170 - 5250 @ 20), (N/A, 20)
  10451. - (5250 - 5330 @ 20), (N/A, 20), DFS
  10452. -
  10453. -country UA:
  10454. - (2402 - 2482 @ 40), (N/A, 20)
  10455. -
  10456. -country US: DFS-FCC
  10457. - (2402 - 2472 @ 40), (3, 27)
  10458. - (5170 - 5250 @ 40), (3, 17)
  10459. - (5250 - 5330 @ 40), (3, 20), DFS
  10460. - (5490 - 5600 @ 40), (3, 20), DFS
  10461. - (5650 - 5710 @ 40), (3, 20), DFS
  10462. - (5735 - 5835 @ 40), (3, 30)
  10463. -
  10464. -country UY:
  10465. - (2402 - 2482 @ 40), (N/A, 20)
  10466. - (5170 - 5250 @ 40), (3, 17)
  10467. - (5250 - 5330 @ 40), (3, 20), DFS
  10468. - (5490 - 5710 @ 40), (3, 20), DFS
  10469. - (5735 - 5835 @ 40), (3, 30)
  10470. -
  10471. -country UZ:
  10472. - (2402 - 2472 @ 40), (3, 27)
  10473. - (5170 - 5250 @ 40), (3, 17)
  10474. - (5250 - 5330 @ 40), (3, 20), DFS
  10475. - (5490 - 5710 @ 40), (3, 20), DFS
  10476. - (5735 - 5835 @ 40), (3, 30)
  10477. -
  10478. -country VE:
  10479. - (2402 - 2482 @ 40), (N/A, 20)
  10480. - (5735 - 5815 @ 40), (N/A, 23)
  10481. -
  10482. -country VN:
  10483. - (2402 - 2482 @ 40), (N/A, 20)
  10484. - (5170 - 5250 @ 40), (N/A, 20)
  10485. - (5250 - 5330 @ 40), (N/A, 20), DFS
  10486. -
  10487. -country YE:
  10488. - (2402 - 2482 @ 40), (N/A, 20)
  10489. -
  10490. -country ZA:
  10491. - (2402 - 2482 @ 40), (N/A, 20)
  10492. - (5170 - 5250 @ 40), (3, 17)
  10493. - (5250 - 5330 @ 40), (3, 20), DFS
  10494. - (5490 - 5710 @ 40), (3, 20), DFS
  10495. - (5735 - 5835 @ 40), (3, 30)
  10496. -
  10497. -country ZW:
  10498. - (2402 - 2482 @ 40), (N/A, 20)
  10499. -
  10500. diff --git a/package/mac80211/patches/000-fix_kconfig.patch b/package/mac80211/patches/000-fix_kconfig.patch
  10501. deleted file mode 100644
  10502. index 88d0b04..0000000
  10503. --- a/package/mac80211/patches/000-fix_kconfig.patch
  10504. +++ /dev/null
  10505. @@ -1,16 +0,0 @@
  10506. ---- a/kconf/Makefile
  10507. -+++ b/kconf/Makefile
  10508. -@@ -1,10 +1,10 @@
  10509. --CFLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
  10510. -+CFLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DKBUILD_NO_NLS
  10511. -
  10512. - LXDIALOG := lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o
  10513. -
  10514. - conf: conf.o zconf.tab.o
  10515. --mconf: LDFLAGS = -Wl,--no-as-needed $(shell ./lxdialog/check-lxdialog.sh -ldflags $(CC))
  10516. --mconf: CFLAGS += -DCURSES_LOC="<ncurses.h>" -DLOCALE
  10517. -+mconf: LDFLAGS = $(shell ./lxdialog/check-lxdialog.sh -ldflags $(CC))
  10518. -+mconf: CFLAGS += -DCURSES_LOC="<ncurses.h>"
  10519. - mconf: mconf.o zconf.tab.o $(LXDIALOG)
  10520. -
  10521. - .PHONY: clean
  10522. diff --git a/package/mac80211/patches/001-fix_build.patch b/package/mac80211/patches/001-fix_build.patch
  10523. deleted file mode 100644
  10524. index c541985..0000000
  10525. --- a/package/mac80211/patches/001-fix_build.patch
  10526. +++ /dev/null
  10527. @@ -1,156 +0,0 @@
  10528. ---- a/Makefile
  10529. -+++ b/Makefile
  10530. -@@ -19,6 +19,7 @@ KLIB_BUILD ?= $(KLIB)/build/
  10531. - KERNEL_CONFIG := $(KLIB_BUILD)/.config
  10532. - KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
  10533. - CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
  10534. -+STAMP_KERNEL_CONFIG := .kernel_config_md5_$(CONFIG_MD5)
  10535. -
  10536. - export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG
  10537. -
  10538. -@@ -36,7 +37,8 @@ mrproper:
  10539. - @rm -f .kernel_config_md5 Kconfig.versions Kconfig.kernel
  10540. - @rm -f backport-include/backport/autoconf.h
  10541. -
  10542. --.DEFAULT:
  10543. -+.SILENT: $(STAMP_KERNEL_CONFIG)
  10544. -+$(STAMP_KERNEL_CONFIG):
  10545. - @set -e ; test -f .local-symbols || ( \
  10546. - echo "/--------------" ;\
  10547. - echo "| You shouldn't run make in the backports tree, but only in" ;\
  10548. -@@ -60,56 +62,60 @@ mrproper:
  10549. - echo "| (that isn't currently running.)" ;\
  10550. - echo "\\--" ;\
  10551. - false)
  10552. -- @set -e ; if [ "$$(cat .kernel_config_md5 2>/dev/null)" != "$(CONFIG_MD5)" ] ;\
  10553. -- then \
  10554. -- echo -n "Generating local configuration database from kernel ..." ;\
  10555. -- grep -v -f .local-symbols $(KERNEL_CONFIG) | grep = | ( \
  10556. -- while read l ; do \
  10557. -- if [ "$${l:0:7}" != "CONFIG_" ] ; then \
  10558. -- continue ;\
  10559. -- fi ;\
  10560. -- l=$${l:7} ;\
  10561. -- n=$${l%%=*} ;\
  10562. -- v=$${l#*=} ;\
  10563. -- if [ "$$v" = "m" ] ; then \
  10564. -- echo config $$n ;\
  10565. -- echo ' tristate' ;\
  10566. -- elif [ "$$v" = "y" ] ; then \
  10567. -- echo config $$n ;\
  10568. -- echo ' bool' ;\
  10569. -- else \
  10570. -- continue ;\
  10571. -- fi ;\
  10572. -- echo " default $$v" ;\
  10573. -- echo "" ;\
  10574. -- done \
  10575. -- ) > Kconfig.kernel ;\
  10576. -- kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \
  10577. -- sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\
  10578. -- test "$$kver" != "" || echo "Kernel version parse failed!" ;\
  10579. -- test "$$kver" != "" ;\
  10580. -- kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\
  10581. -- kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\
  10582. -- print=0 ;\
  10583. -- for v in $$kvers ; do \
  10584. -- if [ "$$print" = "1" ] ; then \
  10585. -- echo config BACKPORT_KERNEL_$$(echo $$v | tr . _) ;\
  10586. -- echo " def_bool y" ;\
  10587. -- fi ;\
  10588. -- if [ "$$v" = "$$kver" ] ; then print=1 ; fi ;\
  10589. -- done > Kconfig.versions ;\
  10590. -- # RHEL as well, sadly we need to grep for it ;\
  10591. -- RHEL_MAJOR=$$(grep '^RHEL_MAJOR' $(KERNEL_MAKEFILE) | \
  10592. -- sed 's/.*=\s*\([0-9]*\)/\1/;t;d') ;\
  10593. -- RHEL_MINOR=$$(grep '^RHEL_MINOR' $(KERNEL_MAKEFILE) | \
  10594. -- sed 's/.*=\s*\([0-9]*\)/\1/;t;d') ;\
  10595. -- for v in $$(seq 0 $$RHEL_MINOR) ; do \
  10596. -- echo config BACKPORT_RHEL_KERNEL_$${RHEL_MAJOR}_$$v ;\
  10597. -- echo " def_bool y" ;\
  10598. -- done >> Kconfig.versions ;\
  10599. -- echo " done." ;\
  10600. -- fi ;\
  10601. -- echo "$(CONFIG_MD5)" > .kernel_config_md5
  10602. -+ @rm -f .kernel_config_md5_*
  10603. -+ @touch $@
  10604. -+
  10605. -+Kconfig.kernel: $(STAMP_KERNEL_CONFIG) .local-symbols
  10606. -+ @printf "Generating local configuration database from kernel ..."
  10607. -+ @grep -v -f .local-symbols $(KERNEL_CONFIG) | grep = | ( \
  10608. -+ while read l ; do \
  10609. -+ if [ "$${l:0:7}" != "CONFIG_" ] ; then \
  10610. -+ continue ;\
  10611. -+ fi ;\
  10612. -+ l=$${l:7} ;\
  10613. -+ n=$${l%%=*} ;\
  10614. -+ v=$${l#*=} ;\
  10615. -+ if [ "$$v" = "m" ] ; then \
  10616. -+ echo config $$n ;\
  10617. -+ echo ' tristate' ;\
  10618. -+ elif [ "$$v" = "y" ] ; then \
  10619. -+ echo config $$n ;\
  10620. -+ echo ' bool' ;\
  10621. -+ else \
  10622. -+ continue ;\
  10623. -+ fi ;\
  10624. -+ echo " default $$v" ;\
  10625. -+ echo "" ;\
  10626. -+ done \
  10627. -+ ) > $@
  10628. -+ @echo " done."
  10629. -+
  10630. -+Kconfig.versions: Kconfig.kernel
  10631. -+ @kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion | \
  10632. -+ sed 's/^\(\(3\|2\.6\)\.[0-9]\+\).*/\1/;t;d') ;\
  10633. -+ test "$$kver" != "" || echo "Kernel version parse failed!" ;\
  10634. -+ test "$$kver" != "" ;\
  10635. -+ kvers="$$(seq 14 39 | sed 's/^/2.6./')" ;\
  10636. -+ kvers="$$kvers $$(seq 0 99 | sed 's/^/3./')" ;\
  10637. -+ print=0 ;\
  10638. -+ for v in $$kvers ; do \
  10639. -+ if [ "$$print" = "1" ] ; then \
  10640. -+ echo config BACKPORT_KERNEL_$$(echo $$v | tr . _) ;\
  10641. -+ echo " def_bool y" ;\
  10642. -+ fi ;\
  10643. -+ if [ "$$v" = "$$kver" ] ; then print=1 ; fi ;\
  10644. -+ done > $@
  10645. -+ @RHEL_MAJOR=$$(grep '^RHEL_MAJOR' $(KERNEL_MAKEFILE) | \
  10646. -+ sed 's/.*=\s*\([0-9]*\)/\1/;t;d') ;\
  10647. -+ RHEL_MINOR=$$(grep '^RHEL_MINOR' $(KERNEL_MAKEFILE) | \
  10648. -+ sed 's/.*=\s*\([0-9]*\)/\1/;t;d') ;\
  10649. -+ for v in $$(seq 0 $$RHEL_MINOR) ; do \
  10650. -+ echo config BACKPORT_RHEL_KERNEL_$${RHEL_MAJOR}_$$v ;\
  10651. -+ echo " def_bool y" ;\
  10652. -+ done >> $@
  10653. -+
  10654. -+.DEFAULT:
  10655. -+ @$(MAKE) Kconfig.versions
  10656. - @$(MAKE) -f Makefile.real "$@"
  10657. -
  10658. - else
  10659. ---- a/Makefile.real
  10660. -+++ b/Makefile.real
  10661. -@@ -54,7 +54,7 @@ defconfig-%::
  10662. -
  10663. - backport-include/backport/autoconf.h: .config Kconfig.versions Kconfig.kernel
  10664. - @$(MAKE) oldconfig
  10665. -- @echo -n "Building backport-include/backport/autoconf.h ..."
  10666. -+ @printf "Building backport-include/backport/autoconf.h ..."
  10667. - @grep -f .local-symbols .config | ( \
  10668. - echo "#ifndef COMPAT_AUTOCONF_INCLUDED" ;\
  10669. - echo "#define COMPAT_AUTOCONF_INCLUDED" ;\
  10670. -@@ -75,7 +75,12 @@ backport-include/backport/autoconf.h: .c
  10671. - esac ;\
  10672. - done ;\
  10673. - echo "#endif /* COMPAT_AUTOCONF_INCLUDED */" ;\
  10674. -- ) > backport-include/backport/autoconf.h
  10675. -+ ) > $@.new
  10676. -+ @if cmp -s $@ $@.new; then \
  10677. -+ rm -f $@.new; \
  10678. -+ else \
  10679. -+ mv $@.new $@; \
  10680. -+ fi
  10681. - @echo " done."
  10682. -
  10683. - .PHONY: modules
  10684. diff --git a/package/mac80211/patches/002-change_allconfig.patch b/package/mac80211/patches/002-change_allconfig.patch
  10685. deleted file mode 100644
  10686. index 91ad20f..0000000
  10687. --- a/package/mac80211/patches/002-change_allconfig.patch
  10688. +++ /dev/null
  10689. @@ -1,44 +0,0 @@
  10690. ---- a/kconf/conf.c
  10691. -+++ b/kconf/conf.c
  10692. -@@ -578,40 +578,12 @@ int main(int ac, char **av)
  10693. - case oldconfig:
  10694. - case listnewconfig:
  10695. - case olddefconfig:
  10696. -- conf_read(NULL);
  10697. -- break;
  10698. - case allnoconfig:
  10699. - case allyesconfig:
  10700. - case allmodconfig:
  10701. - case alldefconfig:
  10702. - case randconfig:
  10703. -- name = getenv("KCONFIG_ALLCONFIG");
  10704. -- if (!name)
  10705. -- break;
  10706. -- if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
  10707. -- if (conf_read_simple(name, S_DEF_USER)) {
  10708. -- fprintf(stderr,
  10709. -- _("*** Can't read seed configuration \"%s\"!\n"),
  10710. -- name);
  10711. -- exit(1);
  10712. -- }
  10713. -- break;
  10714. -- }
  10715. -- switch (input_mode) {
  10716. -- case allnoconfig: name = "allno.config"; break;
  10717. -- case allyesconfig: name = "allyes.config"; break;
  10718. -- case allmodconfig: name = "allmod.config"; break;
  10719. -- case alldefconfig: name = "alldef.config"; break;
  10720. -- case randconfig: name = "allrandom.config"; break;
  10721. -- default: break;
  10722. -- }
  10723. -- if (conf_read_simple(name, S_DEF_USER) &&
  10724. -- conf_read_simple("all.config", S_DEF_USER)) {
  10725. -- fprintf(stderr,
  10726. -- _("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
  10727. -- name);
  10728. -- exit(1);
  10729. -- }
  10730. -+ conf_read(NULL);
  10731. - break;
  10732. - default:
  10733. - break;
  10734. diff --git a/package/mac80211/patches/003-remove_bogus_modparams.patch b/package/mac80211/patches/003-remove_bogus_modparams.patch
  10735. deleted file mode 100644
  10736. index c969b19..0000000
  10737. --- a/package/mac80211/patches/003-remove_bogus_modparams.patch
  10738. +++ /dev/null
  10739. @@ -1,34 +0,0 @@
  10740. ---- a/compat/main.c
  10741. -+++ b/compat/main.c
  10742. -@@ -21,31 +21,6 @@ MODULE_LICENSE("GPL");
  10743. - #error "You need a BACKPORTS_VERSION"
  10744. - #endif
  10745. -
  10746. --static char *backported_kernel_name = BACKPORTED_KERNEL_NAME;
  10747. --
  10748. --module_param(backported_kernel_name, charp, 0400);
  10749. --MODULE_PARM_DESC(backported_kernel_name,
  10750. -- "The kernel tree name that was used for this backport (" BACKPORTED_KERNEL_NAME ")");
  10751. --
  10752. --#ifdef BACKPORTS_GIT_TRACKED
  10753. --static char *backports_tracker_id = BACKPORTS_GIT_TRACKED;
  10754. --module_param(backports_tracker_id, charp, 0400);
  10755. --MODULE_PARM_DESC(backports_tracker_id,
  10756. -- "The version of the tree containing this backport (" BACKPORTS_GIT_TRACKED ")");
  10757. --#else
  10758. --static char *backported_kernel_version = BACKPORTED_KERNEL_VERSION;
  10759. --static char *backports_version = BACKPORTS_VERSION;
  10760. --
  10761. --module_param(backported_kernel_version, charp, 0400);
  10762. --MODULE_PARM_DESC(backported_kernel_version,
  10763. -- "The kernel version that was used for this backport (" BACKPORTED_KERNEL_VERSION ")");
  10764. --
  10765. --module_param(backports_version, charp, 0400);
  10766. --MODULE_PARM_DESC(backports_version,
  10767. -- "The git version of the backports tree used to generate this backport (" BACKPORTS_VERSION ")");
  10768. --
  10769. --#endif
  10770. --
  10771. - void backport_dependency_symbol(void)
  10772. - {
  10773. - }
  10774. diff --git a/package/mac80211/patches/010-disable_rfkill.patch b/package/mac80211/patches/010-disable_rfkill.patch
  10775. deleted file mode 100644
  10776. index c5a92d6..0000000
  10777. --- a/package/mac80211/patches/010-disable_rfkill.patch
  10778. +++ /dev/null
  10779. @@ -1,13 +0,0 @@
  10780. ---- a/backport-include/linux/rfkill.h
  10781. -+++ b/backport-include/linux/rfkill.h
  10782. -@@ -2,6 +2,10 @@
  10783. - #define __COMPAT_RFKILL_H
  10784. - #include <linux/version.h>
  10785. -
  10786. -+#undef CONFIG_RFKILL
  10787. -+#undef CONFIG_RFKILL_LEDS
  10788. -+#undef CONFIG_RFKILL_MODULE
  10789. -+
  10790. - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
  10791. - #include_next <linux/rfkill.h>
  10792. - #else
  10793. diff --git a/package/mac80211/patches/020-disable_tty_set_termios.patch b/package/mac80211/patches/020-disable_tty_set_termios.patch
  10794. deleted file mode 100644
  10795. index 89c6a60..0000000
  10796. --- a/package/mac80211/patches/020-disable_tty_set_termios.patch
  10797. +++ /dev/null
  10798. @@ -1,16 +0,0 @@
  10799. ---- a/compat/compat-2.6.39.c
  10800. -+++ b/compat/compat-2.6.39.c
  10801. -@@ -13,6 +13,7 @@
  10802. - #include <linux/sched.h>
  10803. - #include <linux/module.h>
  10804. -
  10805. -+#ifdef CONFIG_COMPAT_BLUETOOTH
  10806. - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
  10807. - /*
  10808. - * Termios Helper Methods
  10809. -@@ -112,4 +113,4 @@ int tty_set_termios(struct tty_struct *t
  10810. - }
  10811. - EXPORT_SYMBOL_GPL(tty_set_termios);
  10812. - #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) */
  10813. --
  10814. -+#endif
  10815. diff --git a/package/mac80211/patches/030-rt2x00_options.patch b/package/mac80211/patches/030-rt2x00_options.patch
  10816. deleted file mode 100644
  10817. index 789a77a..0000000
  10818. --- a/package/mac80211/patches/030-rt2x00_options.patch
  10819. +++ /dev/null
  10820. @@ -1,36 +0,0 @@
  10821. ---- a/drivers/net/wireless/rt2x00/Kconfig
  10822. -+++ b/drivers/net/wireless/rt2x00/Kconfig
  10823. -@@ -202,25 +202,28 @@ config RT2800USB_UNKNOWN
  10824. - endif
  10825. -
  10826. - config RT2800_LIB
  10827. -- tristate
  10828. -+ tristate "RT2800 USB/PCI support"
  10829. - depends on m
  10830. -
  10831. - config RT2X00_LIB_MMIO
  10832. -- tristate
  10833. -+ tristate "RT2x00 MMIO support"
  10834. - depends on m
  10835. -
  10836. - config RT2X00_LIB_PCI
  10837. -- tristate
  10838. -+ tristate "RT2x00 PCI support"
  10839. -+ depends on PCI
  10840. - depends on m
  10841. - select RT2X00_LIB
  10842. -
  10843. - config RT2X00_LIB_SOC
  10844. -- tristate
  10845. -+ tristate "RT2x00 SoC support"
  10846. -+ depends on SOC_RT288X || SOC_RT305X
  10847. - depends on m
  10848. - select RT2X00_LIB
  10849. -
  10850. - config RT2X00_LIB_USB
  10851. -- tristate
  10852. -+ tristate "RT2x00 USB support"
  10853. -+ depends on USB
  10854. - depends on m
  10855. - select RT2X00_LIB
  10856. -
  10857. diff --git a/package/mac80211/patches/040-brcmutil_option.patch b/package/mac80211/patches/040-brcmutil_option.patch
  10858. deleted file mode 100644
  10859. index 8a6cae6..0000000
  10860. --- a/package/mac80211/patches/040-brcmutil_option.patch
  10861. +++ /dev/null
  10862. @@ -1,9 +0,0 @@
  10863. ---- a/drivers/net/wireless/brcm80211/Kconfig
  10864. -+++ b/drivers/net/wireless/brcm80211/Kconfig
  10865. -@@ -1,5 +1,5 @@
  10866. - config BRCMUTIL
  10867. -- tristate
  10868. -+ tristate "Broadcom 802.11 driver utility functions"
  10869. - depends on m
  10870. -
  10871. - config BRCMSMAC
  10872. diff --git a/package/mac80211/patches/050-lib80211_option.patch b/package/mac80211/patches/050-lib80211_option.patch
  10873. deleted file mode 100644
  10874. index 5372114..0000000
  10875. --- a/package/mac80211/patches/050-lib80211_option.patch
  10876. +++ /dev/null
  10877. @@ -1,30 +0,0 @@
  10878. ---- a/net/wireless/Kconfig
  10879. -+++ b/net/wireless/Kconfig
  10880. -@@ -123,7 +123,7 @@ config CFG80211_WEXT
  10881. - extensions with cfg80211-based drivers.
  10882. -
  10883. - config LIB80211
  10884. -- tristate
  10885. -+ tristate "lib80211"
  10886. - depends on m
  10887. - default n
  10888. - help
  10889. -@@ -133,15 +133,15 @@ config LIB80211
  10890. - Drivers should select this themselves if needed.
  10891. -
  10892. - config LIB80211_CRYPT_WEP
  10893. -- tristate
  10894. -+ tristate "lib80211 WEP support"
  10895. - depends on m
  10896. -
  10897. - config LIB80211_CRYPT_CCMP
  10898. -- tristate
  10899. -+ tristate "lib80211 CCMP support"
  10900. - depends on m
  10901. -
  10902. - config LIB80211_CRYPT_TKIP
  10903. -- tristate
  10904. -+ tristate "lib80211 TKIP support"
  10905. - depends on m
  10906. -
  10907. - config LIB80211_DEBUG
  10908. diff --git a/package/mac80211/patches/060-no_local_ssb_bcma.patch b/package/mac80211/patches/060-no_local_ssb_bcma.patch
  10909. deleted file mode 100644
  10910. index 5e8d421..0000000
  10911. --- a/package/mac80211/patches/060-no_local_ssb_bcma.patch
  10912. +++ /dev/null
  10913. @@ -1,129 +0,0 @@
  10914. ---- a/.local-symbols
  10915. -+++ b/.local-symbols
  10916. -@@ -363,42 +363,6 @@ USB_CDC_PHONET=
  10917. - USB_IPHETH=
  10918. - USB_SIERRA_NET=
  10919. - USB_VL600=
  10920. --SSB_POSSIBLE=
  10921. --SSB=
  10922. --SSB_SPROM=
  10923. --SSB_BLOCKIO=
  10924. --SSB_PCIHOST_POSSIBLE=
  10925. --SSB_PCIHOST=
  10926. --SSB_B43_PCI_BRIDGE=
  10927. --SSB_PCMCIAHOST_POSSIBLE=
  10928. --SSB_PCMCIAHOST=
  10929. --SSB_SDIOHOST_POSSIBLE=
  10930. --SSB_SDIOHOST=
  10931. --SSB_SILENT=
  10932. --SSB_DEBUG=
  10933. --SSB_SERIAL=
  10934. --SSB_DRIVER_PCICORE_POSSIBLE=
  10935. --SSB_DRIVER_PCICORE=
  10936. --SSB_PCICORE_HOSTMODE=
  10937. --SSB_DRIVER_MIPS=
  10938. --SSB_SFLASH=
  10939. --SSB_EMBEDDED=
  10940. --SSB_DRIVER_EXTIF=
  10941. --SSB_DRIVER_GIGE=
  10942. --SSB_DRIVER_GPIO=
  10943. --BCMA_POSSIBLE=
  10944. --BCMA=
  10945. --BCMA_BLOCKIO=
  10946. --BCMA_HOST_PCI_POSSIBLE=
  10947. --BCMA_HOST_PCI=
  10948. --BCMA_DRIVER_PCI_HOSTMODE=
  10949. --BCMA_HOST_SOC=
  10950. --BCMA_DRIVER_MIPS=
  10951. --BCMA_SFLASH=
  10952. --BCMA_NFLASH=
  10953. --BCMA_DRIVER_GMAC_CMN=
  10954. --BCMA_DRIVER_GPIO=
  10955. --BCMA_DEBUG=
  10956. - DRM=
  10957. - DRM_USB=
  10958. - DRM_KMS_HELPER=
  10959. ---- a/Kconfig
  10960. -+++ b/Kconfig
  10961. -@@ -33,9 +33,6 @@ source drivers/net/wireless/Kconfig
  10962. - source drivers/net/ethernet/Kconfig
  10963. - source drivers/net/usb/Kconfig
  10964. -
  10965. --source drivers/ssb/Kconfig
  10966. --source drivers/bcma/Kconfig
  10967. --
  10968. - source drivers/gpu/drm/Kconfig
  10969. -
  10970. - source net/nfc/Kconfig
  10971. ---- a/Makefile.kernel
  10972. -+++ b/Makefile.kernel
  10973. -@@ -26,8 +26,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/
  10974. - obj-$(CPTCFG_WLAN) += drivers/net/wireless/
  10975. - obj-$(CPTCFG_BT) += net/bluetooth/
  10976. - obj-$(CPTCFG_BT) += drivers/bluetooth/
  10977. --obj-$(CPTCFG_SSB) += drivers/ssb/
  10978. --obj-$(CPTCFG_BCMA) += drivers/bcma/
  10979. - obj-$(CPTCFG_ETHERNET) += drivers/net/ethernet/
  10980. - obj-$(CPTCFG_USB_NET_RNDIS_WLAN) += drivers/net/usb/
  10981. - obj-$(CPTCFG_DRM) += drivers/gpu/drm/
  10982. ---- a/drivers/net/wireless/b43/main.c
  10983. -+++ b/drivers/net/wireless/b43/main.c
  10984. -@@ -2729,7 +2729,7 @@ static struct ssb_device *b43_ssb_gpio_d
  10985. - {
  10986. - struct ssb_bus *bus = dev->dev->sdev->bus;
  10987. -
  10988. --#ifdef CPTCFG_SSB_DRIVER_PCICORE
  10989. -+#ifdef CONFIG_SSB_DRIVER_PCICORE
  10990. - return (bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev);
  10991. - #else
  10992. - return bus->chipco.dev;
  10993. -@@ -4735,7 +4735,7 @@ static int b43_wireless_core_init(struct
  10994. - }
  10995. - if (sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW)
  10996. - hf |= B43_HF_DSCRQ; /* Disable slowclock requests from ucode. */
  10997. --#ifdef CPTCFG_SSB_DRIVER_PCICORE
  10998. -+#ifdef CONFIG_SSB_DRIVER_PCICORE
  10999. - if (dev->dev->bus_type == B43_BUS_SSB &&
  11000. - dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI &&
  11001. - dev->dev->sdev->bus->pcicore.dev->id.revision <= 10)
  11002. ---- a/drivers/net/wireless/b43legacy/main.c
  11003. -+++ b/drivers/net/wireless/b43legacy/main.c
  11004. -@@ -1937,7 +1937,7 @@ static int b43legacy_gpio_init(struct b4
  11005. - if (dev->dev->id.revision >= 2)
  11006. - mask |= 0x0010; /* FIXME: This is redundant. */
  11007. -
  11008. --#ifdef CPTCFG_SSB_DRIVER_PCICORE
  11009. -+#ifdef CONFIG_SSB_DRIVER_PCICORE
  11010. - pcidev = bus->pcicore.dev;
  11011. - #endif
  11012. - gpiodev = bus->chipco.dev ? : pcidev;
  11013. -@@ -1956,7 +1956,7 @@ static void b43legacy_gpio_cleanup(struc
  11014. - struct ssb_bus *bus = dev->dev->bus;
  11015. - struct ssb_device *gpiodev, *pcidev = NULL;
  11016. -
  11017. --#ifdef CPTCFG_SSB_DRIVER_PCICORE
  11018. -+#ifdef CONFIG_SSB_DRIVER_PCICORE
  11019. - pcidev = bus->pcicore.dev;
  11020. - #endif
  11021. - gpiodev = bus->chipco.dev ? : pcidev;
  11022. ---- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile
  11023. -+++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile
  11024. -@@ -43,6 +43,6 @@ brcmsmac-y := \
  11025. - brcms_trace_events.o \
  11026. - debug.o
  11027. -
  11028. --brcmsmac-$(CPTCFG_BCMA_DRIVER_GPIO) += led.o
  11029. -+brcmsmac-$(CONFIG_BCMA_DRIVER_GPIO) += led.o
  11030. -
  11031. - obj-$(CPTCFG_BRCMSMAC) += brcmsmac.o
  11032. ---- a/drivers/net/wireless/brcm80211/brcmsmac/led.h
  11033. -+++ b/drivers/net/wireless/brcm80211/brcmsmac/led.h
  11034. -@@ -22,7 +22,7 @@ struct brcms_led {
  11035. - bool active_low;
  11036. - };
  11037. -
  11038. --#ifdef CPTCFG_BCMA_DRIVER_GPIO
  11039. -+#ifdef CONFIG_BCMA_DRIVER_GPIO
  11040. - void brcms_led_unregister(struct brcms_info *wl);
  11041. - int brcms_led_register(struct brcms_info *wl);
  11042. - #else
  11043. diff --git a/package/mac80211/patches/150-disable_addr_notifier.patch b/package/mac80211/patches/150-disable_addr_notifier.patch
  11044. deleted file mode 100644
  11045. index 92c1909..0000000
  11046. --- a/package/mac80211/patches/150-disable_addr_notifier.patch
  11047. +++ /dev/null
  11048. @@ -1,67 +0,0 @@
  11049. ---- a/net/mac80211/main.c
  11050. -+++ b/net/mac80211/main.c
  11051. -@@ -300,7 +300,7 @@ void ieee80211_restart_hw(struct ieee802
  11052. - }
  11053. - EXPORT_SYMBOL(ieee80211_restart_hw);
  11054. -
  11055. --#ifdef CONFIG_INET
  11056. -+#ifdef __disabled__CONFIG_INET
  11057. - static int ieee80211_ifa_changed(struct notifier_block *nb,
  11058. - unsigned long data, void *arg)
  11059. - {
  11060. -@@ -359,7 +359,7 @@ static int ieee80211_ifa_changed(struct
  11061. - }
  11062. - #endif
  11063. -
  11064. --#if IS_ENABLED(CONFIG_IPV6)
  11065. -+#if IS_ENABLED(__disabled__CONFIG_IPV6)
  11066. - static int ieee80211_ifa6_changed(struct notifier_block *nb,
  11067. - unsigned long data, void *arg)
  11068. - {
  11069. -@@ -990,14 +990,14 @@ int ieee80211_register_hw(struct ieee802
  11070. - goto fail_pm_qos;
  11071. - }
  11072. -
  11073. --#ifdef CONFIG_INET
  11074. -+#ifdef __disabled__CONFIG_INET
  11075. - local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
  11076. - result = register_inetaddr_notifier(&local->ifa_notifier);
  11077. - if (result)
  11078. - goto fail_ifa;
  11079. - #endif
  11080. -
  11081. --#if IS_ENABLED(CONFIG_IPV6)
  11082. -+#if IS_ENABLED(__disabled__CONFIG_IPV6)
  11083. - local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  11084. - result = register_inet6addr_notifier(&local->ifa6_notifier);
  11085. - if (result)
  11086. -@@ -1006,13 +1006,13 @@ int ieee80211_register_hw(struct ieee802
  11087. -
  11088. - return 0;
  11089. -
  11090. --#if IS_ENABLED(CONFIG_IPV6)
  11091. -+#if IS_ENABLED(__disabled__CONFIG_IPV6)
  11092. - fail_ifa6:
  11093. --#ifdef CONFIG_INET
  11094. -+#ifdef __disabled__CONFIG_INET
  11095. - unregister_inetaddr_notifier(&local->ifa_notifier);
  11096. - #endif
  11097. - #endif
  11098. --#if defined(CONFIG_INET) || defined(CONFIG_IPV6)
  11099. -+#if defined(__disabled__CONFIG_INET) || defined(__disabled__CONFIG_IPV6)
  11100. - fail_ifa:
  11101. - pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
  11102. - &local->network_latency_notifier);
  11103. -@@ -1045,10 +1045,10 @@ void ieee80211_unregister_hw(struct ieee
  11104. -
  11105. - pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
  11106. - &local->network_latency_notifier);
  11107. --#ifdef CONFIG_INET
  11108. -+#ifdef __disabled__CONFIG_INET
  11109. - unregister_inetaddr_notifier(&local->ifa_notifier);
  11110. - #endif
  11111. --#if IS_ENABLED(CONFIG_IPV6)
  11112. -+#if IS_ENABLED(__disabled__CONFIG_IPV6)
  11113. - unregister_inet6addr_notifier(&local->ifa6_notifier);
  11114. - #endif
  11115. -
  11116. diff --git a/package/mac80211/patches/200-ath5k_pci_dependency.patch b/package/mac80211/patches/200-ath5k_pci_dependency.patch
  11117. deleted file mode 100644
  11118. index 2d99b4a..0000000
  11119. --- a/package/mac80211/patches/200-ath5k_pci_dependency.patch
  11120. +++ /dev/null
  11121. @@ -1,11 +0,0 @@
  11122. ---- a/drivers/net/wireless/ath/ath5k/Kconfig
  11123. -+++ b/drivers/net/wireless/ath/ath5k/Kconfig
  11124. -@@ -55,7 +55,7 @@ config ATH5K_TRACER
  11125. -
  11126. - config ATH5K_AHB
  11127. - bool "Atheros 5xxx AHB bus support"
  11128. -- depends on (ATHEROS_AR231X && !PCI)
  11129. -+ depends on ATHEROS_AR231X
  11130. - ---help---
  11131. - This adds support for WiSoC type chipsets of the 5xxx Atheros
  11132. - family.
  11133. diff --git a/package/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch b/package/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
  11134. deleted file mode 100644
  11135. index d9672d4..0000000
  11136. --- a/package/mac80211/patches/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
  11137. +++ /dev/null
  11138. @@ -1,38 +0,0 @@
  11139. ---- a/drivers/net/wireless/ath/ath5k/initvals.c
  11140. -+++ b/drivers/net/wireless/ath/ath5k/initvals.c
  11141. -@@ -62,8 +62,14 @@ static const struct ath5k_ini ar5210_ini
  11142. - { AR5K_IMR, 0 },
  11143. - { AR5K_IER, AR5K_IER_DISABLE },
  11144. - { AR5K_BSR, 0, AR5K_INI_READ },
  11145. -+#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
  11146. - { AR5K_TXCFG, AR5K_DMASIZE_128B },
  11147. - { AR5K_RXCFG, AR5K_DMASIZE_128B },
  11148. -+#else
  11149. -+ /* WAR for AR71xx PCI bug */
  11150. -+ { AR5K_TXCFG, AR5K_DMASIZE_128B },
  11151. -+ { AR5K_RXCFG, AR5K_DMASIZE_4B },
  11152. -+#endif
  11153. - { AR5K_CFG, AR5K_INIT_CFG },
  11154. - { AR5K_TOPS, 8 },
  11155. - { AR5K_RXNOFRM, 8 },
  11156. ---- a/drivers/net/wireless/ath/ath5k/dma.c
  11157. -+++ b/drivers/net/wireless/ath/ath5k/dma.c
  11158. -@@ -860,10 +860,18 @@ ath5k_hw_dma_init(struct ath5k_hw *ah)
  11159. - * guess we can tweak it and see how it goes ;-)
  11160. - */
  11161. - if (ah->ah_version != AR5K_AR5210) {
  11162. -+#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
  11163. - AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
  11164. - AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
  11165. - AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
  11166. - AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_128B);
  11167. -+#else
  11168. -+ /* WAR for AR71xx PCI bug */
  11169. -+ AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
  11170. -+ AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
  11171. -+ AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
  11172. -+ AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_4B);
  11173. -+#endif
  11174. - }
  11175. -
  11176. - /* Pre-enable interrupts on 5211/5212*/
  11177. diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch
  11178. deleted file mode 100644
  11179. index 73f440b..0000000
  11180. --- a/package/mac80211/patches/300-pending_work.patch
  11181. +++ /dev/null
  11182. @@ -1,1234 +0,0 @@
  11183. ---- a/net/mac80211/agg-rx.c
  11184. -+++ b/net/mac80211/agg-rx.c
  11185. -@@ -204,6 +204,8 @@ static void ieee80211_send_addba_resp(st
  11186. - memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
  11187. - else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  11188. - memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
  11189. -+ else if (sdata->vif.type == NL80211_IFTYPE_WDS)
  11190. -+ memcpy(mgmt->bssid, da, ETH_ALEN);
  11191. -
  11192. - mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
  11193. - IEEE80211_STYPE_ACTION);
  11194. ---- a/net/mac80211/agg-tx.c
  11195. -+++ b/net/mac80211/agg-tx.c
  11196. -@@ -81,7 +81,8 @@ static void ieee80211_send_addba_request
  11197. - memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
  11198. - if (sdata->vif.type == NL80211_IFTYPE_AP ||
  11199. - sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
  11200. -- sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
  11201. -+ sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
  11202. -+ sdata->vif.type == NL80211_IFTYPE_WDS)
  11203. - memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
  11204. - else if (sdata->vif.type == NL80211_IFTYPE_STATION)
  11205. - memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
  11206. -@@ -527,6 +528,7 @@ int ieee80211_start_tx_ba_session(struct
  11207. - sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
  11208. - sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
  11209. - sdata->vif.type != NL80211_IFTYPE_AP &&
  11210. -+ sdata->vif.type != NL80211_IFTYPE_WDS &&
  11211. - sdata->vif.type != NL80211_IFTYPE_ADHOC)
  11212. - return -EINVAL;
  11213. -
  11214. ---- a/net/mac80211/debugfs_sta.c
  11215. -+++ b/net/mac80211/debugfs_sta.c
  11216. -@@ -66,11 +66,11 @@ static ssize_t sta_flags_read(struct fil
  11217. - test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : ""
  11218. -
  11219. - int res = scnprintf(buf, sizeof(buf),
  11220. -- "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
  11221. -+ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
  11222. - TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
  11223. - TEST(PS_DRIVER), TEST(AUTHORIZED),
  11224. - TEST(SHORT_PREAMBLE),
  11225. -- TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT),
  11226. -+ TEST(WME), TEST(CLEAR_PS_FILT),
  11227. - TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
  11228. - TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
  11229. - TEST(TDLS_PEER_AUTH), TEST(4ADDR_EVENT),
  11230. ---- a/net/mac80211/iface.c
  11231. -+++ b/net/mac80211/iface.c
  11232. -@@ -463,7 +463,6 @@ int ieee80211_do_open(struct wireless_de
  11233. - struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
  11234. - struct net_device *dev = wdev->netdev;
  11235. - struct ieee80211_local *local = sdata->local;
  11236. -- struct sta_info *sta;
  11237. - u32 changed = 0;
  11238. - int res;
  11239. - u32 hw_reconf_flags = 0;
  11240. -@@ -629,30 +628,8 @@ int ieee80211_do_open(struct wireless_de
  11241. -
  11242. - set_bit(SDATA_STATE_RUNNING, &sdata->state);
  11243. -
  11244. -- if (sdata->vif.type == NL80211_IFTYPE_WDS) {
  11245. -- /* Create STA entry for the WDS peer */
  11246. -- sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
  11247. -- GFP_KERNEL);
  11248. -- if (!sta) {
  11249. -- res = -ENOMEM;
  11250. -- goto err_del_interface;
  11251. -- }
  11252. --
  11253. -- sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
  11254. -- sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
  11255. -- sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED);
  11256. --
  11257. -- res = sta_info_insert(sta);
  11258. -- if (res) {
  11259. -- /* STA has been freed */
  11260. -- goto err_del_interface;
  11261. -- }
  11262. --
  11263. -- rate_control_rate_init(sta);
  11264. -- netif_carrier_on(dev);
  11265. -- } else if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) {
  11266. -+ if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE)
  11267. - rcu_assign_pointer(local->p2p_sdata, sdata);
  11268. -- }
  11269. -
  11270. - /*
  11271. - * set_multicast_list will be invoked by the networking core
  11272. -@@ -1116,6 +1093,74 @@ static void ieee80211_if_setup(struct ne
  11273. - dev->destructor = free_netdev;
  11274. - }
  11275. -
  11276. -+static void ieee80211_wds_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
  11277. -+ struct sk_buff *skb)
  11278. -+{
  11279. -+ struct ieee80211_local *local = sdata->local;
  11280. -+ struct ieee80211_rx_status *rx_status;
  11281. -+ struct ieee802_11_elems elems;
  11282. -+ struct ieee80211_mgmt *mgmt;
  11283. -+ struct sta_info *sta;
  11284. -+ size_t baselen;
  11285. -+ u32 rates = 0;
  11286. -+ u16 stype;
  11287. -+ bool new = false;
  11288. -+ enum ieee80211_band band;
  11289. -+ struct ieee80211_supported_band *sband;
  11290. -+
  11291. -+ rx_status = IEEE80211_SKB_RXCB(skb);
  11292. -+ band = rx_status->band;
  11293. -+ sband = local->hw.wiphy->bands[band];
  11294. -+ mgmt = (struct ieee80211_mgmt *) skb->data;
  11295. -+ stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
  11296. -+
  11297. -+ if (stype != IEEE80211_STYPE_BEACON)
  11298. -+ return;
  11299. -+
  11300. -+ baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
  11301. -+ if (baselen > skb->len)
  11302. -+ return;
  11303. -+
  11304. -+ ieee802_11_parse_elems(mgmt->u.probe_resp.variable,
  11305. -+ skb->len - baselen, false, &elems);
  11306. -+
  11307. -+ rates = ieee80211_sta_get_rates(local, &elems, band, NULL);
  11308. -+
  11309. -+ rcu_read_lock();
  11310. -+
  11311. -+ sta = sta_info_get(sdata, sdata->u.wds.remote_addr);
  11312. -+
  11313. -+ if (!sta) {
  11314. -+ rcu_read_unlock();
  11315. -+ sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
  11316. -+ GFP_KERNEL);
  11317. -+ if (!sta)
  11318. -+ return;
  11319. -+
  11320. -+ new = true;
  11321. -+ }
  11322. -+
  11323. -+ sta->last_rx = jiffies;
  11324. -+ sta->sta.supp_rates[band] = rates;
  11325. -+
  11326. -+ if (elems.ht_cap_elem)
  11327. -+ ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
  11328. -+ elems.ht_cap_elem, sta);
  11329. -+
  11330. -+ if (elems.wmm_param)
  11331. -+ set_sta_flag(sta, WLAN_STA_WME);
  11332. -+
  11333. -+ if (new) {
  11334. -+ sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
  11335. -+ sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
  11336. -+ sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED);
  11337. -+ rate_control_rate_init(sta);
  11338. -+ sta_info_insert_rcu(sta);
  11339. -+ }
  11340. -+
  11341. -+ rcu_read_unlock();
  11342. -+}
  11343. -+
  11344. - static void ieee80211_iface_work(struct work_struct *work)
  11345. - {
  11346. - struct ieee80211_sub_if_data *sdata =
  11347. -@@ -1220,6 +1265,9 @@ static void ieee80211_iface_work(struct
  11348. - break;
  11349. - ieee80211_mesh_rx_queued_mgmt(sdata, skb);
  11350. - break;
  11351. -+ case NL80211_IFTYPE_WDS:
  11352. -+ ieee80211_wds_rx_queued_mgmt(sdata, skb);
  11353. -+ break;
  11354. - default:
  11355. - WARN(1, "frame for unexpected interface type");
  11356. - break;
  11357. ---- a/net/mac80211/rc80211_minstrel_ht.c
  11358. -+++ b/net/mac80211/rc80211_minstrel_ht.c
  11359. -@@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct
  11360. -
  11361. - sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES];
  11362. - info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
  11363. -+ rate->count = 1;
  11364. -+
  11365. -+ if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) {
  11366. -+ int idx = sample_idx % ARRAY_SIZE(mp->cck_rates);
  11367. -+ rate->idx = mp->cck_rates[idx];
  11368. -+ rate->flags = 0;
  11369. -+ return;
  11370. -+ }
  11371. -+
  11372. - rate->idx = sample_idx % MCS_GROUP_RATES +
  11373. - (sample_group->streams - 1) * MCS_GROUP_RATES;
  11374. - rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags;
  11375. -- rate->count = 1;
  11376. - }
  11377. -
  11378. - static void
  11379. ---- a/net/mac80211/rx.c
  11380. -+++ b/net/mac80211/rx.c
  11381. -@@ -936,8 +936,14 @@ ieee80211_rx_h_check(struct ieee80211_rx
  11382. - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
  11383. - struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
  11384. -
  11385. -- /* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */
  11386. -- if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) {
  11387. -+ /*
  11388. -+ * Drop duplicate 802.11 retransmissions
  11389. -+ * (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery")
  11390. -+ */
  11391. -+ if (rx->skb->len >= 24 && rx->sta &&
  11392. -+ !ieee80211_is_ctl(hdr->frame_control) &&
  11393. -+ !ieee80211_is_qos_nullfunc(hdr->frame_control) &&
  11394. -+ !is_multicast_ether_addr(hdr->addr1)) {
  11395. - if (unlikely(ieee80211_has_retry(hdr->frame_control) &&
  11396. - rx->sta->last_seq_ctrl[rx->seqno_idx] ==
  11397. - hdr->seq_ctrl)) {
  11398. -@@ -2369,6 +2375,7 @@ ieee80211_rx_h_action(struct ieee80211_r
  11399. - sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
  11400. - sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
  11401. - sdata->vif.type != NL80211_IFTYPE_AP &&
  11402. -+ sdata->vif.type != NL80211_IFTYPE_WDS &&
  11403. - sdata->vif.type != NL80211_IFTYPE_ADHOC)
  11404. - break;
  11405. -
  11406. -@@ -2720,14 +2727,15 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
  11407. -
  11408. - if (!ieee80211_vif_is_mesh(&sdata->vif) &&
  11409. - sdata->vif.type != NL80211_IFTYPE_ADHOC &&
  11410. -- sdata->vif.type != NL80211_IFTYPE_STATION)
  11411. -+ sdata->vif.type != NL80211_IFTYPE_STATION &&
  11412. -+ sdata->vif.type != NL80211_IFTYPE_WDS)
  11413. - return RX_DROP_MONITOR;
  11414. -
  11415. - switch (stype) {
  11416. - case cpu_to_le16(IEEE80211_STYPE_AUTH):
  11417. - case cpu_to_le16(IEEE80211_STYPE_BEACON):
  11418. - case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
  11419. -- /* process for all: mesh, mlme, ibss */
  11420. -+ /* process for all: mesh, mlme, ibss, wds */
  11421. - break;
  11422. - case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
  11423. - case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
  11424. -@@ -3008,6 +3016,9 @@ static int prepare_for_handlers(struct i
  11425. - case NL80211_IFTYPE_ADHOC:
  11426. - if (!bssid)
  11427. - return 0;
  11428. -+ if (ether_addr_equal(sdata->vif.addr, hdr->addr2) ||
  11429. -+ ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2))
  11430. -+ return 0;
  11431. - if (ieee80211_is_beacon(hdr->frame_control)) {
  11432. - return 1;
  11433. - } else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) {
  11434. -@@ -3059,10 +3070,16 @@ static int prepare_for_handlers(struct i
  11435. - }
  11436. - break;
  11437. - case NL80211_IFTYPE_WDS:
  11438. -- if (bssid || !ieee80211_is_data(hdr->frame_control))
  11439. -- return 0;
  11440. - if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2))
  11441. - return 0;
  11442. -+
  11443. -+ if (ieee80211_is_data(hdr->frame_control) ||
  11444. -+ ieee80211_is_action(hdr->frame_control)) {
  11445. -+ if (compare_ether_addr(sdata->vif.addr, hdr->addr1))
  11446. -+ return 0;
  11447. -+ } else if (!ieee80211_is_beacon(hdr->frame_control))
  11448. -+ return 0;
  11449. -+
  11450. - break;
  11451. - case NL80211_IFTYPE_P2P_DEVICE:
  11452. - if (!ieee80211_is_public_action(hdr, skb->len) &&
  11453. ---- a/net/mac80211/sta_info.h
  11454. -+++ b/net/mac80211/sta_info.h
  11455. -@@ -32,7 +32,6 @@
  11456. - * @WLAN_STA_SHORT_PREAMBLE: Station is capable of receiving short-preamble
  11457. - * frames.
  11458. - * @WLAN_STA_WME: Station is a QoS-STA.
  11459. -- * @WLAN_STA_WDS: Station is one of our WDS peers.
  11460. - * @WLAN_STA_CLEAR_PS_FILT: Clear PS filter in hardware (using the
  11461. - * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
  11462. - * frame to this station is transmitted.
  11463. -@@ -66,7 +65,6 @@ enum ieee80211_sta_info_flags {
  11464. - WLAN_STA_AUTHORIZED,
  11465. - WLAN_STA_SHORT_PREAMBLE,
  11466. - WLAN_STA_WME,
  11467. -- WLAN_STA_WDS,
  11468. - WLAN_STA_CLEAR_PS_FILT,
  11469. - WLAN_STA_MFP,
  11470. - WLAN_STA_BLOCK_BA,
  11471. ---- a/drivers/net/wireless/ath/ath9k/xmit.c
  11472. -+++ b/drivers/net/wireless/ath/ath9k/xmit.c
  11473. -@@ -146,6 +146,28 @@ static void ath_set_rates(struct ieee802
  11474. - ARRAY_SIZE(bf->rates));
  11475. - }
  11476. -
  11477. -+static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
  11478. -+ struct sk_buff *skb)
  11479. -+{
  11480. -+ int q;
  11481. -+
  11482. -+ q = skb_get_queue_mapping(skb);
  11483. -+ if (txq == sc->tx.uapsdq)
  11484. -+ txq = sc->tx.txq_map[q];
  11485. -+
  11486. -+ if (txq != sc->tx.txq_map[q])
  11487. -+ return;
  11488. -+
  11489. -+ if (WARN_ON(--txq->pending_frames < 0))
  11490. -+ txq->pending_frames = 0;
  11491. -+
  11492. -+ if (txq->stopped &&
  11493. -+ txq->pending_frames < sc->tx.txq_max_pending[q]) {
  11494. -+ ieee80211_wake_queue(sc->hw, q);
  11495. -+ txq->stopped = false;
  11496. -+ }
  11497. -+}
  11498. -+
  11499. - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
  11500. - {
  11501. - struct ath_txq *txq = tid->ac->txq;
  11502. -@@ -167,6 +189,7 @@ static void ath_tx_flush_tid(struct ath_
  11503. - if (!bf) {
  11504. - bf = ath_tx_setup_buffer(sc, txq, tid, skb);
  11505. - if (!bf) {
  11506. -+ ath_txq_skb_done(sc, txq, skb);
  11507. - ieee80211_free_txskb(sc->hw, skb);
  11508. - continue;
  11509. - }
  11510. -@@ -811,6 +834,7 @@ ath_tx_get_tid_subframe(struct ath_softc
  11511. -
  11512. - if (!bf) {
  11513. - __skb_unlink(skb, &tid->buf_q);
  11514. -+ ath_txq_skb_done(sc, txq, skb);
  11515. - ieee80211_free_txskb(sc->hw, skb);
  11516. - continue;
  11517. - }
  11518. -@@ -1824,6 +1848,7 @@ static void ath_tx_send_ampdu(struct ath
  11519. -
  11520. - bf = ath_tx_setup_buffer(sc, txq, tid, skb);
  11521. - if (!bf) {
  11522. -+ ath_txq_skb_done(sc, txq, skb);
  11523. - ieee80211_free_txskb(sc->hw, skb);
  11524. - return;
  11525. - }
  11526. -@@ -2090,6 +2115,7 @@ int ath_tx_start(struct ieee80211_hw *hw
  11527. -
  11528. - bf = ath_tx_setup_buffer(sc, txq, tid, skb);
  11529. - if (!bf) {
  11530. -+ ath_txq_skb_done(sc, txq, skb);
  11531. - if (txctl->paprd)
  11532. - dev_kfree_skb_any(skb);
  11533. - else
  11534. -@@ -2189,7 +2215,7 @@ static void ath_tx_complete(struct ath_s
  11535. - struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
  11536. - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  11537. - struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data;
  11538. -- int q, padpos, padsize;
  11539. -+ int padpos, padsize;
  11540. - unsigned long flags;
  11541. -
  11542. - ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb);
  11543. -@@ -2225,21 +2251,7 @@ static void ath_tx_complete(struct ath_s
  11544. - spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
  11545. -
  11546. - __skb_queue_tail(&txq->complete_q, skb);
  11547. --
  11548. -- q = skb_get_queue_mapping(skb);
  11549. -- if (txq == sc->tx.uapsdq)
  11550. -- txq = sc->tx.txq_map[q];
  11551. --
  11552. -- if (txq == sc->tx.txq_map[q]) {
  11553. -- if (WARN_ON(--txq->pending_frames < 0))
  11554. -- txq->pending_frames = 0;
  11555. --
  11556. -- if (txq->stopped &&
  11557. -- txq->pending_frames < sc->tx.txq_max_pending[q]) {
  11558. -- ieee80211_wake_queue(sc->hw, q);
  11559. -- txq->stopped = false;
  11560. -- }
  11561. -- }
  11562. -+ ath_txq_skb_done(sc, txq, skb);
  11563. - }
  11564. -
  11565. - static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
  11566. ---- a/drivers/net/wireless/ath/ath9k/main.c
  11567. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  11568. -@@ -209,6 +209,7 @@ static bool ath_complete_reset(struct at
  11569. - struct ath_hw *ah = sc->sc_ah;
  11570. - struct ath_common *common = ath9k_hw_common(ah);
  11571. - unsigned long flags;
  11572. -+ int i;
  11573. -
  11574. - if (ath_startrecv(sc) != 0) {
  11575. - ath_err(common, "Unable to restart recv logic\n");
  11576. -@@ -236,6 +237,15 @@ static bool ath_complete_reset(struct at
  11577. - }
  11578. - work:
  11579. - ath_restart_work(sc);
  11580. -+
  11581. -+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  11582. -+ if (!ATH_TXQ_SETUP(sc, i))
  11583. -+ continue;
  11584. -+
  11585. -+ spin_lock_bh(&sc->tx.txq[i].axq_lock);
  11586. -+ ath_txq_schedule(sc, &sc->tx.txq[i]);
  11587. -+ spin_unlock_bh(&sc->tx.txq[i].axq_lock);
  11588. -+ }
  11589. - }
  11590. -
  11591. - if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3)
  11592. -@@ -543,21 +553,10 @@ chip_reset:
  11593. -
  11594. - static int ath_reset(struct ath_softc *sc)
  11595. - {
  11596. -- int i, r;
  11597. -+ int r;
  11598. -
  11599. - ath9k_ps_wakeup(sc);
  11600. --
  11601. - r = ath_reset_internal(sc, NULL);
  11602. --
  11603. -- for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  11604. -- if (!ATH_TXQ_SETUP(sc, i))
  11605. -- continue;
  11606. --
  11607. -- spin_lock_bh(&sc->tx.txq[i].axq_lock);
  11608. -- ath_txq_schedule(sc, &sc->tx.txq[i]);
  11609. -- spin_unlock_bh(&sc->tx.txq[i].axq_lock);
  11610. -- }
  11611. --
  11612. - ath9k_ps_restore(sc);
  11613. -
  11614. - return r;
  11615. -@@ -2094,7 +2093,7 @@ static void ath9k_wow_add_pattern(struct
  11616. - {
  11617. - struct ath_hw *ah = sc->sc_ah;
  11618. - struct ath9k_wow_pattern *wow_pattern = NULL;
  11619. -- struct cfg80211_wowlan_trig_pkt_pattern *patterns = wowlan->patterns;
  11620. -+ struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
  11621. - int mask_len;
  11622. - s8 i = 0;
  11623. -
  11624. ---- a/drivers/net/wireless/mwifiex/cfg80211.c
  11625. -+++ b/drivers/net/wireless/mwifiex/cfg80211.c
  11626. -@@ -2298,8 +2298,7 @@ EXPORT_SYMBOL_GPL(mwifiex_del_virtual_in
  11627. -
  11628. - #ifdef CONFIG_PM
  11629. - static bool
  11630. --mwifiex_is_pattern_supported(struct cfg80211_wowlan_trig_pkt_pattern *pat,
  11631. -- s8 *byte_seq)
  11632. -+mwifiex_is_pattern_supported(struct cfg80211_pkt_pattern *pat, s8 *byte_seq)
  11633. - {
  11634. - int j, k, valid_byte_cnt = 0;
  11635. - bool dont_care_byte = false;
  11636. ---- a/drivers/net/wireless/ti/wlcore/main.c
  11637. -+++ b/drivers/net/wireless/ti/wlcore/main.c
  11638. -@@ -1315,7 +1315,7 @@ static struct sk_buff *wl12xx_alloc_dumm
  11639. -
  11640. - #ifdef CONFIG_PM
  11641. - static int
  11642. --wl1271_validate_wowlan_pattern(struct cfg80211_wowlan_trig_pkt_pattern *p)
  11643. -+wl1271_validate_wowlan_pattern(struct cfg80211_pkt_pattern *p)
  11644. - {
  11645. - int num_fields = 0, in_field = 0, fields_size = 0;
  11646. - int i, pattern_len = 0;
  11647. -@@ -1458,9 +1458,9 @@ void wl1271_rx_filter_flatten_fields(str
  11648. - * Allocates an RX filter returned through f
  11649. - * which needs to be freed using rx_filter_free()
  11650. - */
  11651. --static int wl1271_convert_wowlan_pattern_to_rx_filter(
  11652. -- struct cfg80211_wowlan_trig_pkt_pattern *p,
  11653. -- struct wl12xx_rx_filter **f)
  11654. -+static int
  11655. -+wl1271_convert_wowlan_pattern_to_rx_filter(struct cfg80211_pkt_pattern *p,
  11656. -+ struct wl12xx_rx_filter **f)
  11657. - {
  11658. - int i, j, ret = 0;
  11659. - struct wl12xx_rx_filter *filter;
  11660. -@@ -1562,7 +1562,7 @@ static int wl1271_configure_wowlan(struc
  11661. -
  11662. - /* Translate WoWLAN patterns into filters */
  11663. - for (i = 0; i < wow->n_patterns; i++) {
  11664. -- struct cfg80211_wowlan_trig_pkt_pattern *p;
  11665. -+ struct cfg80211_pkt_pattern *p;
  11666. - struct wl12xx_rx_filter *filter = NULL;
  11667. -
  11668. - p = &wow->patterns[i];
  11669. ---- a/include/net/cfg80211.h
  11670. -+++ b/include/net/cfg80211.h
  11671. -@@ -1698,7 +1698,7 @@ struct cfg80211_pmksa {
  11672. - };
  11673. -
  11674. - /**
  11675. -- * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern
  11676. -+ * struct cfg80211_pkt_pattern - packet pattern
  11677. - * @mask: bitmask where to match pattern and where to ignore bytes,
  11678. - * one bit per byte, in same format as nl80211
  11679. - * @pattern: bytes to match where bitmask is 1
  11680. -@@ -1708,7 +1708,7 @@ struct cfg80211_pmksa {
  11681. - * Internal note: @mask and @pattern are allocated in one chunk of
  11682. - * memory, free @mask only!
  11683. - */
  11684. --struct cfg80211_wowlan_trig_pkt_pattern {
  11685. -+struct cfg80211_pkt_pattern {
  11686. - u8 *mask, *pattern;
  11687. - int pattern_len;
  11688. - int pkt_offset;
  11689. -@@ -1770,7 +1770,7 @@ struct cfg80211_wowlan {
  11690. - bool any, disconnect, magic_pkt, gtk_rekey_failure,
  11691. - eap_identity_req, four_way_handshake,
  11692. - rfkill_release;
  11693. -- struct cfg80211_wowlan_trig_pkt_pattern *patterns;
  11694. -+ struct cfg80211_pkt_pattern *patterns;
  11695. - struct cfg80211_wowlan_tcp *tcp;
  11696. - int n_patterns;
  11697. - };
  11698. ---- a/include/uapi/linux/nl80211.h
  11699. -+++ b/include/uapi/linux/nl80211.h
  11700. -@@ -3060,11 +3060,11 @@ enum nl80211_tx_power_setting {
  11701. - };
  11702. -
  11703. - /**
  11704. -- * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute
  11705. -- * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute
  11706. -- * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has
  11707. -+ * enum nl80211_packet_pattern_attr - packet pattern attribute
  11708. -+ * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
  11709. -+ * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
  11710. - * a zero bit are ignored
  11711. -- * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have
  11712. -+ * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
  11713. - * a bit for each byte in the pattern. The lowest-order bit corresponds
  11714. - * to the first byte of the pattern, but the bytes of the pattern are
  11715. - * in a little-endian-like format, i.e. the 9th byte of the pattern
  11716. -@@ -3075,23 +3075,23 @@ enum nl80211_tx_power_setting {
  11717. - * Note that the pattern matching is done as though frames were not
  11718. - * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
  11719. - * first (including SNAP header unpacking) and then matched.
  11720. -- * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after
  11721. -+ * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
  11722. - * these fixed number of bytes of received packet
  11723. -- * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
  11724. -- * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
  11725. -+ * @NUM_NL80211_PKTPAT: number of attributes
  11726. -+ * @MAX_NL80211_PKTPAT: max attribute number
  11727. - */
  11728. --enum nl80211_wowlan_packet_pattern_attr {
  11729. -- __NL80211_WOWLAN_PKTPAT_INVALID,
  11730. -- NL80211_WOWLAN_PKTPAT_MASK,
  11731. -- NL80211_WOWLAN_PKTPAT_PATTERN,
  11732. -- NL80211_WOWLAN_PKTPAT_OFFSET,
  11733. -+enum nl80211_packet_pattern_attr {
  11734. -+ __NL80211_PKTPAT_INVALID,
  11735. -+ NL80211_PKTPAT_MASK,
  11736. -+ NL80211_PKTPAT_PATTERN,
  11737. -+ NL80211_PKTPAT_OFFSET,
  11738. -
  11739. -- NUM_NL80211_WOWLAN_PKTPAT,
  11740. -- MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
  11741. -+ NUM_NL80211_PKTPAT,
  11742. -+ MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
  11743. - };
  11744. -
  11745. - /**
  11746. -- * struct nl80211_wowlan_pattern_support - pattern support information
  11747. -+ * struct nl80211_pattern_support - packet pattern support information
  11748. - * @max_patterns: maximum number of patterns supported
  11749. - * @min_pattern_len: minimum length of each pattern
  11750. - * @max_pattern_len: maximum length of each pattern
  11751. -@@ -3101,13 +3101,22 @@ enum nl80211_wowlan_packet_pattern_attr
  11752. - * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
  11753. - * capability information given by the kernel to userspace.
  11754. - */
  11755. --struct nl80211_wowlan_pattern_support {
  11756. -+struct nl80211_pattern_support {
  11757. - __u32 max_patterns;
  11758. - __u32 min_pattern_len;
  11759. - __u32 max_pattern_len;
  11760. - __u32 max_pkt_offset;
  11761. - } __attribute__((packed));
  11762. -
  11763. -+/* only for backward compatibility */
  11764. -+#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
  11765. -+#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
  11766. -+#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
  11767. -+#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
  11768. -+#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
  11769. -+#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
  11770. -+#define nl80211_wowlan_pattern_support nl80211_pattern_support
  11771. -+
  11772. - /**
  11773. - * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
  11774. - * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
  11775. -@@ -3127,7 +3136,7 @@ struct nl80211_wowlan_pattern_support {
  11776. - * pattern matching is done after the packet is converted to the MSDU.
  11777. - *
  11778. - * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
  11779. -- * carrying a &struct nl80211_wowlan_pattern_support.
  11780. -+ * carrying a &struct nl80211_pattern_support.
  11781. - *
  11782. - * When reporting wakeup. it is a u32 attribute containing the 0-based
  11783. - * index of the pattern that caused the wakeup, in the patterns passed
  11784. -@@ -3284,7 +3293,7 @@ struct nl80211_wowlan_tcp_data_token_fea
  11785. - * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
  11786. - * u32 attribute holding the maximum length
  11787. - * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
  11788. -- * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK
  11789. -+ * feature advertising. The mask works like @NL80211_PKTPAT_MASK
  11790. - * but on the TCP payload only.
  11791. - * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
  11792. - * @MAX_NL80211_WOWLAN_TCP: highest attribute number
  11793. ---- a/net/mac80211/mesh_ps.c
  11794. -+++ b/net/mac80211/mesh_ps.c
  11795. -@@ -229,6 +229,10 @@ void ieee80211_mps_sta_status_update(str
  11796. - enum nl80211_mesh_power_mode pm;
  11797. - bool do_buffer;
  11798. -
  11799. -+ /* For non-assoc STA, prevent buffering or frame transmission */
  11800. -+ if (sta->sta_state < IEEE80211_STA_ASSOC)
  11801. -+ return;
  11802. -+
  11803. - /*
  11804. - * use peer-specific power mode if peering is established and the
  11805. - * peer's power mode is known
  11806. ---- a/net/wireless/nl80211.c
  11807. -+++ b/net/wireless/nl80211.c
  11808. -@@ -441,10 +441,12 @@ static int nl80211_prepare_wdev_dump(str
  11809. - goto out_unlock;
  11810. - }
  11811. - *rdev = wiphy_to_dev((*wdev)->wiphy);
  11812. -- cb->args[0] = (*rdev)->wiphy_idx;
  11813. -+ /* 0 is the first index - add 1 to parse only once */
  11814. -+ cb->args[0] = (*rdev)->wiphy_idx + 1;
  11815. - cb->args[1] = (*wdev)->identifier;
  11816. - } else {
  11817. -- struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0]);
  11818. -+ /* subtract the 1 again here */
  11819. -+ struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0] - 1);
  11820. - struct wireless_dev *tmp;
  11821. -
  11822. - if (!wiphy) {
  11823. -@@ -974,7 +976,7 @@ static int nl80211_send_wowlan(struct sk
  11824. - return -ENOBUFS;
  11825. -
  11826. - if (dev->wiphy.wowlan->n_patterns) {
  11827. -- struct nl80211_wowlan_pattern_support pat = {
  11828. -+ struct nl80211_pattern_support pat = {
  11829. - .max_patterns = dev->wiphy.wowlan->n_patterns,
  11830. - .min_pattern_len = dev->wiphy.wowlan->pattern_min_len,
  11831. - .max_pattern_len = dev->wiphy.wowlan->pattern_max_len,
  11832. -@@ -1568,8 +1570,10 @@ static int nl80211_dump_wiphy(struct sk_
  11833. - rtnl_lock();
  11834. - if (!state) {
  11835. - state = kzalloc(sizeof(*state), GFP_KERNEL);
  11836. -- if (!state)
  11837. -+ if (!state) {
  11838. -+ rtnl_unlock();
  11839. - return -ENOMEM;
  11840. -+ }
  11841. - state->filter_wiphy = -1;
  11842. - ret = nl80211_dump_wiphy_parse(skb, cb, state);
  11843. - if (ret) {
  11844. -@@ -6615,12 +6619,14 @@ EXPORT_SYMBOL(cfg80211_testmode_alloc_ev
  11845. -
  11846. - void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
  11847. - {
  11848. -+ struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0];
  11849. - void *hdr = ((void **)skb->cb)[1];
  11850. - struct nlattr *data = ((void **)skb->cb)[2];
  11851. -
  11852. - nla_nest_end(skb, data);
  11853. - genlmsg_end(skb, hdr);
  11854. -- genlmsg_multicast(skb, 0, nl80211_testmode_mcgrp.id, gfp);
  11855. -+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), skb, 0,
  11856. -+ nl80211_testmode_mcgrp.id, gfp);
  11857. - }
  11858. - EXPORT_SYMBOL(cfg80211_testmode_event);
  11859. - #endif
  11860. -@@ -7593,12 +7599,11 @@ static int nl80211_send_wowlan_patterns(
  11861. - if (!nl_pat)
  11862. - return -ENOBUFS;
  11863. - pat_len = wowlan->patterns[i].pattern_len;
  11864. -- if (nla_put(msg, NL80211_WOWLAN_PKTPAT_MASK,
  11865. -- DIV_ROUND_UP(pat_len, 8),
  11866. -+ if (nla_put(msg, NL80211_PKTPAT_MASK, DIV_ROUND_UP(pat_len, 8),
  11867. - wowlan->patterns[i].mask) ||
  11868. -- nla_put(msg, NL80211_WOWLAN_PKTPAT_PATTERN,
  11869. -- pat_len, wowlan->patterns[i].pattern) ||
  11870. -- nla_put_u32(msg, NL80211_WOWLAN_PKTPAT_OFFSET,
  11871. -+ nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len,
  11872. -+ wowlan->patterns[i].pattern) ||
  11873. -+ nla_put_u32(msg, NL80211_PKTPAT_OFFSET,
  11874. - wowlan->patterns[i].pkt_offset))
  11875. - return -ENOBUFS;
  11876. - nla_nest_end(msg, nl_pat);
  11877. -@@ -7939,7 +7944,7 @@ static int nl80211_set_wowlan(struct sk_
  11878. - struct nlattr *pat;
  11879. - int n_patterns = 0;
  11880. - int rem, pat_len, mask_len, pkt_offset;
  11881. -- struct nlattr *pat_tb[NUM_NL80211_WOWLAN_PKTPAT];
  11882. -+ struct nlattr *pat_tb[NUM_NL80211_PKTPAT];
  11883. -
  11884. - nla_for_each_nested(pat, tb[NL80211_WOWLAN_TRIG_PKT_PATTERN],
  11885. - rem)
  11886. -@@ -7958,26 +7963,25 @@ static int nl80211_set_wowlan(struct sk_
  11887. -
  11888. - nla_for_each_nested(pat, tb[NL80211_WOWLAN_TRIG_PKT_PATTERN],
  11889. - rem) {
  11890. -- nla_parse(pat_tb, MAX_NL80211_WOWLAN_PKTPAT,
  11891. -- nla_data(pat), nla_len(pat), NULL);
  11892. -+ nla_parse(pat_tb, MAX_NL80211_PKTPAT, nla_data(pat),
  11893. -+ nla_len(pat), NULL);
  11894. - err = -EINVAL;
  11895. -- if (!pat_tb[NL80211_WOWLAN_PKTPAT_MASK] ||
  11896. -- !pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN])
  11897. -+ if (!pat_tb[NL80211_PKTPAT_MASK] ||
  11898. -+ !pat_tb[NL80211_PKTPAT_PATTERN])
  11899. - goto error;
  11900. -- pat_len = nla_len(pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN]);
  11901. -+ pat_len = nla_len(pat_tb[NL80211_PKTPAT_PATTERN]);
  11902. - mask_len = DIV_ROUND_UP(pat_len, 8);
  11903. -- if (nla_len(pat_tb[NL80211_WOWLAN_PKTPAT_MASK]) !=
  11904. -- mask_len)
  11905. -+ if (nla_len(pat_tb[NL80211_PKTPAT_MASK]) != mask_len)
  11906. - goto error;
  11907. - if (pat_len > wowlan->pattern_max_len ||
  11908. - pat_len < wowlan->pattern_min_len)
  11909. - goto error;
  11910. -
  11911. -- if (!pat_tb[NL80211_WOWLAN_PKTPAT_OFFSET])
  11912. -+ if (!pat_tb[NL80211_PKTPAT_OFFSET])
  11913. - pkt_offset = 0;
  11914. - else
  11915. - pkt_offset = nla_get_u32(
  11916. -- pat_tb[NL80211_WOWLAN_PKTPAT_OFFSET]);
  11917. -+ pat_tb[NL80211_PKTPAT_OFFSET]);
  11918. - if (pkt_offset > wowlan->max_pkt_offset)
  11919. - goto error;
  11920. - new_triggers.patterns[i].pkt_offset = pkt_offset;
  11921. -@@ -7991,11 +7995,11 @@ static int nl80211_set_wowlan(struct sk_
  11922. - new_triggers.patterns[i].pattern =
  11923. - new_triggers.patterns[i].mask + mask_len;
  11924. - memcpy(new_triggers.patterns[i].mask,
  11925. -- nla_data(pat_tb[NL80211_WOWLAN_PKTPAT_MASK]),
  11926. -+ nla_data(pat_tb[NL80211_PKTPAT_MASK]),
  11927. - mask_len);
  11928. - new_triggers.patterns[i].pattern_len = pat_len;
  11929. - memcpy(new_triggers.patterns[i].pattern,
  11930. -- nla_data(pat_tb[NL80211_WOWLAN_PKTPAT_PATTERN]),
  11931. -+ nla_data(pat_tb[NL80211_PKTPAT_PATTERN]),
  11932. - pat_len);
  11933. - i++;
  11934. - }
  11935. -@@ -10066,7 +10070,8 @@ void cfg80211_mgmt_tx_status(struct wire
  11936. -
  11937. - genlmsg_end(msg, hdr);
  11938. -
  11939. -- genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
  11940. -+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
  11941. -+ nl80211_mlme_mcgrp.id, gfp);
  11942. - return;
  11943. -
  11944. - nla_put_failure:
  11945. ---- a/net/wireless/reg.c
  11946. -+++ b/net/wireless/reg.c
  11947. -@@ -2247,10 +2247,13 @@ int reg_device_uevent(struct device *dev
  11948. -
  11949. - void wiphy_regulatory_register(struct wiphy *wiphy)
  11950. - {
  11951. -+ struct regulatory_request *lr;
  11952. -+
  11953. - if (!reg_dev_ignore_cell_hint(wiphy))
  11954. - reg_num_devs_support_basehint++;
  11955. -
  11956. -- wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
  11957. -+ lr = get_last_request();
  11958. -+ wiphy_update_regulatory(wiphy, lr->initiator);
  11959. - }
  11960. -
  11961. - void wiphy_regulatory_deregister(struct wiphy *wiphy)
  11962. -@@ -2279,7 +2282,9 @@ void wiphy_regulatory_deregister(struct
  11963. - static void reg_timeout_work(struct work_struct *work)
  11964. - {
  11965. - REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n");
  11966. -+ rtnl_lock();
  11967. - restore_regulatory_settings(true);
  11968. -+ rtnl_unlock();
  11969. - }
  11970. -
  11971. - int __init regulatory_init(void)
  11972. ---- a/net/wireless/sme.c
  11973. -+++ b/net/wireless/sme.c
  11974. -@@ -34,8 +34,10 @@ struct cfg80211_conn {
  11975. - CFG80211_CONN_SCAN_AGAIN,
  11976. - CFG80211_CONN_AUTHENTICATE_NEXT,
  11977. - CFG80211_CONN_AUTHENTICATING,
  11978. -+ CFG80211_CONN_AUTH_FAILED,
  11979. - CFG80211_CONN_ASSOCIATE_NEXT,
  11980. - CFG80211_CONN_ASSOCIATING,
  11981. -+ CFG80211_CONN_ASSOC_FAILED,
  11982. - CFG80211_CONN_DEAUTH,
  11983. - CFG80211_CONN_CONNECTED,
  11984. - } state;
  11985. -@@ -164,6 +166,8 @@ static int cfg80211_conn_do_work(struct
  11986. - NULL, 0,
  11987. - params->key, params->key_len,
  11988. - params->key_idx, NULL, 0);
  11989. -+ case CFG80211_CONN_AUTH_FAILED:
  11990. -+ return -ENOTCONN;
  11991. - case CFG80211_CONN_ASSOCIATE_NEXT:
  11992. - BUG_ON(!rdev->ops->assoc);
  11993. - wdev->conn->state = CFG80211_CONN_ASSOCIATING;
  11994. -@@ -188,10 +192,17 @@ static int cfg80211_conn_do_work(struct
  11995. - WLAN_REASON_DEAUTH_LEAVING,
  11996. - false);
  11997. - return err;
  11998. -+ case CFG80211_CONN_ASSOC_FAILED:
  11999. -+ cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
  12000. -+ NULL, 0,
  12001. -+ WLAN_REASON_DEAUTH_LEAVING, false);
  12002. -+ return -ENOTCONN;
  12003. - case CFG80211_CONN_DEAUTH:
  12004. - cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
  12005. - NULL, 0,
  12006. - WLAN_REASON_DEAUTH_LEAVING, false);
  12007. -+ /* free directly, disconnected event already sent */
  12008. -+ cfg80211_sme_free(wdev);
  12009. - return 0;
  12010. - default:
  12011. - return 0;
  12012. -@@ -371,7 +382,7 @@ bool cfg80211_sme_rx_assoc_resp(struct w
  12013. - return true;
  12014. - }
  12015. -
  12016. -- wdev->conn->state = CFG80211_CONN_DEAUTH;
  12017. -+ wdev->conn->state = CFG80211_CONN_ASSOC_FAILED;
  12018. - schedule_work(&rdev->conn_work);
  12019. - return false;
  12020. - }
  12021. -@@ -383,7 +394,13 @@ void cfg80211_sme_deauth(struct wireless
  12022. -
  12023. - void cfg80211_sme_auth_timeout(struct wireless_dev *wdev)
  12024. - {
  12025. -- cfg80211_sme_free(wdev);
  12026. -+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
  12027. -+
  12028. -+ if (!wdev->conn)
  12029. -+ return;
  12030. -+
  12031. -+ wdev->conn->state = CFG80211_CONN_AUTH_FAILED;
  12032. -+ schedule_work(&rdev->conn_work);
  12033. - }
  12034. -
  12035. - void cfg80211_sme_disassoc(struct wireless_dev *wdev)
  12036. -@@ -399,7 +416,13 @@ void cfg80211_sme_disassoc(struct wirele
  12037. -
  12038. - void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev)
  12039. - {
  12040. -- cfg80211_sme_disassoc(wdev);
  12041. -+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
  12042. -+
  12043. -+ if (!wdev->conn)
  12044. -+ return;
  12045. -+
  12046. -+ wdev->conn->state = CFG80211_CONN_ASSOC_FAILED;
  12047. -+ schedule_work(&rdev->conn_work);
  12048. - }
  12049. -
  12050. - static int cfg80211_sme_connect(struct wireless_dev *wdev,
  12051. ---- a/net/mac80211/rc80211_minstrel.c
  12052. -+++ b/net/mac80211/rc80211_minstrel.c
  12053. -@@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct iee
  12054. - struct minstrel_rate *msr, *mr;
  12055. - unsigned int ndx;
  12056. - bool mrr_capable;
  12057. -- bool prev_sample = mi->prev_sample;
  12058. -+ bool prev_sample;
  12059. - int delta;
  12060. - int sampling_ratio;
  12061. -
  12062. -@@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct iee
  12063. - (mi->sample_count + mi->sample_deferred / 2);
  12064. -
  12065. - /* delta < 0: no sampling required */
  12066. -+ prev_sample = mi->prev_sample;
  12067. - mi->prev_sample = false;
  12068. - if (delta < 0 || (!mrr_capable && prev_sample))
  12069. - return;
  12070. ---- a/drivers/net/wireless/rt2x00/rt2x00queue.c
  12071. -+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
  12072. -@@ -936,13 +936,8 @@ void rt2x00queue_index_inc(struct queue_
  12073. - spin_unlock_irqrestore(&queue->index_lock, irqflags);
  12074. - }
  12075. -
  12076. --void rt2x00queue_pause_queue(struct data_queue *queue)
  12077. -+void rt2x00queue_pause_queue_nocheck(struct data_queue *queue)
  12078. - {
  12079. -- if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
  12080. -- !test_bit(QUEUE_STARTED, &queue->flags) ||
  12081. -- test_and_set_bit(QUEUE_PAUSED, &queue->flags))
  12082. -- return;
  12083. --
  12084. - switch (queue->qid) {
  12085. - case QID_AC_VO:
  12086. - case QID_AC_VI:
  12087. -@@ -958,6 +953,15 @@ void rt2x00queue_pause_queue(struct data
  12088. - break;
  12089. - }
  12090. - }
  12091. -+void rt2x00queue_pause_queue(struct data_queue *queue)
  12092. -+{
  12093. -+ if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
  12094. -+ !test_bit(QUEUE_STARTED, &queue->flags) ||
  12095. -+ test_and_set_bit(QUEUE_PAUSED, &queue->flags))
  12096. -+ return;
  12097. -+
  12098. -+ rt2x00queue_pause_queue_nocheck(queue);
  12099. -+}
  12100. - EXPORT_SYMBOL_GPL(rt2x00queue_pause_queue);
  12101. -
  12102. - void rt2x00queue_unpause_queue(struct data_queue *queue)
  12103. -@@ -1019,7 +1023,7 @@ void rt2x00queue_stop_queue(struct data_
  12104. - return;
  12105. - }
  12106. -
  12107. -- rt2x00queue_pause_queue(queue);
  12108. -+ rt2x00queue_pause_queue_nocheck(queue);
  12109. -
  12110. - queue->rt2x00dev->ops->lib->stop_queue(queue);
  12111. -
  12112. ---- a/net/mac80211/mlme.c
  12113. -+++ b/net/mac80211/mlme.c
  12114. -@@ -31,10 +31,12 @@
  12115. - #include "led.h"
  12116. -
  12117. - #define IEEE80211_AUTH_TIMEOUT (HZ / 5)
  12118. -+#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2)
  12119. - #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10)
  12120. - #define IEEE80211_AUTH_MAX_TRIES 3
  12121. - #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5)
  12122. - #define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
  12123. -+#define IEEE80211_ASSOC_TIMEOUT_LONG (HZ / 2)
  12124. - #define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10)
  12125. - #define IEEE80211_ASSOC_MAX_TRIES 3
  12126. -
  12127. -@@ -209,8 +211,9 @@ ieee80211_determine_chantype(struct ieee
  12128. - struct ieee80211_channel *channel,
  12129. - const struct ieee80211_ht_operation *ht_oper,
  12130. - const struct ieee80211_vht_operation *vht_oper,
  12131. -- struct cfg80211_chan_def *chandef, bool verbose)
  12132. -+ struct cfg80211_chan_def *chandef, bool tracking)
  12133. - {
  12134. -+ struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
  12135. - struct cfg80211_chan_def vht_chandef;
  12136. - u32 ht_cfreq, ret;
  12137. -
  12138. -@@ -229,7 +232,7 @@ ieee80211_determine_chantype(struct ieee
  12139. - ht_cfreq = ieee80211_channel_to_frequency(ht_oper->primary_chan,
  12140. - channel->band);
  12141. - /* check that channel matches the right operating channel */
  12142. -- if (channel->center_freq != ht_cfreq) {
  12143. -+ if (!tracking && channel->center_freq != ht_cfreq) {
  12144. - /*
  12145. - * It's possible that some APs are confused here;
  12146. - * Netgear WNDR3700 sometimes reports 4 higher than
  12147. -@@ -237,11 +240,10 @@ ieee80211_determine_chantype(struct ieee
  12148. - * since we look at probe response/beacon data here
  12149. - * it should be OK.
  12150. - */
  12151. -- if (verbose)
  12152. -- sdata_info(sdata,
  12153. -- "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n",
  12154. -- channel->center_freq, ht_cfreq,
  12155. -- ht_oper->primary_chan, channel->band);
  12156. -+ sdata_info(sdata,
  12157. -+ "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n",
  12158. -+ channel->center_freq, ht_cfreq,
  12159. -+ ht_oper->primary_chan, channel->band);
  12160. - ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
  12161. - goto out;
  12162. - }
  12163. -@@ -295,7 +297,7 @@ ieee80211_determine_chantype(struct ieee
  12164. - channel->band);
  12165. - break;
  12166. - default:
  12167. -- if (verbose)
  12168. -+ if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
  12169. - sdata_info(sdata,
  12170. - "AP VHT operation IE has invalid channel width (%d), disable VHT\n",
  12171. - vht_oper->chan_width);
  12172. -@@ -304,7 +306,7 @@ ieee80211_determine_chantype(struct ieee
  12173. - }
  12174. -
  12175. - if (!cfg80211_chandef_valid(&vht_chandef)) {
  12176. -- if (verbose)
  12177. -+ if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
  12178. - sdata_info(sdata,
  12179. - "AP VHT information is invalid, disable VHT\n");
  12180. - ret = IEEE80211_STA_DISABLE_VHT;
  12181. -@@ -317,7 +319,7 @@ ieee80211_determine_chantype(struct ieee
  12182. - }
  12183. -
  12184. - if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) {
  12185. -- if (verbose)
  12186. -+ if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
  12187. - sdata_info(sdata,
  12188. - "AP VHT information doesn't match HT, disable VHT\n");
  12189. - ret = IEEE80211_STA_DISABLE_VHT;
  12190. -@@ -333,18 +335,27 @@ out:
  12191. - if (ret & IEEE80211_STA_DISABLE_VHT)
  12192. - vht_chandef = *chandef;
  12193. -
  12194. -+ /*
  12195. -+ * Ignore the DISABLED flag when we're already connected and only
  12196. -+ * tracking the APs beacon for bandwidth changes - otherwise we
  12197. -+ * might get disconnected here if we connect to an AP, update our
  12198. -+ * regulatory information based on the AP's country IE and the
  12199. -+ * information we have is wrong/outdated and disables the channel
  12200. -+ * that we're actually using for the connection to the AP.
  12201. -+ */
  12202. - while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef,
  12203. -- IEEE80211_CHAN_DISABLED)) {
  12204. -+ tracking ? 0 :
  12205. -+ IEEE80211_CHAN_DISABLED)) {
  12206. - if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) {
  12207. - ret = IEEE80211_STA_DISABLE_HT |
  12208. - IEEE80211_STA_DISABLE_VHT;
  12209. -- goto out;
  12210. -+ break;
  12211. - }
  12212. -
  12213. - ret |= chandef_downgrade(chandef);
  12214. - }
  12215. -
  12216. -- if (chandef->width != vht_chandef.width && verbose)
  12217. -+ if (chandef->width != vht_chandef.width && !tracking)
  12218. - sdata_info(sdata,
  12219. - "capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n");
  12220. -
  12221. -@@ -384,7 +395,7 @@ static int ieee80211_config_bw(struct ie
  12222. -
  12223. - /* calculate new channel (type) based on HT/VHT operation IEs */
  12224. - flags = ieee80211_determine_chantype(sdata, sband, chan, ht_oper,
  12225. -- vht_oper, &chandef, false);
  12226. -+ vht_oper, &chandef, true);
  12227. -
  12228. - /*
  12229. - * Downgrade the new channel if we associated with restricted
  12230. -@@ -3394,10 +3405,13 @@ static int ieee80211_probe_auth(struct i
  12231. -
  12232. - if (tx_flags == 0) {
  12233. - auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
  12234. -- ifmgd->auth_data->timeout_started = true;
  12235. -+ auth_data->timeout_started = true;
  12236. - run_again(sdata, auth_data->timeout);
  12237. - } else {
  12238. -- auth_data->timeout_started = false;
  12239. -+ auth_data->timeout =
  12240. -+ round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
  12241. -+ auth_data->timeout_started = true;
  12242. -+ run_again(sdata, auth_data->timeout);
  12243. - }
  12244. -
  12245. - return 0;
  12246. -@@ -3434,7 +3448,11 @@ static int ieee80211_do_assoc(struct iee
  12247. - assoc_data->timeout_started = true;
  12248. - run_again(sdata, assoc_data->timeout);
  12249. - } else {
  12250. -- assoc_data->timeout_started = false;
  12251. -+ assoc_data->timeout =
  12252. -+ round_jiffies_up(jiffies +
  12253. -+ IEEE80211_ASSOC_TIMEOUT_LONG);
  12254. -+ assoc_data->timeout_started = true;
  12255. -+ run_again(sdata, assoc_data->timeout);
  12256. - }
  12257. -
  12258. - return 0;
  12259. -@@ -3829,7 +3847,7 @@ static int ieee80211_prep_channel(struct
  12260. - ifmgd->flags |= ieee80211_determine_chantype(sdata, sband,
  12261. - cbss->channel,
  12262. - ht_oper, vht_oper,
  12263. -- &chandef, true);
  12264. -+ &chandef, false);
  12265. -
  12266. - sdata->needed_rx_chains = min(ieee80211_ht_vht_rx_chains(sdata, cbss),
  12267. - local->rx_chains);
  12268. ---- a/net/wireless/core.c
  12269. -+++ b/net/wireless/core.c
  12270. -@@ -772,6 +772,7 @@ void cfg80211_leave(struct cfg80211_regi
  12271. - cfg80211_leave_mesh(rdev, dev);
  12272. - break;
  12273. - case NL80211_IFTYPE_AP:
  12274. -+ case NL80211_IFTYPE_P2P_GO:
  12275. - cfg80211_stop_ap(rdev, dev);
  12276. - break;
  12277. - default:
  12278. ---- a/drivers/net/wireless/rt2x00/rt2800lib.c
  12279. -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  12280. -@@ -5404,19 +5404,20 @@ int rt2800_enable_radio(struct rt2x00_de
  12281. - rt2800_init_registers(rt2x00dev)))
  12282. - return -EIO;
  12283. -
  12284. -+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))
  12285. -+ return -EIO;
  12286. -+
  12287. - /*
  12288. - * Send signal to firmware during boot time.
  12289. - */
  12290. - rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
  12291. - rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  12292. -- if (rt2x00_is_usb(rt2x00dev)) {
  12293. -+ if (rt2x00_is_usb(rt2x00dev))
  12294. - rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);
  12295. -- rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
  12296. -- }
  12297. -+ rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
  12298. - msleep(1);
  12299. -
  12300. -- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev) ||
  12301. -- rt2800_wait_bbp_ready(rt2x00dev)))
  12302. -+ if (unlikely(rt2800_wait_bbp_ready(rt2x00dev)))
  12303. - return -EIO;
  12304. -
  12305. - rt2800_init_bbp(rt2x00dev);
  12306. ---- a/net/mac80211/main.c
  12307. -+++ b/net/mac80211/main.c
  12308. -@@ -101,7 +101,7 @@ static u32 ieee80211_hw_conf_chan(struct
  12309. - struct ieee80211_sub_if_data *sdata;
  12310. - struct cfg80211_chan_def chandef = {};
  12311. - u32 changed = 0;
  12312. -- int power;
  12313. -+ int power = 0;
  12314. - u32 offchannel_flag;
  12315. -
  12316. - offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
  12317. -@@ -155,16 +155,16 @@ static u32 ieee80211_hw_conf_chan(struct
  12318. - changed |= IEEE80211_CONF_CHANGE_SMPS;
  12319. - }
  12320. -
  12321. -- power = chandef.chan->max_power;
  12322. --
  12323. - rcu_read_lock();
  12324. - list_for_each_entry_rcu(sdata, &local->interfaces, list) {
  12325. - if (!rcu_access_pointer(sdata->vif.chanctx_conf))
  12326. - continue;
  12327. -- power = min(power, sdata->vif.bss_conf.txpower);
  12328. -+ power = max(power, sdata->vif.bss_conf.txpower);
  12329. - }
  12330. - rcu_read_unlock();
  12331. -
  12332. -+ power = min(power, chandef.chan->max_power);
  12333. -+
  12334. - if (local->hw.conf.power_level != power) {
  12335. - changed |= IEEE80211_CONF_CHANGE_POWER;
  12336. - local->hw.conf.power_level = power;
  12337. ---- a/net/mac80211/cfg.c
  12338. -+++ b/net/mac80211/cfg.c
  12339. -@@ -3332,7 +3332,7 @@ static int ieee80211_probe_client(struct
  12340. - return -EINVAL;
  12341. - }
  12342. - band = chanctx_conf->def.chan->band;
  12343. -- sta = sta_info_get(sdata, peer);
  12344. -+ sta = sta_info_get_bss(sdata, peer);
  12345. - if (sta) {
  12346. - qos = test_sta_flag(sta, WLAN_STA_WME);
  12347. - } else {
  12348. ---- a/net/mac80211/status.c
  12349. -+++ b/net/mac80211/status.c
  12350. -@@ -180,6 +180,9 @@ static void ieee80211_frame_acked(struct
  12351. - struct ieee80211_local *local = sta->local;
  12352. - struct ieee80211_sub_if_data *sdata = sta->sdata;
  12353. -
  12354. -+ if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
  12355. -+ sta->last_rx = jiffies;
  12356. -+
  12357. - if (ieee80211_is_data_qos(mgmt->frame_control)) {
  12358. - struct ieee80211_hdr *hdr = (void *) skb->data;
  12359. - u8 *qc = ieee80211_get_qos_ctl(hdr);
  12360. ---- a/net/mac80211/tx.c
  12361. -+++ b/net/mac80211/tx.c
  12362. -@@ -1101,7 +1101,8 @@ ieee80211_tx_prepare(struct ieee80211_su
  12363. - tx->sta = rcu_dereference(sdata->u.vlan.sta);
  12364. - if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
  12365. - return TX_DROP;
  12366. -- } else if (info->flags & IEEE80211_TX_CTL_INJECTED ||
  12367. -+ } else if (info->flags & (IEEE80211_TX_CTL_INJECTED |
  12368. -+ IEEE80211_TX_INTFL_NL80211_FRAME_TX) ||
  12369. - tx->sdata->control_port_protocol == tx->skb->protocol) {
  12370. - tx->sta = sta_info_get_bss(sdata, hdr->addr1);
  12371. - }
  12372. ---- a/drivers/net/wireless/ath/ath5k/base.c
  12373. -+++ b/drivers/net/wireless/ath/ath5k/base.c
  12374. -@@ -1628,15 +1628,15 @@ ath5k_tx_frame_completed(struct ath5k_hw
  12375. - ah->stats.tx_bytes_count += skb->len;
  12376. - info = IEEE80211_SKB_CB(skb);
  12377. -
  12378. -+ size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
  12379. -+ memcpy(info->status.rates, bf->rates, size);
  12380. -+
  12381. - tries[0] = info->status.rates[0].count;
  12382. - tries[1] = info->status.rates[1].count;
  12383. - tries[2] = info->status.rates[2].count;
  12384. -
  12385. - ieee80211_tx_info_clear_status(info);
  12386. -
  12387. -- size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
  12388. -- memcpy(info->status.rates, bf->rates, size);
  12389. --
  12390. - for (i = 0; i < ts->ts_final_idx; i++) {
  12391. - struct ieee80211_tx_rate *r =
  12392. - &info->status.rates[i];
  12393. ---- a/drivers/net/wireless/rt2x00/rt2800usb.c
  12394. -+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
  12395. -@@ -176,8 +176,8 @@ static bool rt2800usb_tx_sta_fifo_read_c
  12396. - queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
  12397. -
  12398. - if (rt2800usb_txstatus_pending(rt2x00dev)) {
  12399. -- /* Read register after 250 us */
  12400. -- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
  12401. -+ /* Read register after 1 ms */
  12402. -+ hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 1000000),
  12403. - HRTIMER_MODE_REL);
  12404. - return false;
  12405. - }
  12406. -@@ -202,8 +202,8 @@ static void rt2800usb_async_read_tx_stat
  12407. - if (test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
  12408. - return;
  12409. -
  12410. -- /* Read TX_STA_FIFO register after 500 us */
  12411. -- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 500000),
  12412. -+ /* Read TX_STA_FIFO register after 2 ms */
  12413. -+ hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 2000000),
  12414. - HRTIMER_MODE_REL);
  12415. - }
  12416. -
  12417. diff --git a/package/mac80211/patches/310-ap_scan.patch b/package/mac80211/patches/310-ap_scan.patch
  12418. deleted file mode 100644
  12419. index d7479f2..0000000
  12420. --- a/package/mac80211/patches/310-ap_scan.patch
  12421. +++ /dev/null
  12422. @@ -1,11 +0,0 @@
  12423. ---- a/net/mac80211/cfg.c
  12424. -+++ b/net/mac80211/cfg.c
  12425. -@@ -2092,7 +2092,7 @@ static int ieee80211_scan(struct wiphy *
  12426. - * the frames sent while scanning on other channel will be
  12427. - * lost)
  12428. - */
  12429. -- if (sdata->u.ap.beacon &&
  12430. -+ if (0 && sdata->u.ap.beacon &&
  12431. - (!(wiphy->features & NL80211_FEATURE_AP_SCAN) ||
  12432. - !(req->flags & NL80211_SCAN_FLAG_AP)))
  12433. - return -EOPNOTSUPP;
  12434. diff --git a/package/mac80211/patches/400-ath_move_debug_code.patch b/package/mac80211/patches/400-ath_move_debug_code.patch
  12435. deleted file mode 100644
  12436. index aa5ce94..0000000
  12437. --- a/package/mac80211/patches/400-ath_move_debug_code.patch
  12438. +++ /dev/null
  12439. @@ -1,28 +0,0 @@
  12440. ---- a/drivers/net/wireless/ath/Makefile
  12441. -+++ b/drivers/net/wireless/ath/Makefile
  12442. -@@ -11,7 +11,7 @@ obj-$(CPTCFG_ATH_COMMON) += ath.o
  12443. - ath-objs := main.o \
  12444. - regd.o \
  12445. - hw.o \
  12446. -- key.o
  12447. -+ key.o \
  12448. -+ debug.o
  12449. -
  12450. --ath-$(CPTCFG_ATH_DEBUG) += debug.o
  12451. - ccflags-y += -D__CHECK_ENDIAN__
  12452. ---- a/drivers/net/wireless/ath/ath.h
  12453. -+++ b/drivers/net/wireless/ath/ath.h
  12454. -@@ -280,13 +280,6 @@ void _ath_dbg(struct ath_common *common,
  12455. - #endif /* CPTCFG_ATH_DEBUG */
  12456. -
  12457. - /** Returns string describing opmode, or NULL if unknown mode. */
  12458. --#ifdef CPTCFG_ATH_DEBUG
  12459. - const char *ath_opmode_to_string(enum nl80211_iftype opmode);
  12460. --#else
  12461. --static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
  12462. --{
  12463. -- return "UNKNOWN";
  12464. --}
  12465. --#endif
  12466. -
  12467. - #endif /* ATH_H */
  12468. diff --git a/package/mac80211/patches/401-ath9k_blink_default.patch b/package/mac80211/patches/401-ath9k_blink_default.patch
  12469. deleted file mode 100644
  12470. index b0cef87..0000000
  12471. --- a/package/mac80211/patches/401-ath9k_blink_default.patch
  12472. +++ /dev/null
  12473. @@ -1,11 +0,0 @@
  12474. ---- a/drivers/net/wireless/ath/ath9k/init.c
  12475. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  12476. -@@ -45,7 +45,7 @@ int ath9k_modparam_nohwcrypt;
  12477. - module_param_named(nohwcrypt, ath9k_modparam_nohwcrypt, int, 0444);
  12478. - MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
  12479. -
  12480. --int led_blink;
  12481. -+int led_blink = 1;
  12482. - module_param_named(blink, led_blink, int, 0444);
  12483. - MODULE_PARM_DESC(blink, "Enable LED blink on activity");
  12484. -
  12485. 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
  12486. deleted file mode 100644
  12487. index b2a7073..0000000
  12488. --- a/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch
  12489. +++ /dev/null
  12490. @@ -1,29 +0,0 @@
  12491. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  12492. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  12493. -@@ -17,6 +17,7 @@
  12494. - #include <linux/io.h>
  12495. - #include <linux/slab.h>
  12496. - #include <linux/module.h>
  12497. -+#include <linux/etherdevice.h>
  12498. - #include <asm/unaligned.h>
  12499. -
  12500. - #include "hw.h"
  12501. -@@ -518,8 +519,16 @@ static int ath9k_hw_init_macaddr(struct
  12502. - common->macaddr[2 * i] = eeval >> 8;
  12503. - common->macaddr[2 * i + 1] = eeval & 0xff;
  12504. - }
  12505. -- if (sum == 0 || sum == 0xffff * 3)
  12506. -- return -EADDRNOTAVAIL;
  12507. -+ if (!is_valid_ether_addr(common->macaddr)) {
  12508. -+ ath_err(common,
  12509. -+ "eeprom contains invalid mac address: %pM\n",
  12510. -+ common->macaddr);
  12511. -+
  12512. -+ random_ether_addr(common->macaddr);
  12513. -+ ath_err(common,
  12514. -+ "random mac address will be used: %pM\n",
  12515. -+ common->macaddr);
  12516. -+ }
  12517. -
  12518. - return 0;
  12519. - }
  12520. diff --git a/package/mac80211/patches/403-ath_regd_optional.patch b/package/mac80211/patches/403-ath_regd_optional.patch
  12521. deleted file mode 100644
  12522. index 303c4d7..0000000
  12523. --- a/package/mac80211/patches/403-ath_regd_optional.patch
  12524. +++ /dev/null
  12525. @@ -1,68 +0,0 @@
  12526. ---- a/drivers/net/wireless/ath/regd.c
  12527. -+++ b/drivers/net/wireless/ath/regd.c
  12528. -@@ -196,6 +196,10 @@ ath_reg_apply_beaconing_flags(struct wip
  12529. - struct ieee80211_channel *ch;
  12530. - unsigned int i;
  12531. -
  12532. -+#ifdef CPTCFG_ATH_USER_REGD
  12533. -+ return;
  12534. -+#endif
  12535. -+
  12536. - for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
  12537. -
  12538. - if (!wiphy->bands[band])
  12539. -@@ -250,6 +254,10 @@ ath_reg_apply_active_scan_flags(struct w
  12540. - struct ieee80211_channel *ch;
  12541. - const struct ieee80211_reg_rule *reg_rule;
  12542. -
  12543. -+#ifdef CPTCFG_ATH_USER_REGD
  12544. -+ return;
  12545. -+#endif
  12546. -+
  12547. - sband = wiphy->bands[IEEE80211_BAND_2GHZ];
  12548. - if (!sband)
  12549. - return;
  12550. -@@ -299,6 +307,10 @@ static void ath_reg_apply_radar_flags(st
  12551. - struct ieee80211_channel *ch;
  12552. - unsigned int i;
  12553. -
  12554. -+#ifdef CPTCFG_ATH_USER_REGD
  12555. -+ return;
  12556. -+#endif
  12557. -+
  12558. - if (!wiphy->bands[IEEE80211_BAND_5GHZ])
  12559. - return;
  12560. -
  12561. -@@ -503,6 +515,10 @@ ath_regd_init_wiphy(struct ath_regulator
  12562. - {
  12563. - const struct ieee80211_regdomain *regd;
  12564. -
  12565. -+#ifdef CPTCFG_ATH_USER_REGD
  12566. -+ return 0;
  12567. -+#endif
  12568. -+
  12569. - wiphy->reg_notifier = reg_notifier;
  12570. - wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
  12571. -
  12572. ---- a/drivers/net/wireless/ath/Kconfig
  12573. -+++ b/drivers/net/wireless/ath/Kconfig
  12574. -@@ -21,6 +21,9 @@ menuconfig ATH_CARDS
  12575. -
  12576. - if ATH_CARDS
  12577. -
  12578. -+config ATH_USER_REGD
  12579. -+ bool "Do not enforce EEPROM regulatory restrictions"
  12580. -+
  12581. - config ATH_DEBUG
  12582. - bool "Atheros wireless debugging"
  12583. - ---help---
  12584. ---- a/.local-symbols
  12585. -+++ b/.local-symbols
  12586. -@@ -123,6 +123,7 @@ RTL8187_LEDS=
  12587. - ATH_COMMON=
  12588. - ATH_CARDS=
  12589. - ATH_DEBUG=
  12590. -+ATH_USER_REGD=
  12591. - ATH5K=
  12592. - ATH5K_DEBUG=
  12593. - ATH5K_TRACER=
  12594. diff --git a/package/mac80211/patches/404-world_regd_fixup.patch b/package/mac80211/patches/404-world_regd_fixup.patch
  12595. deleted file mode 100644
  12596. index 7a5840e..0000000
  12597. --- a/package/mac80211/patches/404-world_regd_fixup.patch
  12598. +++ /dev/null
  12599. @@ -1,84 +0,0 @@
  12600. ---- a/drivers/net/wireless/ath/regd.c
  12601. -+++ b/drivers/net/wireless/ath/regd.c
  12602. -@@ -42,7 +42,8 @@ static int __ath_regd_init(struct ath_re
  12603. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
  12604. -
  12605. - /* We allow IBSS on these on a case by case basis by regulatory domain */
  12606. --#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
  12607. -+#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5250, 80, 0, 30, 0), \
  12608. -+ REG_RULE(5250, 5350+10, 80, 0, 30,\
  12609. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  12610. - #define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
  12611. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  12612. -@@ -60,57 +61,56 @@ static int __ath_regd_init(struct ath_re
  12613. - #define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \
  12614. - ATH9K_5GHZ_5725_5850
  12615. -
  12616. -+#define REGD_RULES(...) \
  12617. -+ .reg_rules = { __VA_ARGS__ }, \
  12618. -+ .n_reg_rules = ARRAY_SIZE(((struct ieee80211_reg_rule[]) { __VA_ARGS__ }))
  12619. -+
  12620. - /* Can be used for:
  12621. - * 0x60, 0x61, 0x62 */
  12622. - static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
  12623. -- .n_reg_rules = 5,
  12624. - .alpha2 = "99",
  12625. -- .reg_rules = {
  12626. -+ REGD_RULES(
  12627. - ATH9K_2GHZ_ALL,
  12628. - ATH9K_5GHZ_ALL,
  12629. -- }
  12630. -+ )
  12631. - };
  12632. -
  12633. - /* Can be used by 0x63 and 0x65 */
  12634. - static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
  12635. -- .n_reg_rules = 4,
  12636. - .alpha2 = "99",
  12637. -- .reg_rules = {
  12638. -+ REGD_RULES(
  12639. - ATH9K_2GHZ_CH01_11,
  12640. - ATH9K_2GHZ_CH12_13,
  12641. - ATH9K_5GHZ_NO_MIDBAND,
  12642. -- }
  12643. -+ )
  12644. - };
  12645. -
  12646. - /* Can be used by 0x64 only */
  12647. - static const struct ieee80211_regdomain ath_world_regdom_64 = {
  12648. -- .n_reg_rules = 3,
  12649. - .alpha2 = "99",
  12650. -- .reg_rules = {
  12651. -+ REGD_RULES(
  12652. - ATH9K_2GHZ_CH01_11,
  12653. - ATH9K_5GHZ_NO_MIDBAND,
  12654. -- }
  12655. -+ )
  12656. - };
  12657. -
  12658. - /* Can be used by 0x66 and 0x69 */
  12659. - static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
  12660. -- .n_reg_rules = 3,
  12661. - .alpha2 = "99",
  12662. -- .reg_rules = {
  12663. -+ REGD_RULES(
  12664. - ATH9K_2GHZ_CH01_11,
  12665. - ATH9K_5GHZ_ALL,
  12666. -- }
  12667. -+ )
  12668. - };
  12669. -
  12670. - /* Can be used by 0x67, 0x68, 0x6A and 0x6C */
  12671. - static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
  12672. -- .n_reg_rules = 4,
  12673. - .alpha2 = "99",
  12674. -- .reg_rules = {
  12675. -+ REGD_RULES(
  12676. - ATH9K_2GHZ_CH01_11,
  12677. - ATH9K_2GHZ_CH12_13,
  12678. - ATH9K_5GHZ_ALL,
  12679. -- }
  12680. -+ )
  12681. - };
  12682. -
  12683. - static inline bool is_wwr_sku(u16 regd)
  12684. diff --git a/package/mac80211/patches/405-regd_no_assoc_hints.patch b/package/mac80211/patches/405-regd_no_assoc_hints.patch
  12685. deleted file mode 100644
  12686. index 5380853..0000000
  12687. --- a/package/mac80211/patches/405-regd_no_assoc_hints.patch
  12688. +++ /dev/null
  12689. @@ -1,19 +0,0 @@
  12690. ---- a/net/wireless/reg.c
  12691. -+++ b/net/wireless/reg.c
  12692. -@@ -1696,6 +1696,8 @@ void regulatory_hint_11d(struct wiphy *w
  12693. - enum environment_cap env = ENVIRON_ANY;
  12694. - struct regulatory_request *request = NULL, *lr;
  12695. -
  12696. -+ return;
  12697. -+
  12698. - /* IE len must be evenly divisible by 2 */
  12699. - if (country_ie_len & 0x01)
  12700. - return;
  12701. -@@ -1890,6 +1892,7 @@ static void restore_regulatory_settings(
  12702. -
  12703. - void regulatory_hint_disconnect(void)
  12704. - {
  12705. -+ return;
  12706. - REG_DBG_PRINT("All devices are disconnected, going to restore regulatory settings\n");
  12707. - restore_regulatory_settings(false);
  12708. - }
  12709. diff --git a/package/mac80211/patches/406-ath_regd_us.patch b/package/mac80211/patches/406-ath_regd_us.patch
  12710. deleted file mode 100644
  12711. index cc55877..0000000
  12712. --- a/package/mac80211/patches/406-ath_regd_us.patch
  12713. +++ /dev/null
  12714. @@ -1,26 +0,0 @@
  12715. ---- a/drivers/net/wireless/ath/regd_common.h
  12716. -+++ b/drivers/net/wireless/ath/regd_common.h
  12717. -@@ -32,6 +32,7 @@ enum EnumRd {
  12718. - FCC2_WORLD = 0x21,
  12719. - FCC2_ETSIC = 0x22,
  12720. - FCC6_WORLD = 0x23,
  12721. -+ FCC3_FCCA_2 = 0x2A,
  12722. - FRANCE_RES = 0x31,
  12723. - FCC3_FCCA = 0x3A,
  12724. - FCC3_WORLD = 0x3B,
  12725. -@@ -167,6 +168,7 @@ static struct reg_dmn_pair_mapping regDo
  12726. - {FCC2_WORLD, CTL_FCC, CTL_ETSI},
  12727. - {FCC2_ETSIC, CTL_FCC, CTL_ETSI},
  12728. - {FCC3_FCCA, CTL_FCC, CTL_FCC},
  12729. -+ {FCC3_FCCA_2, CTL_FCC, CTL_FCC},
  12730. - {FCC3_WORLD, CTL_FCC, CTL_ETSI},
  12731. - {FCC4_FCCA, CTL_FCC, CTL_FCC},
  12732. - {FCC5_FCCA, CTL_FCC, CTL_FCC},
  12733. -@@ -463,6 +465,7 @@ static struct country_code_to_enum_rd al
  12734. - {CTRY_UAE, NULL1_WORLD, "AE"},
  12735. - {CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
  12736. - {CTRY_UNITED_STATES, FCC3_FCCA, "US"},
  12737. -+ {CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
  12738. - /* This "PS" is for US public safety actually... to support this we
  12739. - * would need to assign new special alpha2 to CRDA db as with the world
  12740. - * regdomain and use another alpha2 */
  12741. diff --git a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
  12742. deleted file mode 100644
  12743. index f6182dd..0000000
  12744. --- a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
  12745. +++ /dev/null
  12746. @@ -1,10 +0,0 @@
  12747. ---- a/drivers/net/wireless/ath/ath9k/init.c
  12748. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  12749. -@@ -755,6 +755,7 @@ static const struct ieee80211_iface_limi
  12750. - #endif
  12751. - BIT(NL80211_IFTYPE_AP) |
  12752. - BIT(NL80211_IFTYPE_P2P_GO) },
  12753. -+ { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
  12754. - };
  12755. -
  12756. -
  12757. diff --git a/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch b/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
  12758. deleted file mode 100644
  12759. index 12e03e1..0000000
  12760. --- a/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
  12761. +++ /dev/null
  12762. @@ -1,46 +0,0 @@
  12763. ---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  12764. -+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  12765. -@@ -86,13 +86,8 @@ ath5k_add_interface(struct ieee80211_hw
  12766. - goto end;
  12767. - }
  12768. -
  12769. -- /* Don't allow other interfaces if one ad-hoc is configured.
  12770. -- * TODO: Fix the problems with ad-hoc and multiple other interfaces.
  12771. -- * We would need to operate the HW in ad-hoc mode to allow TSF updates
  12772. -- * for the IBSS, but this breaks with additional AP or STA interfaces
  12773. -- * at the moment. */
  12774. -- if (ah->num_adhoc_vifs ||
  12775. -- (ah->nvifs && vif->type == NL80211_IFTYPE_ADHOC)) {
  12776. -+ /* Don't allow more than one ad-hoc interface */
  12777. -+ if (ah->num_adhoc_vifs && vif->type == NL80211_IFTYPE_ADHOC) {
  12778. - ATH5K_ERR(ah, "Only one single ad-hoc interface is allowed.\n");
  12779. - ret = -ELNRNG;
  12780. - goto end;
  12781. ---- a/drivers/net/wireless/ath/ath5k/base.c
  12782. -+++ b/drivers/net/wireless/ath/ath5k/base.c
  12783. -@@ -1916,7 +1916,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  12784. - }
  12785. -
  12786. - if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
  12787. -- ah->num_mesh_vifs > 1) ||
  12788. -+ ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) ||
  12789. - ah->opmode == NL80211_IFTYPE_MESH_POINT) {
  12790. - u64 tsf = ath5k_hw_get_tsf64(ah);
  12791. - u32 tsftu = TSF_TO_TU(tsf);
  12792. -@@ -2002,7 +2002,7 @@ ath5k_beacon_update_timers(struct ath5k_
  12793. -
  12794. - intval = ah->bintval & AR5K_BEACON_PERIOD;
  12795. - if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
  12796. -- + ah->num_mesh_vifs > 1) {
  12797. -+ + ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) {
  12798. - intval /= ATH_BCBUF; /* staggered multi-bss beacons */
  12799. - if (intval < 15)
  12800. - ATH5K_WARN(ah, "intval %u is too low, min 15\n",
  12801. -@@ -2469,6 +2469,7 @@ static const struct ieee80211_iface_limi
  12802. - BIT(NL80211_IFTYPE_MESH_POINT) |
  12803. - #endif
  12804. - BIT(NL80211_IFTYPE_AP) },
  12805. -+ { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
  12806. - };
  12807. -
  12808. - static const struct ieee80211_iface_combination if_comb = {
  12809. diff --git a/package/mac80211/patches/420-ath5k_disable_fast_cc.patch b/package/mac80211/patches/420-ath5k_disable_fast_cc.patch
  12810. deleted file mode 100644
  12811. index 414f495..0000000
  12812. --- a/package/mac80211/patches/420-ath5k_disable_fast_cc.patch
  12813. +++ /dev/null
  12814. @@ -1,18 +0,0 @@
  12815. ---- a/drivers/net/wireless/ath/ath5k/reset.c
  12816. -+++ b/drivers/net/wireless/ath/ath5k/reset.c
  12817. -@@ -1154,6 +1154,7 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum
  12818. - tsf_lo = 0;
  12819. - mode = 0;
  12820. -
  12821. -+#if 0
  12822. - /*
  12823. - * Sanity check for fast flag
  12824. - * Fast channel change only available
  12825. -@@ -1161,6 +1162,7 @@ ath5k_hw_reset(struct ath5k_hw *ah, enum
  12826. - */
  12827. - if (fast && (ah->ah_radio != AR5K_RF2413) &&
  12828. - (ah->ah_radio != AR5K_RF5413))
  12829. -+#endif
  12830. - fast = false;
  12831. -
  12832. - /* Disable sleep clock operation
  12833. diff --git a/package/mac80211/patches/430-add_ath5k_platform.patch b/package/mac80211/patches/430-add_ath5k_platform.patch
  12834. deleted file mode 100644
  12835. index b213e2a..0000000
  12836. --- a/package/mac80211/patches/430-add_ath5k_platform.patch
  12837. +++ /dev/null
  12838. @@ -1,33 +0,0 @@
  12839. ---- /dev/null
  12840. -+++ b/include/linux/ath5k_platform.h
  12841. -@@ -0,0 +1,30 @@
  12842. -+/*
  12843. -+ * Copyright (c) 2008 Atheros Communications Inc.
  12844. -+ * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org>
  12845. -+ * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org>
  12846. -+ * Copyright (c) 2010 Daniel Golle <daniel.golle@gmail.com>
  12847. -+ *
  12848. -+ * Permission to use, copy, modify, and/or distribute this software for any
  12849. -+ * purpose with or without fee is hereby granted, provided that the above
  12850. -+ * copyright notice and this permission notice appear in all copies.
  12851. -+ *
  12852. -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  12853. -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12854. -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12855. -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12856. -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12857. -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12858. -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  12859. -+ */
  12860. -+
  12861. -+#ifndef _LINUX_ATH5K_PLATFORM_H
  12862. -+#define _LINUX_ATH5K_PLATFORM_H
  12863. -+
  12864. -+#define ATH5K_PLAT_EEP_MAX_WORDS 2048
  12865. -+
  12866. -+struct ath5k_platform_data {
  12867. -+ u16 *eeprom_data;
  12868. -+ u8 *macaddr;
  12869. -+};
  12870. -+
  12871. -+#endif /* _LINUX_ATH5K_PLATFORM_H */
  12872. diff --git a/package/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch b/package/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch
  12873. deleted file mode 100644
  12874. index a223b38..0000000
  12875. --- a/package/mac80211/patches/431-add_platform_eeprom_support_to_ath5k.patch
  12876. +++ /dev/null
  12877. @@ -1,56 +0,0 @@
  12878. ---- a/drivers/net/wireless/ath/ath5k/pci.c
  12879. -+++ b/drivers/net/wireless/ath/ath5k/pci.c
  12880. -@@ -21,6 +21,7 @@
  12881. - #include <linux/pci-aspm.h>
  12882. - #include <linux/etherdevice.h>
  12883. - #include <linux/module.h>
  12884. -+#include <linux/ath5k_platform.h>
  12885. - #include "../ath.h"
  12886. - #include "ath5k.h"
  12887. - #include "debug.h"
  12888. -@@ -72,7 +73,7 @@ static void ath5k_pci_read_cachesize(str
  12889. - }
  12890. -
  12891. - /*
  12892. -- * Read from eeprom
  12893. -+ * Read from eeprom or platform_data
  12894. - */
  12895. - static bool
  12896. - ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data)
  12897. -@@ -80,6 +81,19 @@ ath5k_pci_eeprom_read(struct ath_common
  12898. - struct ath5k_hw *ah = (struct ath5k_hw *) common->ah;
  12899. - u32 status, timeout;
  12900. -
  12901. -+ struct ath5k_platform_data *pdata = NULL;
  12902. -+
  12903. -+ if (ah->pdev)
  12904. -+ pdata = ah->pdev->dev.platform_data;
  12905. -+
  12906. -+ if (pdata && pdata->eeprom_data && pdata->eeprom_data[61] == AR5K_EEPROM_MAGIC_VALUE) {
  12907. -+ if (offset >= ATH5K_PLAT_EEP_MAX_WORDS)
  12908. -+ return false;
  12909. -+
  12910. -+ *data = pdata->eeprom_data[offset];
  12911. -+ return true;
  12912. -+ }
  12913. -+
  12914. - /*
  12915. - * Initialize EEPROM access
  12916. - */
  12917. -@@ -123,6 +137,16 @@ static int ath5k_pci_eeprom_read_mac(str
  12918. - u16 data;
  12919. - int octet;
  12920. -
  12921. -+ struct ath5k_platform_data *pdata = NULL;
  12922. -+
  12923. -+ if (ah->pdev)
  12924. -+ pdata = ah->pdev->dev.platform_data;
  12925. -+
  12926. -+ if (pdata && pdata->macaddr) {
  12927. -+ memcpy(mac, pdata->macaddr, ETH_ALEN);
  12928. -+ return 0;
  12929. -+ }
  12930. -+
  12931. - AR5K_EEPROM_READ(0x20, data);
  12932. -
  12933. - for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) {
  12934. diff --git a/package/mac80211/patches/432-ath5k_add_pciids.patch b/package/mac80211/patches/432-ath5k_add_pciids.patch
  12935. deleted file mode 100644
  12936. index e5c85ce..0000000
  12937. --- a/package/mac80211/patches/432-ath5k_add_pciids.patch
  12938. +++ /dev/null
  12939. @@ -1,11 +0,0 @@
  12940. ---- a/drivers/net/wireless/ath/ath5k/pci.c
  12941. -+++ b/drivers/net/wireless/ath/ath5k/pci.c
  12942. -@@ -48,6 +48,8 @@ static DEFINE_PCI_DEVICE_TABLE(ath5k_pci
  12943. - { PCI_VDEVICE(ATHEROS, 0x001b) }, /* 5413 Eagle */
  12944. - { PCI_VDEVICE(ATHEROS, 0x001c) }, /* PCI-E cards */
  12945. - { PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
  12946. -+ { PCI_VDEVICE(ATHEROS, 0xff16) }, /* 2413,2414 sx76x on lantiq_danube */
  12947. -+ { PCI_VDEVICE(ATHEROS, 0xff1a) }, /* 2417 arv45xx on lantiq_danube */
  12948. - { PCI_VDEVICE(ATHEROS, 0xff1b) }, /* AR5BXB63 */
  12949. - { 0 }
  12950. - };
  12951. diff --git a/package/mac80211/patches/440-ath5k_channel_bw_debugfs.patch b/package/mac80211/patches/440-ath5k_channel_bw_debugfs.patch
  12952. deleted file mode 100644
  12953. index 01c28bc..0000000
  12954. --- a/package/mac80211/patches/440-ath5k_channel_bw_debugfs.patch
  12955. +++ /dev/null
  12956. @@ -1,113 +0,0 @@
  12957. -This adds a bwmode debugfs file which can be used to set alternate
  12958. -channel operating bandwidths. Only tested with AR5413 and only at
  12959. -5 and 20 mhz channels.
  12960. -
  12961. -Signed-off-by: Pat Erley <pat-lkml at erley.org>
  12962. ----
  12963. -Other devices will need to be added to the switch in write_file_bwmode
  12964. -
  12965. -drivers/net/wireless/ath/ath5k/debug.c | 86 ++++++++++++++++++++++++++++++++
  12966. - 1 files changed, 86 insertions(+), 0 deletions(-)
  12967. -
  12968. ---- a/drivers/net/wireless/ath/ath5k/debug.c
  12969. -+++ b/drivers/net/wireless/ath/ath5k/debug.c
  12970. -@@ -811,6 +811,89 @@ static const struct file_operations fops
  12971. - .llseek = default_llseek,
  12972. - };
  12973. -
  12974. -+/* debugfs: bwmode */
  12975. -+
  12976. -+static ssize_t read_file_bwmode(struct file *file, char __user *user_buf,
  12977. -+ size_t count, loff_t *ppos)
  12978. -+{
  12979. -+ struct ath5k_hw *ah = file->private_data;
  12980. -+ char buf[15];
  12981. -+ unsigned int len = 0;
  12982. -+
  12983. -+ int cur_ah_bwmode = ah->ah_bwmode;
  12984. -+
  12985. -+#define print_selected(MODE, LABEL) \
  12986. -+ if (cur_ah_bwmode == MODE) \
  12987. -+ len += snprintf(buf+len, sizeof(buf)-len, "[%s]", LABEL); \
  12988. -+ else \
  12989. -+ len += snprintf(buf+len, sizeof(buf)-len, "%s", LABEL); \
  12990. -+ len += snprintf(buf+len, sizeof(buf)-len, " ");
  12991. -+
  12992. -+ print_selected(AR5K_BWMODE_5MHZ, "5");
  12993. -+ print_selected(AR5K_BWMODE_10MHZ, "10");
  12994. -+ print_selected(AR5K_BWMODE_DEFAULT, "20");
  12995. -+ print_selected(AR5K_BWMODE_40MHZ, "40");
  12996. -+#undef print_selected
  12997. -+
  12998. -+ len += snprintf(buf+len, sizeof(buf)-len, "\n");
  12999. -+
  13000. -+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  13001. -+}
  13002. -+
  13003. -+static ssize_t write_file_bwmode(struct file *file,
  13004. -+ const char __user *userbuf,
  13005. -+ size_t count, loff_t *ppos)
  13006. -+{
  13007. -+ struct ath5k_hw *ah = file->private_data;
  13008. -+ char buf[3];
  13009. -+ int bw = 20;
  13010. -+ int tobwmode = AR5K_BWMODE_DEFAULT;
  13011. -+
  13012. -+ if (copy_from_user(buf, userbuf, min(count, sizeof(buf))))
  13013. -+ return -EFAULT;
  13014. -+
  13015. -+ /* TODO: Add check for active interface */
  13016. -+
  13017. -+ if(strncmp(buf, "5", 1) == 0 ) {
  13018. -+ tobwmode = AR5K_BWMODE_5MHZ;
  13019. -+ bw = 5;
  13020. -+ } else if ( strncmp(buf, "10", 2) == 0 ) {
  13021. -+ tobwmode = AR5K_BWMODE_10MHZ;
  13022. -+ bw = 10;
  13023. -+ } else if ( strncmp(buf, "20", 2) == 0 ) {
  13024. -+ tobwmode = AR5K_BWMODE_DEFAULT;
  13025. -+ bw = 20;
  13026. -+ } else if ( strncmp(buf, "40", 2) == 0 ) {
  13027. -+ tobwmode = AR5K_BWMODE_40MHZ;
  13028. -+ bw = 40;
  13029. -+ } else
  13030. -+ return -EINVAL;
  13031. -+
  13032. -+ ATH5K_INFO(ah, "Changing to %imhz channel width[%i]\n",
  13033. -+ bw, tobwmode);
  13034. -+
  13035. -+ switch (ah->ah_radio) {
  13036. -+ /* TODO: only define radios that actually support 5/10mhz channels */
  13037. -+ case AR5K_RF5413: case AR5K_RF5110: case AR5K_RF5111: case AR5K_RF5112: case AR5K_RF2413: case AR5K_RF2316: case AR5K_RF2317: case AR5K_RF2425:
  13038. -+ if(ah->ah_bwmode != tobwmode) {
  13039. -+ mutex_lock(&ah->lock);
  13040. -+ ah->ah_bwmode = tobwmode;
  13041. -+ mutex_unlock(&ah->lock);
  13042. -+ }
  13043. -+ break;
  13044. -+ default:
  13045. -+ return -EOPNOTSUPP;
  13046. -+ }
  13047. -+ return count;
  13048. -+}
  13049. -+
  13050. -+static const struct file_operations fops_bwmode = {
  13051. -+ .read = read_file_bwmode,
  13052. -+ .write = write_file_bwmode,
  13053. -+ .open = simple_open,
  13054. -+ .owner = THIS_MODULE,
  13055. -+ .llseek = default_llseek,
  13056. -+};
  13057. -
  13058. - /* debugfs: queues etc */
  13059. -
  13060. -@@ -902,6 +985,9 @@ ath5k_debug_init_device(struct ath5k_hw
  13061. - debugfs_create_file("beacon", S_IWUSR | S_IRUSR, phydir, ah,
  13062. - &fops_beacon);
  13063. -
  13064. -+ debugfs_create_file("bwmode", S_IWUSR | S_IRUSR, phydir, ah,
  13065. -+ &fops_bwmode);
  13066. -+
  13067. - debugfs_create_file("reset", S_IWUSR, phydir, ah, &fops_reset);
  13068. -
  13069. - debugfs_create_file("antenna", S_IWUSR | S_IRUSR, phydir, ah,
  13070. diff --git a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
  13071. deleted file mode 100644
  13072. index 7f4e68d..0000000
  13073. --- a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
  13074. +++ /dev/null
  13075. @@ -1,65 +0,0 @@
  13076. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  13077. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  13078. -@@ -1735,6 +1735,53 @@ void ath9k_deinit_debug(struct ath_softc
  13079. - }
  13080. - }
  13081. -
  13082. -+static ssize_t read_file_eeprom(struct file *file, char __user *user_buf,
  13083. -+ size_t count, loff_t *ppos)
  13084. -+{
  13085. -+ struct ath_softc *sc = file->private_data;
  13086. -+ struct ath_hw *ah = sc->sc_ah;
  13087. -+ struct ath_common *common = ath9k_hw_common(ah);
  13088. -+ int bytes = 0;
  13089. -+ int pos = *ppos;
  13090. -+ int size = 4096;
  13091. -+ u16 val;
  13092. -+ int i;
  13093. -+
  13094. -+ if (AR_SREV_9300_20_OR_LATER(ah))
  13095. -+ size = 16384;
  13096. -+
  13097. -+ if (*ppos < 0)
  13098. -+ return -EINVAL;
  13099. -+
  13100. -+ if (count > size - *ppos)
  13101. -+ count = size - *ppos;
  13102. -+
  13103. -+ for (i = *ppos / 2; count > 0; count -= bytes, *ppos += bytes, i++) {
  13104. -+ void *from = &val;
  13105. -+
  13106. -+ if (!common->bus_ops->eeprom_read(common, i, &val))
  13107. -+ val = 0xffff;
  13108. -+
  13109. -+ if (*ppos % 2) {
  13110. -+ from++;
  13111. -+ bytes = 1;
  13112. -+ } else if (count == 1) {
  13113. -+ bytes = 1;
  13114. -+ } else {
  13115. -+ bytes = 2;
  13116. -+ }
  13117. -+ copy_to_user(user_buf, from, bytes);
  13118. -+ user_buf += bytes;
  13119. -+ }
  13120. -+ return *ppos - pos;
  13121. -+}
  13122. -+
  13123. -+static const struct file_operations fops_eeprom = {
  13124. -+ .read = read_file_eeprom,
  13125. -+ .open = simple_open,
  13126. -+ .owner = THIS_MODULE
  13127. -+};
  13128. -+
  13129. - int ath9k_init_debug(struct ath_hw *ah)
  13130. - {
  13131. - struct ath_common *common = ath9k_hw_common(ah);
  13132. -@@ -1752,6 +1799,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  13133. -
  13134. - ath9k_dfs_init_debug(sc);
  13135. -
  13136. -+ debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
  13137. -+ &fops_eeprom);
  13138. - debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
  13139. - &fops_dma);
  13140. - debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
  13141. diff --git a/package/mac80211/patches/501-ath9k-eeprom_endianess.patch b/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
  13142. deleted file mode 100644
  13143. index b98e8f5..0000000
  13144. --- a/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
  13145. +++ /dev/null
  13146. @@ -1,102 +0,0 @@
  13147. ---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
  13148. -+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
  13149. -@@ -262,7 +262,7 @@ static int ath9k_hw_def_check_eeprom(str
  13150. - {
  13151. - struct ar5416_eeprom_def *eep = &ah->eeprom.def;
  13152. - struct ath_common *common = ath9k_hw_common(ah);
  13153. -- u16 *eepdata, temp, magic, magic2;
  13154. -+ u16 *eepdata, temp, magic;
  13155. - u32 sum = 0, el;
  13156. - bool need_swap = false;
  13157. - int i, addr, size;
  13158. -@@ -272,27 +272,16 @@ static int ath9k_hw_def_check_eeprom(str
  13159. - return false;
  13160. - }
  13161. -
  13162. -- if (!ath9k_hw_use_flash(ah)) {
  13163. -- ath_dbg(common, EEPROM, "Read Magic = 0x%04X\n", magic);
  13164. --
  13165. -- if (magic != AR5416_EEPROM_MAGIC) {
  13166. -- magic2 = swab16(magic);
  13167. --
  13168. -- if (magic2 == AR5416_EEPROM_MAGIC) {
  13169. -- size = sizeof(struct ar5416_eeprom_def);
  13170. -- need_swap = true;
  13171. -- eepdata = (u16 *) (&ah->eeprom);
  13172. --
  13173. -- for (addr = 0; addr < size / sizeof(u16); addr++) {
  13174. -- temp = swab16(*eepdata);
  13175. -- *eepdata = temp;
  13176. -- eepdata++;
  13177. -- }
  13178. -- } else {
  13179. -- ath_err(common,
  13180. -- "Invalid EEPROM Magic. Endianness mismatch.\n");
  13181. -- return -EINVAL;
  13182. -- }
  13183. -+ if (swab16(magic) == AR5416_EEPROM_MAGIC &&
  13184. -+ !(ah->ah_flags & AH_NO_EEP_SWAP)) {
  13185. -+ size = sizeof(struct ar5416_eeprom_def);
  13186. -+ need_swap = true;
  13187. -+ eepdata = (u16 *) (&ah->eeprom);
  13188. -+
  13189. -+ for (addr = 0; addr < size / sizeof(u16); addr++) {
  13190. -+ temp = swab16(*eepdata);
  13191. -+ *eepdata = temp;
  13192. -+ eepdata++;
  13193. - }
  13194. - }
  13195. -
  13196. ---- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  13197. -+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  13198. -@@ -57,7 +57,7 @@ static bool ath9k_hw_4k_fill_eeprom(stru
  13199. - {
  13200. - struct ath_common *common = ath9k_hw_common(ah);
  13201. -
  13202. -- if (!ath9k_hw_use_flash(ah)) {
  13203. -+ if (!(ah->ah_flags & AH_NO_EEP_SWAP)) {
  13204. - ath_dbg(common, EEPROM, "Reading from EEPROM, not flash\n");
  13205. - }
  13206. -
  13207. ---- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  13208. -+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  13209. -@@ -60,7 +60,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(
  13210. - {
  13211. - struct ath_common *common = ath9k_hw_common(ah);
  13212. -
  13213. -- if (!ath9k_hw_use_flash(ah)) {
  13214. -+ if (!(ah->ah_flags & AH_NO_EEP_SWAP)) {
  13215. - ath_dbg(common, EEPROM, "Reading from EEPROM, not flash\n");
  13216. - }
  13217. -
  13218. ---- a/drivers/net/wireless/ath/ath9k/hw.h
  13219. -+++ b/drivers/net/wireless/ath/ath9k/hw.h
  13220. -@@ -739,6 +739,7 @@ enum ath_cal_list {
  13221. - #define AH_USE_EEPROM 0x1
  13222. - #define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
  13223. - #define AH_FASTCC 0x4
  13224. -+#define AH_NO_EEP_SWAP 0x8 /* Do not swap EEPROM data */
  13225. -
  13226. - struct ath_hw {
  13227. - struct ath_ops reg_ops;
  13228. ---- a/drivers/net/wireless/ath/ath9k/init.c
  13229. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  13230. -@@ -613,6 +613,8 @@ static int ath9k_init_softc(u16 devid, s
  13231. - ah->is_clk_25mhz = pdata->is_clk_25mhz;
  13232. - ah->get_mac_revision = pdata->get_mac_revision;
  13233. - ah->external_reset = pdata->external_reset;
  13234. -+ if (!pdata->endian_check)
  13235. -+ ah->ah_flags |= AH_NO_EEP_SWAP;
  13236. - }
  13237. -
  13238. - common = ath9k_hw_common(ah);
  13239. ---- a/include/linux/ath9k_platform.h
  13240. -+++ b/include/linux/ath9k_platform.h
  13241. -@@ -31,6 +31,7 @@ struct ath9k_platform_data {
  13242. - u32 gpio_mask;
  13243. - u32 gpio_val;
  13244. -
  13245. -+ bool endian_check;
  13246. - bool is_clk_25mhz;
  13247. - int (*get_mac_revision)(void);
  13248. - int (*external_reset)(void);
  13249. diff --git a/package/mac80211/patches/502-ath9k_ahb_init.patch b/package/mac80211/patches/502-ath9k_ahb_init.patch
  13250. deleted file mode 100644
  13251. index 03199d8..0000000
  13252. --- a/package/mac80211/patches/502-ath9k_ahb_init.patch
  13253. +++ /dev/null
  13254. @@ -1,32 +0,0 @@
  13255. ---- a/drivers/net/wireless/ath/ath9k/init.c
  13256. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  13257. -@@ -1011,23 +1011,23 @@ static int __init ath9k_init(void)
  13258. - goto err_out;
  13259. - }
  13260. -
  13261. -- error = ath_pci_init();
  13262. -+ error = ath_ahb_init();
  13263. - if (error < 0) {
  13264. -- pr_err("No PCI devices found, driver not installed\n");
  13265. - error = -ENODEV;
  13266. - goto err_rate_unregister;
  13267. - }
  13268. -
  13269. -- error = ath_ahb_init();
  13270. -+ error = ath_pci_init();
  13271. - if (error < 0) {
  13272. -+ pr_err("No PCI devices found, driver not installed\n");
  13273. - error = -ENODEV;
  13274. -- goto err_pci_exit;
  13275. -+ goto err_ahb_exit;
  13276. - }
  13277. -
  13278. - return 0;
  13279. -
  13280. -- err_pci_exit:
  13281. -- ath_pci_exit();
  13282. -+ err_ahb_exit:
  13283. -+ ath_ahb_exit();
  13284. -
  13285. - err_rate_unregister:
  13286. - ath_rate_control_unregister();
  13287. diff --git a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
  13288. deleted file mode 100644
  13289. index 647bde2..0000000
  13290. --- a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
  13291. +++ /dev/null
  13292. @@ -1,13 +0,0 @@
  13293. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  13294. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  13295. -@@ -2010,8 +2010,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  13296. - REG_WRITE(ah, AR_OBS, 8);
  13297. -
  13298. - if (ah->config.rx_intr_mitigation) {
  13299. -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
  13300. -- REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 2000);
  13301. -+ REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 250);
  13302. -+ REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 500);
  13303. - }
  13304. -
  13305. - if (ah->config.tx_intr_mitigation) {
  13306. diff --git a/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch
  13307. deleted file mode 100644
  13308. index 8d8c5fd..0000000
  13309. --- a/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch
  13310. +++ /dev/null
  13311. @@ -1,11 +0,0 @@
  13312. ---- a/drivers/net/wireless/ath/ath9k/ath9k.h
  13313. -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  13314. -@@ -119,7 +119,7 @@ int ath_descdma_setup(struct ath_softc *
  13315. - /* RX / TX */
  13316. - /***********/
  13317. -
  13318. --#define ATH_RXBUF 512
  13319. -+#define ATH_RXBUF 256
  13320. - #define ATH_TXBUF 512
  13321. - #define ATH_TXBUF_RESERVE 5
  13322. - #define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)
  13323. diff --git a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
  13324. deleted file mode 100644
  13325. index a42daf5..0000000
  13326. --- a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
  13327. +++ /dev/null
  13328. @@ -1,128 +0,0 @@
  13329. ---- a/drivers/net/wireless/ath/ath9k/ath9k.h
  13330. -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  13331. -@@ -701,6 +701,7 @@ struct ath_softc {
  13332. - struct ieee80211_hw *hw;
  13333. - struct device *dev;
  13334. -
  13335. -+ u32 chan_bw;
  13336. - struct survey_info *cur_survey;
  13337. - struct survey_info survey[ATH9K_NUM_CHANNELS];
  13338. -
  13339. -@@ -905,6 +906,7 @@ struct fft_sample_ht20 {
  13340. - u8 data[SPECTRAL_HT20_NUM_BINS];
  13341. - } __packed;
  13342. -
  13343. -+int ath9k_config(struct ieee80211_hw *hw, u32 changed);
  13344. - void ath9k_tasklet(unsigned long data);
  13345. - int ath_cabq_update(struct ath_softc *);
  13346. -
  13347. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  13348. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  13349. -@@ -1782,6 +1782,50 @@ static const struct file_operations fops
  13350. - .owner = THIS_MODULE
  13351. - };
  13352. -
  13353. -+
  13354. -+static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf,
  13355. -+ size_t count, loff_t *ppos)
  13356. -+{
  13357. -+ struct ath_softc *sc = file->private_data;
  13358. -+ char buf[32];
  13359. -+ unsigned int len;
  13360. -+
  13361. -+ len = sprintf(buf, "0x%08x\n", sc->chan_bw);
  13362. -+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  13363. -+}
  13364. -+
  13365. -+static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf,
  13366. -+ size_t count, loff_t *ppos)
  13367. -+{
  13368. -+ struct ath_softc *sc = file->private_data;
  13369. -+ unsigned long chan_bw;
  13370. -+ char buf[32];
  13371. -+ ssize_t len;
  13372. -+
  13373. -+ len = min(count, sizeof(buf) - 1);
  13374. -+ if (copy_from_user(buf, user_buf, len))
  13375. -+ return -EFAULT;
  13376. -+
  13377. -+ buf[len] = '\0';
  13378. -+ if (kstrtoul(buf, 0, &chan_bw))
  13379. -+ return -EINVAL;
  13380. -+
  13381. -+ sc->chan_bw = chan_bw;
  13382. -+ if (!test_bit(SC_OP_INVALID, &sc->sc_flags))
  13383. -+ ath9k_config(sc->hw, IEEE80211_CONF_CHANGE_CHANNEL);
  13384. -+
  13385. -+ return count;
  13386. -+}
  13387. -+
  13388. -+static const struct file_operations fops_chanbw = {
  13389. -+ .read = read_file_chan_bw,
  13390. -+ .write = write_file_chan_bw,
  13391. -+ .open = simple_open,
  13392. -+ .owner = THIS_MODULE,
  13393. -+ .llseek = default_llseek,
  13394. -+};
  13395. -+
  13396. -+
  13397. - int ath9k_init_debug(struct ath_hw *ah)
  13398. - {
  13399. - struct ath_common *common = ath9k_hw_common(ah);
  13400. -@@ -1801,6 +1845,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  13401. -
  13402. - debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
  13403. - &fops_eeprom);
  13404. -+ debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  13405. -+ sc, &fops_chanbw);
  13406. - debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
  13407. - &fops_dma);
  13408. - debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
  13409. ---- a/drivers/net/wireless/ath/ath9k/main.c
  13410. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  13411. -@@ -1138,7 +1138,7 @@ int ath9k_spectral_scan_config(struct ie
  13412. - return 0;
  13413. - }
  13414. -
  13415. --static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
  13416. -+int ath9k_config(struct ieee80211_hw *hw, u32 changed)
  13417. - {
  13418. - struct ath_softc *sc = hw->priv;
  13419. - struct ath_hw *ah = sc->sc_ah;
  13420. -@@ -1194,9 +1194,11 @@ static int ath9k_config(struct ieee80211
  13421. - struct ieee80211_channel *curchan = hw->conf.chandef.chan;
  13422. - enum nl80211_channel_type channel_type =
  13423. - cfg80211_get_chandef_type(&conf->chandef);
  13424. -+ struct ath9k_channel *hchan;
  13425. - int pos = curchan->hw_value;
  13426. - int old_pos = -1;
  13427. - unsigned long flags;
  13428. -+ u32 oldflags;
  13429. -
  13430. - if (ah->curchan)
  13431. - old_pos = ah->curchan - &ah->channels[0];
  13432. -@@ -1232,7 +1234,23 @@ static int ath9k_config(struct ieee80211
  13433. - memset(&sc->survey[pos], 0, sizeof(struct survey_info));
  13434. - }
  13435. -
  13436. -- if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) {
  13437. -+ hchan = &sc->sc_ah->channels[pos];
  13438. -+ oldflags = hchan->channelFlags;
  13439. -+ switch (sc->chan_bw) {
  13440. -+ case 5:
  13441. -+ hchan->channelFlags &= ~CHANNEL_HALF;
  13442. -+ hchan->channelFlags |= CHANNEL_QUARTER;
  13443. -+ break;
  13444. -+ case 10:
  13445. -+ hchan->channelFlags &= ~CHANNEL_QUARTER;
  13446. -+ hchan->channelFlags |= CHANNEL_HALF;
  13447. -+ break;
  13448. -+ default:
  13449. -+ hchan->channelFlags &= ~(CHANNEL_HALF | CHANNEL_QUARTER);
  13450. -+ break;
  13451. -+ }
  13452. -+
  13453. -+ if (ath_set_channel(sc, hw, hchan) < 0) {
  13454. - ath_err(common, "Unable to set channel\n");
  13455. - mutex_unlock(&sc->mutex);
  13456. - ath9k_ps_restore(sc);
  13457. diff --git a/package/mac80211/patches/520-mac80211_cur_txpower.patch b/package/mac80211/patches/520-mac80211_cur_txpower.patch
  13458. deleted file mode 100644
  13459. index 837d9f6..0000000
  13460. --- a/package/mac80211/patches/520-mac80211_cur_txpower.patch
  13461. +++ /dev/null
  13462. @@ -1,33 +0,0 @@
  13463. ---- a/include/net/mac80211.h
  13464. -+++ b/include/net/mac80211.h
  13465. -@@ -1616,6 +1616,7 @@ struct ieee80211_hw {
  13466. - u8 max_tx_aggregation_subframes;
  13467. - u8 offchannel_tx_hw_queue;
  13468. - u8 radiotap_mcs_details;
  13469. -+ s8 cur_power_level;
  13470. - u16 radiotap_vht_details;
  13471. - netdev_features_t netdev_features;
  13472. - u8 uapsd_queues;
  13473. ---- a/net/mac80211/cfg.c
  13474. -+++ b/net/mac80211/cfg.c
  13475. -@@ -2273,7 +2273,9 @@ static int ieee80211_get_tx_power(struct
  13476. - struct ieee80211_local *local = wiphy_priv(wiphy);
  13477. - struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
  13478. -
  13479. -- if (!local->use_chanctx)
  13480. -+ if (local->hw.cur_power_level)
  13481. -+ *dbm = local->hw.cur_power_level;
  13482. -+ else if (!local->use_chanctx)
  13483. - *dbm = local->hw.conf.power_level;
  13484. - else
  13485. - *dbm = sdata->vif.bss_conf.txpower;
  13486. ---- a/net/mac80211/main.c
  13487. -+++ b/net/mac80211/main.c
  13488. -@@ -167,6 +167,7 @@ static u32 ieee80211_hw_conf_chan(struct
  13489. -
  13490. - if (local->hw.conf.power_level != power) {
  13491. - changed |= IEEE80211_CONF_CHANGE_POWER;
  13492. -+ local->hw.cur_power_level = power;
  13493. - local->hw.conf.power_level = power;
  13494. - }
  13495. -
  13496. diff --git a/package/mac80211/patches/521-ath9k_cur_txpower.patch b/package/mac80211/patches/521-ath9k_cur_txpower.patch
  13497. deleted file mode 100644
  13498. index a14d031..0000000
  13499. --- a/package/mac80211/patches/521-ath9k_cur_txpower.patch
  13500. +++ /dev/null
  13501. @@ -1,19 +0,0 @@
  13502. ---- a/drivers/net/wireless/ath/ath9k/main.c
  13503. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  13504. -@@ -1257,6 +1257,8 @@ int ath9k_config(struct ieee80211_hw *hw
  13505. - return -EINVAL;
  13506. - }
  13507. -
  13508. -+ hw->cur_power_level = sc->curtxpow / 2;
  13509. -+
  13510. - /*
  13511. - * The most recent snapshot of channel->noisefloor for the old
  13512. - * channel is only available after the hardware reset. Copy it to
  13513. -@@ -1293,6 +1295,7 @@ int ath9k_config(struct ieee80211_hw *hw
  13514. - sc->config.txpowlimit = 2 * conf->power_level;
  13515. - ath9k_cmn_update_txpow(ah, sc->curtxpow,
  13516. - sc->config.txpowlimit, &sc->curtxpow);
  13517. -+ hw->cur_power_level = sc->curtxpow / 2;
  13518. - }
  13519. -
  13520. - mutex_unlock(&sc->mutex);
  13521. diff --git a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch
  13522. deleted file mode 100644
  13523. index 50dbcd9..0000000
  13524. --- a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch
  13525. +++ /dev/null
  13526. @@ -1,153 +0,0 @@
  13527. ---- a/drivers/net/wireless/ath/ath9k/mac.h
  13528. -+++ b/drivers/net/wireless/ath/ath9k/mac.h
  13529. -@@ -133,12 +133,8 @@ struct ath_rx_status {
  13530. - u8 rs_rate;
  13531. - u8 rs_antenna;
  13532. - u8 rs_more;
  13533. -- int8_t rs_rssi_ctl0;
  13534. -- int8_t rs_rssi_ctl1;
  13535. -- int8_t rs_rssi_ctl2;
  13536. -- int8_t rs_rssi_ext0;
  13537. -- int8_t rs_rssi_ext1;
  13538. -- int8_t rs_rssi_ext2;
  13539. -+ int8_t rs_rssi_ctl[3];
  13540. -+ int8_t rs_rssi_ext[3];
  13541. - u8 rs_isaggr;
  13542. - u8 rs_moreaggr;
  13543. - u8 rs_num_delims;
  13544. ---- a/drivers/net/wireless/ath/ath9k/recv.c
  13545. -+++ b/drivers/net/wireless/ath/ath9k/recv.c
  13546. -@@ -939,6 +939,7 @@ static int ath9k_rx_skb_preprocess(struc
  13547. - struct ath_hw *ah = sc->sc_ah;
  13548. - struct ath_common *common = ath9k_hw_common(ah);
  13549. - bool discard_current = sc->rx.discard_next;
  13550. -+ int i, j;
  13551. -
  13552. - sc->rx.discard_next = rx_stats->rs_more;
  13553. - if (discard_current)
  13554. -@@ -968,6 +969,21 @@ static int ath9k_rx_skb_preprocess(struc
  13555. - if (rx_stats->rs_moreaggr)
  13556. - rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
  13557. -
  13558. -+ for (i = 0, j = 0; i < ARRAY_SIZE(rx_stats->rs_rssi_ctl); i++) {
  13559. -+ s8 rssi;
  13560. -+
  13561. -+ if (!(ah->rxchainmask & BIT(i)))
  13562. -+ continue;
  13563. -+
  13564. -+ rssi = rx_stats->rs_rssi_ctl[i];
  13565. -+ if (rssi != ATH9K_RSSI_BAD) {
  13566. -+ rx_status->chains |= BIT(j);
  13567. -+ rx_status->chain_signal[j] = ah->noise + rssi;
  13568. -+ }
  13569. -+ j++;
  13570. -+ }
  13571. -+
  13572. -+
  13573. - sc->rx.discard_next = false;
  13574. - return 0;
  13575. - }
  13576. -@@ -1077,7 +1093,7 @@ static int ath_process_fft(struct ath_so
  13577. - fft_sample.tlv.length = __cpu_to_be16(length);
  13578. -
  13579. - fft_sample.freq = __cpu_to_be16(ah->curchan->chan->center_freq);
  13580. -- fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
  13581. -+ fft_sample.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]);
  13582. - fft_sample.noise = ah->noise;
  13583. -
  13584. - switch (len - SPECTRAL_HT20_TOTAL_DATA_LEN) {
  13585. ---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  13586. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  13587. -@@ -476,12 +476,12 @@ int ath9k_hw_process_rxdesc_edma(struct
  13588. -
  13589. - /* XXX: Keycache */
  13590. - rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined);
  13591. -- rxs->rs_rssi_ctl0 = MS(rxsp->status1, AR_RxRSSIAnt00);
  13592. -- rxs->rs_rssi_ctl1 = MS(rxsp->status1, AR_RxRSSIAnt01);
  13593. -- rxs->rs_rssi_ctl2 = MS(rxsp->status1, AR_RxRSSIAnt02);
  13594. -- rxs->rs_rssi_ext0 = MS(rxsp->status5, AR_RxRSSIAnt10);
  13595. -- rxs->rs_rssi_ext1 = MS(rxsp->status5, AR_RxRSSIAnt11);
  13596. -- rxs->rs_rssi_ext2 = MS(rxsp->status5, AR_RxRSSIAnt12);
  13597. -+ rxs->rs_rssi_ctl[0] = MS(rxsp->status1, AR_RxRSSIAnt00);
  13598. -+ rxs->rs_rssi_ctl[1] = MS(rxsp->status1, AR_RxRSSIAnt01);
  13599. -+ rxs->rs_rssi_ctl[2] = MS(rxsp->status1, AR_RxRSSIAnt02);
  13600. -+ rxs->rs_rssi_ext[0] = MS(rxsp->status5, AR_RxRSSIAnt10);
  13601. -+ rxs->rs_rssi_ext[1] = MS(rxsp->status5, AR_RxRSSIAnt11);
  13602. -+ rxs->rs_rssi_ext[2] = MS(rxsp->status5, AR_RxRSSIAnt12);
  13603. -
  13604. - if (rxsp->status11 & AR_RxKeyIdxValid)
  13605. - rxs->rs_keyix = MS(rxsp->status11, AR_KeyIdx);
  13606. ---- a/drivers/net/wireless/ath/ath9k/mac.c
  13607. -+++ b/drivers/net/wireless/ath/ath9k/mac.c
  13608. -@@ -554,25 +554,25 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
  13609. -
  13610. - if (ads.ds_rxstatus8 & AR_PostDelimCRCErr) {
  13611. - rs->rs_rssi = ATH9K_RSSI_BAD;
  13612. -- rs->rs_rssi_ctl0 = ATH9K_RSSI_BAD;
  13613. -- rs->rs_rssi_ctl1 = ATH9K_RSSI_BAD;
  13614. -- rs->rs_rssi_ctl2 = ATH9K_RSSI_BAD;
  13615. -- rs->rs_rssi_ext0 = ATH9K_RSSI_BAD;
  13616. -- rs->rs_rssi_ext1 = ATH9K_RSSI_BAD;
  13617. -- rs->rs_rssi_ext2 = ATH9K_RSSI_BAD;
  13618. -+ rs->rs_rssi_ctl[0] = ATH9K_RSSI_BAD;
  13619. -+ rs->rs_rssi_ctl[1] = ATH9K_RSSI_BAD;
  13620. -+ rs->rs_rssi_ctl[2] = ATH9K_RSSI_BAD;
  13621. -+ rs->rs_rssi_ext[0] = ATH9K_RSSI_BAD;
  13622. -+ rs->rs_rssi_ext[1] = ATH9K_RSSI_BAD;
  13623. -+ rs->rs_rssi_ext[2] = ATH9K_RSSI_BAD;
  13624. - } else {
  13625. - rs->rs_rssi = MS(ads.ds_rxstatus4, AR_RxRSSICombined);
  13626. -- rs->rs_rssi_ctl0 = MS(ads.ds_rxstatus0,
  13627. -+ rs->rs_rssi_ctl[0] = MS(ads.ds_rxstatus0,
  13628. - AR_RxRSSIAnt00);
  13629. -- rs->rs_rssi_ctl1 = MS(ads.ds_rxstatus0,
  13630. -+ rs->rs_rssi_ctl[1] = MS(ads.ds_rxstatus0,
  13631. - AR_RxRSSIAnt01);
  13632. -- rs->rs_rssi_ctl2 = MS(ads.ds_rxstatus0,
  13633. -+ rs->rs_rssi_ctl[2] = MS(ads.ds_rxstatus0,
  13634. - AR_RxRSSIAnt02);
  13635. -- rs->rs_rssi_ext0 = MS(ads.ds_rxstatus4,
  13636. -+ rs->rs_rssi_ext[0] = MS(ads.ds_rxstatus4,
  13637. - AR_RxRSSIAnt10);
  13638. -- rs->rs_rssi_ext1 = MS(ads.ds_rxstatus4,
  13639. -+ rs->rs_rssi_ext[1] = MS(ads.ds_rxstatus4,
  13640. - AR_RxRSSIAnt11);
  13641. -- rs->rs_rssi_ext2 = MS(ads.ds_rxstatus4,
  13642. -+ rs->rs_rssi_ext[2] = MS(ads.ds_rxstatus4,
  13643. - AR_RxRSSIAnt12);
  13644. - }
  13645. - if (ads.ds_rxstatus8 & AR_RxKeyIdxValid)
  13646. ---- a/drivers/net/wireless/ath/ath9k/dfs.c
  13647. -+++ b/drivers/net/wireless/ath/ath9k/dfs.c
  13648. -@@ -158,8 +158,8 @@ void ath9k_dfs_process_phyerr(struct ath
  13649. - return;
  13650. - }
  13651. -
  13652. -- ard.rssi = rs->rs_rssi_ctl0;
  13653. -- ard.ext_rssi = rs->rs_rssi_ext0;
  13654. -+ ard.rssi = rs->rs_rssi_ctl[0];
  13655. -+ ard.ext_rssi = rs->rs_rssi_ext[0];
  13656. -
  13657. - /*
  13658. - * hardware stores this as 8 bit signed value.
  13659. ---- a/drivers/net/wireless/ath/ath9k/antenna.c
  13660. -+++ b/drivers/net/wireless/ath/ath9k/antenna.c
  13661. -@@ -546,14 +546,14 @@ void ath_ant_comb_scan(struct ath_softc
  13662. - struct ath_ant_comb *antcomb = &sc->ant_comb;
  13663. - int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set;
  13664. - int curr_main_set;
  13665. -- int main_rssi = rs->rs_rssi_ctl0;
  13666. -- int alt_rssi = rs->rs_rssi_ctl1;
  13667. -+ int main_rssi = rs->rs_rssi_ctl[0];
  13668. -+ int alt_rssi = rs->rs_rssi_ctl[1];
  13669. - int rx_ant_conf, main_ant_conf;
  13670. - bool short_scan = false;
  13671. -
  13672. -- rx_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_CURRENT_SHIFT) &
  13673. -+ rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) &
  13674. - ATH_ANT_RX_MASK;
  13675. -- main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) &
  13676. -+ main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) &
  13677. - ATH_ANT_RX_MASK;
  13678. -
  13679. - /* Record packet only when both main_rssi and alt_rssi is positive */
  13680. diff --git a/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch b/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch
  13681. deleted file mode 100644
  13682. index d247c56..0000000
  13683. --- a/package/mac80211/patches/523-mac80211_configure_antenna_gain.patch
  13684. +++ /dev/null
  13685. @@ -1,161 +0,0 @@
  13686. ---- a/include/net/mac80211.h
  13687. -+++ b/include/net/mac80211.h
  13688. -@@ -999,6 +999,7 @@ enum ieee80211_smps_mode {
  13689. - *
  13690. - * @power_level: requested transmit power (in dBm), backward compatibility
  13691. - * value only that is set to the minimum of all interfaces
  13692. -+ * @max_antenna_gain: maximum antenna gain adjusted by user config (in dBi)
  13693. - *
  13694. - * @chandef: the channel definition to tune to
  13695. - * @radar_enabled: whether radar detection is enabled
  13696. -@@ -1020,6 +1021,7 @@ struct ieee80211_conf {
  13697. - u32 flags;
  13698. - int power_level, dynamic_ps_timeout;
  13699. - int max_sleep_period;
  13700. -+ int max_antenna_gain;
  13701. -
  13702. - u16 listen_interval;
  13703. - u8 ps_dtim_period;
  13704. ---- a/net/mac80211/ieee80211_i.h
  13705. -+++ b/net/mac80211/ieee80211_i.h
  13706. -@@ -1126,6 +1126,7 @@ struct ieee80211_local {
  13707. - int dynamic_ps_forced_timeout;
  13708. -
  13709. - int user_power_level; /* in dBm, for all interfaces */
  13710. -+ int user_antenna_gain; /* in dBi */
  13711. -
  13712. - enum ieee80211_smps_mode smps_mode;
  13713. -
  13714. ---- a/include/uapi/linux/nl80211.h
  13715. -+++ b/include/uapi/linux/nl80211.h
  13716. -@@ -1736,6 +1736,8 @@ enum nl80211_attrs {
  13717. -
  13718. - NL80211_ATTR_PEER_AID,
  13719. -
  13720. -+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
  13721. -+
  13722. - /* add attributes here, update the policy in nl80211.c */
  13723. -
  13724. - __NL80211_ATTR_AFTER_LAST,
  13725. ---- a/net/wireless/nl80211.c
  13726. -+++ b/net/wireless/nl80211.c
  13727. -@@ -349,6 +349,7 @@ static const struct nla_policy nl80211_p
  13728. - [NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY,
  13729. - .len = IEEE80211_MAX_DATA_LEN },
  13730. - [NL80211_ATTR_PEER_AID] = { .type = NLA_U16 },
  13731. -+ [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
  13732. - };
  13733. -
  13734. - /* policy for the key attributes */
  13735. -@@ -1993,6 +1994,22 @@ static int nl80211_set_wiphy(struct sk_b
  13736. - goto bad_res;
  13737. - }
  13738. -
  13739. -+ if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
  13740. -+ int idx, dbi = 0;
  13741. -+
  13742. -+ if (!rdev->ops->set_antenna_gain) {
  13743. -+ result = -EOPNOTSUPP;
  13744. -+ goto bad_res;
  13745. -+ }
  13746. -+
  13747. -+ idx = NL80211_ATTR_WIPHY_ANTENNA_GAIN;
  13748. -+ dbi = nla_get_u32(info->attrs[idx]);
  13749. -+
  13750. -+ result = rdev->ops->set_antenna_gain(&rdev->wiphy, dbi);
  13751. -+ if (result)
  13752. -+ goto bad_res;
  13753. -+ }
  13754. -+
  13755. - if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
  13756. - info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
  13757. - u32 tx_ant, rx_ant;
  13758. ---- a/net/mac80211/cfg.c
  13759. -+++ b/net/mac80211/cfg.c
  13760. -@@ -2283,6 +2283,19 @@ static int ieee80211_get_tx_power(struct
  13761. - return 0;
  13762. - }
  13763. -
  13764. -+static int ieee80211_set_antenna_gain(struct wiphy *wiphy, int dbi)
  13765. -+{
  13766. -+ struct ieee80211_local *local = wiphy_priv(wiphy);
  13767. -+
  13768. -+ if (dbi < 0)
  13769. -+ return -EINVAL;
  13770. -+
  13771. -+ local->user_antenna_gain = dbi;
  13772. -+ ieee80211_hw_config(local, 0);
  13773. -+
  13774. -+ return 0;
  13775. -+}
  13776. -+
  13777. - static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
  13778. - const u8 *addr)
  13779. - {
  13780. -@@ -3474,6 +3487,7 @@ struct cfg80211_ops mac80211_config_ops
  13781. - .set_wiphy_params = ieee80211_set_wiphy_params,
  13782. - .set_tx_power = ieee80211_set_tx_power,
  13783. - .get_tx_power = ieee80211_get_tx_power,
  13784. -+ .set_antenna_gain = ieee80211_set_antenna_gain,
  13785. - .set_wds_peer = ieee80211_set_wds_peer,
  13786. - .rfkill_poll = ieee80211_rfkill_poll,
  13787. - CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
  13788. ---- a/include/net/cfg80211.h
  13789. -+++ b/include/net/cfg80211.h
  13790. -@@ -1970,6 +1970,7 @@ struct cfg80211_update_ft_ies_params {
  13791. - * (as advertised by the nl80211 feature flag.)
  13792. - * @get_tx_power: store the current TX power into the dbm variable;
  13793. - * return 0 if successful
  13794. -+ * @set_antenna_gain: set antenna gain to reduce maximum tx power if necessary
  13795. - *
  13796. - * @set_wds_peer: set the WDS peer for a WDS interface
  13797. - *
  13798. -@@ -2189,6 +2190,7 @@ struct cfg80211_ops {
  13799. - enum nl80211_tx_power_setting type, int mbm);
  13800. - int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
  13801. - int *dbm);
  13802. -+ int (*set_antenna_gain)(struct wiphy *wiphy, int dbi);
  13803. -
  13804. - int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
  13805. - const u8 *addr);
  13806. ---- a/net/mac80211/main.c
  13807. -+++ b/net/mac80211/main.c
  13808. -@@ -102,6 +102,7 @@ static u32 ieee80211_hw_conf_chan(struct
  13809. - struct cfg80211_chan_def chandef = {};
  13810. - u32 changed = 0;
  13811. - int power = 0;
  13812. -+ int ant_gain, max_power;
  13813. - u32 offchannel_flag;
  13814. -
  13815. - offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
  13816. -@@ -165,8 +166,21 @@ static u32 ieee80211_hw_conf_chan(struct
  13817. -
  13818. - power = min(power, chandef.chan->max_power);
  13819. -
  13820. -- if (local->hw.conf.power_level != power) {
  13821. -+ max_power = chandef.chan->max_reg_power;
  13822. -+ ant_gain = chandef.chan->max_antenna_gain;
  13823. -+ if (local->user_antenna_gain > 0) {
  13824. -+ if (local->user_antenna_gain > ant_gain) {
  13825. -+ max_power -= local->user_antenna_gain - ant_gain;
  13826. -+ ant_gain = 0;
  13827. -+ } else
  13828. -+ ant_gain -= local->user_antenna_gain;
  13829. -+ power = min(power, max_power);
  13830. -+ }
  13831. -+
  13832. -+ if (local->hw.conf.power_level != power ||
  13833. -+ local->hw.conf.max_antenna_gain != ant_gain) {
  13834. - changed |= IEEE80211_CONF_CHANGE_POWER;
  13835. -+ local->hw.conf.max_antenna_gain = ant_gain;
  13836. - local->hw.cur_power_level = power;
  13837. - local->hw.conf.power_level = power;
  13838. - }
  13839. -@@ -597,6 +611,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
  13840. - IEEE80211_RADIOTAP_MCS_HAVE_BW;
  13841. - local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
  13842. - IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
  13843. -+ local->user_antenna_gain = 0;
  13844. - local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
  13845. - local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
  13846. - local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
  13847. diff --git a/package/mac80211/patches/524-ath9k_use_configured_antenna_gain.patch b/package/mac80211/patches/524-ath9k_use_configured_antenna_gain.patch
  13848. deleted file mode 100644
  13849. index 9d627ac..0000000
  13850. --- a/package/mac80211/patches/524-ath9k_use_configured_antenna_gain.patch
  13851. +++ /dev/null
  13852. @@ -1,34 +0,0 @@
  13853. ---- a/drivers/net/wireless/ath/ath.h
  13854. -+++ b/drivers/net/wireless/ath/ath.h
  13855. -@@ -73,6 +73,7 @@ struct ath_regulatory {
  13856. - u16 max_power_level;
  13857. - u16 current_rd;
  13858. - int16_t power_limit;
  13859. -+ int16_t max_antenna_gain;
  13860. - struct reg_dmn_pair_mapping *regpair;
  13861. - };
  13862. -
  13863. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  13864. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  13865. -@@ -2847,7 +2847,7 @@ void ath9k_hw_apply_txpower(struct ath_h
  13866. - channel = chan->chan;
  13867. - chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
  13868. - new_pwr = min_t(int, chan_pwr, reg->power_limit);
  13869. -- max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2;
  13870. -+ max_gain = chan_pwr - new_pwr + reg->max_antenna_gain * 2;
  13871. -
  13872. - ant_gain = get_antenna_gain(ah, chan);
  13873. - if (ant_gain > max_gain)
  13874. ---- a/drivers/net/wireless/ath/ath9k/main.c
  13875. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  13876. -@@ -1291,7 +1291,10 @@ int ath9k_config(struct ieee80211_hw *hw
  13877. - }
  13878. -
  13879. - if (changed & IEEE80211_CONF_CHANGE_POWER) {
  13880. -+ struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
  13881. -+
  13882. - ath_dbg(common, CONFIG, "Set power: %d\n", conf->power_level);
  13883. -+ reg->max_antenna_gain = conf->max_antenna_gain;
  13884. - sc->config.txpowlimit = 2 * conf->power_level;
  13885. - ath9k_cmn_update_txpow(ah, sc->curtxpow,
  13886. - sc->config.txpowlimit, &sc->curtxpow);
  13887. diff --git a/package/mac80211/patches/530-ath9k_extra_leds.patch b/package/mac80211/patches/530-ath9k_extra_leds.patch
  13888. deleted file mode 100644
  13889. index b931d5f..0000000
  13890. --- a/package/mac80211/patches/530-ath9k_extra_leds.patch
  13891. +++ /dev/null
  13892. @@ -1,248 +0,0 @@
  13893. ---- a/drivers/net/wireless/ath/ath9k/ath9k.h
  13894. -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  13895. -@@ -557,6 +557,9 @@ struct ath9k_wow_pattern {
  13896. - void ath_init_leds(struct ath_softc *sc);
  13897. - void ath_deinit_leds(struct ath_softc *sc);
  13898. - void ath_fill_led_pin(struct ath_softc *sc);
  13899. -+int ath_create_gpio_led(struct ath_softc *sc, int gpio, const char *name,
  13900. -+ const char *trigger, bool active_low);
  13901. -+
  13902. - #else
  13903. - static inline void ath_init_leds(struct ath_softc *sc)
  13904. - {
  13905. -@@ -697,6 +700,13 @@ enum spectral_mode {
  13906. - SPECTRAL_CHANSCAN,
  13907. - };
  13908. -
  13909. -+struct ath_led {
  13910. -+ struct list_head list;
  13911. -+ struct ath_softc *sc;
  13912. -+ const struct gpio_led *gpio;
  13913. -+ struct led_classdev cdev;
  13914. -+};
  13915. -+
  13916. - struct ath_softc {
  13917. - struct ieee80211_hw *hw;
  13918. - struct device *dev;
  13919. -@@ -739,9 +749,8 @@ struct ath_softc {
  13920. - struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
  13921. -
  13922. - #ifdef CPTCFG_MAC80211_LEDS
  13923. -- bool led_registered;
  13924. -- char led_name[32];
  13925. -- struct led_classdev led_cdev;
  13926. -+ const char *led_default_trigger;
  13927. -+ struct list_head leds;
  13928. - #endif
  13929. -
  13930. - struct ath9k_hw_cal_data caldata;
  13931. ---- a/drivers/net/wireless/ath/ath9k/gpio.c
  13932. -+++ b/drivers/net/wireless/ath/ath9k/gpio.c
  13933. -@@ -24,40 +24,102 @@
  13934. - static void ath_led_brightness(struct led_classdev *led_cdev,
  13935. - enum led_brightness brightness)
  13936. - {
  13937. -- struct ath_softc *sc = container_of(led_cdev, struct ath_softc, led_cdev);
  13938. -- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, (brightness == LED_OFF));
  13939. -+ struct ath_led *led = container_of(led_cdev, struct ath_led, cdev);
  13940. -+ struct ath_softc *sc = led->sc;
  13941. -+
  13942. -+ ath9k_ps_wakeup(sc);
  13943. -+ ath9k_hw_set_gpio(sc->sc_ah, led->gpio->gpio,
  13944. -+ (brightness != LED_OFF) ^ led->gpio->active_low);
  13945. -+ ath9k_ps_restore(sc);
  13946. -+}
  13947. -+
  13948. -+static int ath_add_led(struct ath_softc *sc, struct ath_led *led)
  13949. -+{
  13950. -+ const struct gpio_led *gpio = led->gpio;
  13951. -+ int ret;
  13952. -+
  13953. -+ led->cdev.name = gpio->name;
  13954. -+ led->cdev.default_trigger = gpio->default_trigger;
  13955. -+ led->cdev.brightness_set = ath_led_brightness;
  13956. -+
  13957. -+ ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->cdev);
  13958. -+ if (ret < 0)
  13959. -+ return ret;
  13960. -+
  13961. -+ led->sc = sc;
  13962. -+ list_add(&led->list, &sc->leds);
  13963. -+
  13964. -+ /* Configure gpio for output */
  13965. -+ ath9k_hw_cfg_output(sc->sc_ah, gpio->gpio,
  13966. -+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
  13967. -+
  13968. -+ /* LED off */
  13969. -+ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
  13970. -+
  13971. -+ return 0;
  13972. -+}
  13973. -+
  13974. -+int ath_create_gpio_led(struct ath_softc *sc, int gpio_num, const char *name,
  13975. -+ const char *trigger, bool active_low)
  13976. -+{
  13977. -+ struct ath_led *led;
  13978. -+ struct gpio_led *gpio;
  13979. -+ char *_name;
  13980. -+ int ret;
  13981. -+
  13982. -+ led = kzalloc(sizeof(*led) + sizeof(*gpio) + strlen(name) + 1,
  13983. -+ GFP_KERNEL);
  13984. -+ if (!led)
  13985. -+ return -ENOMEM;
  13986. -+
  13987. -+ led->gpio = gpio = (struct gpio_led *) (led + 1);
  13988. -+ _name = (char *) (led->gpio + 1);
  13989. -+
  13990. -+ strcpy(_name, name);
  13991. -+ gpio->name = _name;
  13992. -+ gpio->gpio = gpio_num;
  13993. -+ gpio->active_low = active_low;
  13994. -+ gpio->default_trigger = trigger;
  13995. -+
  13996. -+ ret = ath_add_led(sc, led);
  13997. -+ if (unlikely(ret < 0))
  13998. -+ kfree(led);
  13999. -+
  14000. -+ return ret;
  14001. - }
  14002. -
  14003. - void ath_deinit_leds(struct ath_softc *sc)
  14004. - {
  14005. -- if (!sc->led_registered)
  14006. -- return;
  14007. -+ struct ath_led *led;
  14008. -
  14009. -- ath_led_brightness(&sc->led_cdev, LED_OFF);
  14010. -- led_classdev_unregister(&sc->led_cdev);
  14011. -+ while (!list_empty(&sc->leds)) {
  14012. -+ led = list_first_entry(&sc->leds, struct ath_led, list);
  14013. -+ list_del(&led->list);
  14014. -+ ath_led_brightness(&led->cdev, LED_OFF);
  14015. -+ led_classdev_unregister(&led->cdev);
  14016. -+ kfree(led);
  14017. -+ }
  14018. - }
  14019. -
  14020. - void ath_init_leds(struct ath_softc *sc)
  14021. - {
  14022. -- int ret;
  14023. -+ char led_name[32];
  14024. -+ const char *trigger;
  14025. -+
  14026. -+ INIT_LIST_HEAD(&sc->leds);
  14027. -
  14028. - if (AR_SREV_9100(sc->sc_ah))
  14029. - return;
  14030. -
  14031. -- if (!led_blink)
  14032. -- sc->led_cdev.default_trigger =
  14033. -- ieee80211_get_radio_led_name(sc->hw);
  14034. --
  14035. -- snprintf(sc->led_name, sizeof(sc->led_name),
  14036. -- "ath9k-%s", wiphy_name(sc->hw->wiphy));
  14037. -- sc->led_cdev.name = sc->led_name;
  14038. -- sc->led_cdev.brightness_set = ath_led_brightness;
  14039. -+ snprintf(led_name, sizeof(led_name), "ath9k-%s",
  14040. -+ wiphy_name(sc->hw->wiphy));
  14041. -
  14042. -- ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &sc->led_cdev);
  14043. -- if (ret < 0)
  14044. -- return;
  14045. -+ if (led_blink)
  14046. -+ trigger = sc->led_default_trigger;
  14047. -+ else
  14048. -+ trigger = ieee80211_get_radio_led_name(sc->hw);
  14049. -
  14050. -- sc->led_registered = true;
  14051. -+ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1);
  14052. - }
  14053. -
  14054. - void ath_fill_led_pin(struct ath_softc *sc)
  14055. ---- a/drivers/net/wireless/ath/ath9k/init.c
  14056. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  14057. -@@ -918,7 +918,7 @@ int ath9k_init_device(u16 devid, struct
  14058. -
  14059. - #ifdef CPTCFG_MAC80211_LEDS
  14060. - /* must be initialized before ieee80211_register_hw */
  14061. -- sc->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(sc->hw,
  14062. -+ sc->led_default_trigger = ieee80211_create_tpt_led_trigger(sc->hw,
  14063. - IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_tpt_blink,
  14064. - ARRAY_SIZE(ath9k_tpt_blink));
  14065. - #endif
  14066. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  14067. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  14068. -@@ -1825,6 +1825,61 @@ static const struct file_operations fops
  14069. - .llseek = default_llseek,
  14070. - };
  14071. -
  14072. -+#ifdef CONFIG_MAC80211_LEDS
  14073. -+
  14074. -+static ssize_t write_file_gpio_led(struct file *file, const char __user *ubuf,
  14075. -+ size_t count, loff_t *ppos)
  14076. -+{
  14077. -+ struct ath_softc *sc = file->private_data;
  14078. -+ char buf[32], *str, *name, *c;
  14079. -+ ssize_t len;
  14080. -+ unsigned int gpio;
  14081. -+ bool active_low = false;
  14082. -+
  14083. -+ len = min(count, sizeof(buf) - 1);
  14084. -+ if (copy_from_user(buf, ubuf, len))
  14085. -+ return -EFAULT;
  14086. -+
  14087. -+ buf[len] = '\0';
  14088. -+ name = strchr(buf, ',');
  14089. -+ if (!name)
  14090. -+ return -EINVAL;
  14091. -+
  14092. -+ *(name++) = 0;
  14093. -+ if (!*name)
  14094. -+ return -EINVAL;
  14095. -+
  14096. -+ c = strchr(name, '\n');
  14097. -+ if (c)
  14098. -+ *c = 0;
  14099. -+
  14100. -+ str = buf;
  14101. -+ if (*str == '!') {
  14102. -+ str++;
  14103. -+ active_low = true;
  14104. -+ }
  14105. -+
  14106. -+ if (kstrtouint(str, 0, &gpio) < 0)
  14107. -+ return -EINVAL;
  14108. -+
  14109. -+ if (gpio >= sc->sc_ah->caps.num_gpio_pins)
  14110. -+ return -EINVAL;
  14111. -+
  14112. -+ if (ath_create_gpio_led(sc, gpio, name, NULL, active_low) < 0)
  14113. -+ return -EINVAL;
  14114. -+
  14115. -+ return count;
  14116. -+}
  14117. -+
  14118. -+static const struct file_operations fops_gpio_led = {
  14119. -+ .write = write_file_gpio_led,
  14120. -+ .open = simple_open,
  14121. -+ .owner = THIS_MODULE,
  14122. -+ .llseek = default_llseek,
  14123. -+};
  14124. -+
  14125. -+#endif
  14126. -+
  14127. -
  14128. - int ath9k_init_debug(struct ath_hw *ah)
  14129. - {
  14130. -@@ -1847,6 +1902,10 @@ int ath9k_init_debug(struct ath_hw *ah)
  14131. - &fops_eeprom);
  14132. - debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  14133. - sc, &fops_chanbw);
  14134. -+#ifdef CONFIG_MAC80211_LEDS
  14135. -+ debugfs_create_file("gpio_led", S_IWUSR,
  14136. -+ sc->debug.debugfs_phy, sc, &fops_gpio_led);
  14137. -+#endif
  14138. - debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
  14139. - &fops_dma);
  14140. - debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
  14141. diff --git a/package/mac80211/patches/531-ath9k_extra_platform_leds.patch b/package/mac80211/patches/531-ath9k_extra_platform_leds.patch
  14142. deleted file mode 100644
  14143. index 764242c..0000000
  14144. --- a/package/mac80211/patches/531-ath9k_extra_platform_leds.patch
  14145. +++ /dev/null
  14146. @@ -1,71 +0,0 @@
  14147. ---- a/include/linux/ath9k_platform.h
  14148. -+++ b/include/linux/ath9k_platform.h
  14149. -@@ -35,6 +35,9 @@ struct ath9k_platform_data {
  14150. - bool is_clk_25mhz;
  14151. - int (*get_mac_revision)(void);
  14152. - int (*external_reset)(void);
  14153. -+
  14154. -+ int num_leds;
  14155. -+ const struct gpio_led *leds;
  14156. - };
  14157. -
  14158. - #endif /* _LINUX_ATH9K_PLATFORM_H */
  14159. ---- a/drivers/net/wireless/ath/ath9k/gpio.c
  14160. -+++ b/drivers/net/wireless/ath/ath9k/gpio.c
  14161. -@@ -15,6 +15,7 @@
  14162. - */
  14163. -
  14164. - #include "ath9k.h"
  14165. -+#include <linux/ath9k_platform.h>
  14166. -
  14167. - /********************************/
  14168. - /* LED functions */
  14169. -@@ -88,6 +89,24 @@ int ath_create_gpio_led(struct ath_softc
  14170. - return ret;
  14171. - }
  14172. -
  14173. -+static int ath_create_platform_led(struct ath_softc *sc,
  14174. -+ const struct gpio_led *gpio)
  14175. -+{
  14176. -+ struct ath_led *led;
  14177. -+ int ret;
  14178. -+
  14179. -+ led = kzalloc(sizeof(*led), GFP_KERNEL);
  14180. -+ if (!led)
  14181. -+ return -ENOMEM;
  14182. -+
  14183. -+ led->gpio = gpio;
  14184. -+ ret = ath_add_led(sc, led);
  14185. -+ if (ret < 0)
  14186. -+ kfree(led);
  14187. -+
  14188. -+ return ret;
  14189. -+}
  14190. -+
  14191. - void ath_deinit_leds(struct ath_softc *sc)
  14192. - {
  14193. - struct ath_led *led;
  14194. -@@ -103,8 +122,10 @@ void ath_deinit_leds(struct ath_softc *s
  14195. -
  14196. - void ath_init_leds(struct ath_softc *sc)
  14197. - {
  14198. -+ struct ath9k_platform_data *pdata = sc->dev->platform_data;
  14199. - char led_name[32];
  14200. - const char *trigger;
  14201. -+ int i;
  14202. -
  14203. - INIT_LIST_HEAD(&sc->leds);
  14204. -
  14205. -@@ -120,6 +141,12 @@ void ath_init_leds(struct ath_softc *sc)
  14206. - trigger = ieee80211_get_radio_led_name(sc->hw);
  14207. -
  14208. - ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, 1);
  14209. -+
  14210. -+ if (!pdata)
  14211. -+ return;
  14212. -+
  14213. -+ for (i = 0; i < pdata->num_leds; i++)
  14214. -+ ath_create_platform_led(sc, &pdata->leds[i]);
  14215. - }
  14216. -
  14217. - void ath_fill_led_pin(struct ath_softc *sc)
  14218. diff --git a/package/mac80211/patches/541-ath9k_optimize_interrupt_mitigation.patch b/package/mac80211/patches/541-ath9k_optimize_interrupt_mitigation.patch
  14219. deleted file mode 100644
  14220. index 95ceb35..0000000
  14221. --- a/package/mac80211/patches/541-ath9k_optimize_interrupt_mitigation.patch
  14222. +++ /dev/null
  14223. @@ -1,30 +0,0 @@
  14224. ---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  14225. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  14226. -@@ -241,21 +241,19 @@ static bool ar9003_hw_get_isr(struct ath
  14227. -
  14228. - *masked = isr & ATH9K_INT_COMMON;
  14229. -
  14230. -- if (ah->config.rx_intr_mitigation)
  14231. -+ if (ah->config.rx_intr_mitigation) {
  14232. - if (isr & (AR_ISR_RXMINTR | AR_ISR_RXINTM))
  14233. - *masked |= ATH9K_INT_RXLP;
  14234. --
  14235. -- if (ah->config.tx_intr_mitigation)
  14236. -- if (isr & (AR_ISR_TXMINTR | AR_ISR_TXINTM))
  14237. -- *masked |= ATH9K_INT_TX;
  14238. --
  14239. -- if (isr & (AR_ISR_LP_RXOK | AR_ISR_RXERR))
  14240. -+ } else if (isr & (AR_ISR_LP_RXOK | AR_ISR_RXERR))
  14241. - *masked |= ATH9K_INT_RXLP;
  14242. -
  14243. - if (isr & AR_ISR_HP_RXOK)
  14244. - *masked |= ATH9K_INT_RXHP;
  14245. -
  14246. -- if (isr & (AR_ISR_TXOK | AR_ISR_TXERR | AR_ISR_TXEOL)) {
  14247. -+ if (ah->config.tx_intr_mitigation) {
  14248. -+ if (isr & (AR_ISR_TXMINTR | AR_ISR_TXINTM))
  14249. -+ *masked |= ATH9K_INT_TX;
  14250. -+ } else if (isr & (AR_ISR_TXOK | AR_ISR_TXERR | AR_ISR_TXEOL)) {
  14251. - *masked |= ATH9K_INT_TX;
  14252. -
  14253. - if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
  14254. diff --git a/package/mac80211/patches/550-ath9k_reduce_ani_interval.patch b/package/mac80211/patches/550-ath9k_reduce_ani_interval.patch
  14255. deleted file mode 100644
  14256. index 7c24f46..0000000
  14257. --- a/package/mac80211/patches/550-ath9k_reduce_ani_interval.patch
  14258. +++ /dev/null
  14259. @@ -1,11 +0,0 @@
  14260. ---- a/drivers/net/wireless/ath/ath9k/ani.h
  14261. -+++ b/drivers/net/wireless/ath/ath9k/ani.h
  14262. -@@ -38,7 +38,7 @@
  14263. - #define ATH9K_ANI_PERIOD 300
  14264. -
  14265. - /* in ms */
  14266. --#define ATH9K_ANI_POLLINTERVAL 1000
  14267. -+#define ATH9K_ANI_POLLINTERVAL 300
  14268. -
  14269. - #define ATH9K_SIG_FIRSTEP_SETTING_MIN 0
  14270. - #define ATH9K_SIG_FIRSTEP_SETTING_MAX 20
  14271. diff --git a/package/mac80211/patches/552-ath9k_rx_dma_stop_check.patch b/package/mac80211/patches/552-ath9k_rx_dma_stop_check.patch
  14272. deleted file mode 100644
  14273. index 5d063c7..0000000
  14274. --- a/package/mac80211/patches/552-ath9k_rx_dma_stop_check.patch
  14275. +++ /dev/null
  14276. @@ -1,28 +0,0 @@
  14277. ---- a/drivers/net/wireless/ath/ath9k/mac.c
  14278. -+++ b/drivers/net/wireless/ath/ath9k/mac.c
  14279. -@@ -705,7 +705,7 @@ bool ath9k_hw_stopdmarecv(struct ath_hw
  14280. - {
  14281. - #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
  14282. - struct ath_common *common = ath9k_hw_common(ah);
  14283. -- u32 mac_status, last_mac_status = 0;
  14284. -+ u32 mac_status = 0, last_mac_status = 0;
  14285. - int i;
  14286. -
  14287. - /* Enable access to the DMA observation bus */
  14288. -@@ -735,6 +735,16 @@ bool ath9k_hw_stopdmarecv(struct ath_hw
  14289. - }
  14290. -
  14291. - if (i == 0) {
  14292. -+ if (!AR_SREV_9300_20_OR_LATER(ah) &&
  14293. -+ (mac_status & 0x700) == 0) {
  14294. -+ /*
  14295. -+ * DMA is idle but the MAC is still stuck
  14296. -+ * processing events
  14297. -+ */
  14298. -+ *reset = true;
  14299. -+ return true;
  14300. -+ }
  14301. -+
  14302. - ath_err(common,
  14303. - "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
  14304. - AH_RX_STOP_DMA_TIMEOUT / 1000,
  14305. diff --git a/package/mac80211/patches/553-ath9k_debugfs_diag.patch b/package/mac80211/patches/553-ath9k_debugfs_diag.patch
  14306. deleted file mode 100644
  14307. index 7230d32..0000000
  14308. --- a/package/mac80211/patches/553-ath9k_debugfs_diag.patch
  14309. +++ /dev/null
  14310. @@ -1,139 +0,0 @@
  14311. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  14312. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  14313. -@@ -1881,6 +1881,50 @@ static const struct file_operations fops
  14314. - #endif
  14315. -
  14316. -
  14317. -+static ssize_t read_file_diag(struct file *file, char __user *user_buf,
  14318. -+ size_t count, loff_t *ppos)
  14319. -+{
  14320. -+ struct ath_softc *sc = file->private_data;
  14321. -+ struct ath_hw *ah = sc->sc_ah;
  14322. -+ char buf[32];
  14323. -+ unsigned int len;
  14324. -+
  14325. -+ len = sprintf(buf, "0x%08lx\n", ah->diag);
  14326. -+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  14327. -+}
  14328. -+
  14329. -+static ssize_t write_file_diag(struct file *file, const char __user *user_buf,
  14330. -+ size_t count, loff_t *ppos)
  14331. -+{
  14332. -+ struct ath_softc *sc = file->private_data;
  14333. -+ struct ath_hw *ah = sc->sc_ah;
  14334. -+ unsigned long diag;
  14335. -+ char buf[32];
  14336. -+ ssize_t len;
  14337. -+
  14338. -+ len = min(count, sizeof(buf) - 1);
  14339. -+ if (copy_from_user(buf, user_buf, len))
  14340. -+ return -EFAULT;
  14341. -+
  14342. -+ buf[len] = '\0';
  14343. -+ if (kstrtoul(buf, 0, &diag))
  14344. -+ return -EINVAL;
  14345. -+
  14346. -+ ah->diag = diag;
  14347. -+ ath9k_hw_update_diag(ah);
  14348. -+
  14349. -+ return count;
  14350. -+}
  14351. -+
  14352. -+static const struct file_operations fops_diag = {
  14353. -+ .read = read_file_diag,
  14354. -+ .write = write_file_diag,
  14355. -+ .open = simple_open,
  14356. -+ .owner = THIS_MODULE,
  14357. -+ .llseek = default_llseek,
  14358. -+};
  14359. -+
  14360. -+
  14361. - int ath9k_init_debug(struct ath_hw *ah)
  14362. - {
  14363. - struct ath_common *common = ath9k_hw_common(ah);
  14364. -@@ -1906,6 +1950,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  14365. - debugfs_create_file("gpio_led", S_IWUSR,
  14366. - sc->debug.debugfs_phy, sc, &fops_gpio_led);
  14367. - #endif
  14368. -+ debugfs_create_file("diag", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  14369. -+ sc, &fops_diag);
  14370. - debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
  14371. - &fops_dma);
  14372. - debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
  14373. ---- a/drivers/net/wireless/ath/ath9k/hw.h
  14374. -+++ b/drivers/net/wireless/ath/ath9k/hw.h
  14375. -@@ -499,6 +499,12 @@ enum {
  14376. - ATH9K_RESET_COLD,
  14377. - };
  14378. -
  14379. -+enum {
  14380. -+ ATH_DIAG_DISABLE_RX,
  14381. -+ ATH_DIAG_DISABLE_TX,
  14382. -+ ATH_DIAG_TRIGGER_ERROR,
  14383. -+};
  14384. -+
  14385. - struct ath9k_hw_version {
  14386. - u32 magic;
  14387. - u16 devid;
  14388. -@@ -777,6 +783,8 @@ struct ath_hw {
  14389. - u32 rfkill_polarity;
  14390. - u32 ah_flags;
  14391. -
  14392. -+ unsigned long diag;
  14393. -+
  14394. - bool reset_power_on;
  14395. - bool htc_reset_init;
  14396. -
  14397. -@@ -1027,6 +1035,7 @@ void ath9k_hw_set_sta_beacon_timers(stru
  14398. - bool ath9k_hw_check_alive(struct ath_hw *ah);
  14399. -
  14400. - bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
  14401. -+void ath9k_hw_update_diag(struct ath_hw *ah);
  14402. -
  14403. - #ifdef CPTCFG_ATH9K_DEBUGFS
  14404. - void ath9k_debug_sync_cause(struct ath_common *common, u32 sync_cause);
  14405. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  14406. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  14407. -@@ -1853,6 +1853,20 @@ fail:
  14408. - return -EINVAL;
  14409. - }
  14410. -
  14411. -+void ath9k_hw_update_diag(struct ath_hw *ah)
  14412. -+{
  14413. -+ if (test_bit(ATH_DIAG_DISABLE_RX, &ah->diag))
  14414. -+ REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_DIS);
  14415. -+ else
  14416. -+ REG_CLR_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_DIS);
  14417. -+
  14418. -+ if (test_bit(ATH_DIAG_DISABLE_TX, &ah->diag))
  14419. -+ REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_LOOP_BACK);
  14420. -+ else
  14421. -+ REG_CLR_BIT(ah, AR_DIAG_SW, AR_DIAG_LOOP_BACK);
  14422. -+}
  14423. -+EXPORT_SYMBOL(ath9k_hw_update_diag);
  14424. -+
  14425. - int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
  14426. - struct ath9k_hw_cal_data *caldata, bool fastcc)
  14427. - {
  14428. -@@ -2055,6 +2069,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  14429. - }
  14430. -
  14431. - ath9k_hw_apply_gpio_override(ah);
  14432. -+ ath9k_hw_update_diag(ah);
  14433. -
  14434. - if (AR_SREV_9565(ah) && ah->shared_chain_lnadiv)
  14435. - REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON);
  14436. ---- a/drivers/net/wireless/ath/ath9k/main.c
  14437. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  14438. -@@ -472,6 +472,11 @@ irqreturn_t ath_isr(int irq, void *dev)
  14439. - ath9k_hw_getisr(ah, &status); /* NB: clears ISR too */
  14440. - status &= ah->imask; /* discard unasked-for bits */
  14441. -
  14442. -+ if (test_bit(ATH_DIAG_TRIGGER_ERROR, &ah->diag)) {
  14443. -+ status |= ATH9K_INT_FATAL;
  14444. -+ clear_bit(ATH_DIAG_TRIGGER_ERROR, &ah->diag);
  14445. -+ }
  14446. -+
  14447. - /*
  14448. - * If there are no status bits set, then this interrupt was not
  14449. - * for me (should have been caught above).
  14450. diff --git a/package/mac80211/patches/554-ath9k_ani_mrc_fix.patch b/package/mac80211/patches/554-ath9k_ani_mrc_fix.patch
  14451. deleted file mode 100644
  14452. index 47df721..0000000
  14453. --- a/package/mac80211/patches/554-ath9k_ani_mrc_fix.patch
  14454. +++ /dev/null
  14455. @@ -1,13 +0,0 @@
  14456. ---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  14457. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  14458. -@@ -1173,6 +1173,10 @@ skip_ws_det:
  14459. - * is_on == 0 means MRC CCK is OFF (more noise imm)
  14460. - */
  14461. - bool is_on = param ? 1 : 0;
  14462. -+
  14463. -+ if (ah->caps.rx_chainmask == 1)
  14464. -+ break;
  14465. -+
  14466. - REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
  14467. - AR_PHY_MRC_CCK_ENABLE, is_on);
  14468. - REG_RMW_FIELD(ah, AR_PHY_MRC_CCK_CTRL,
  14469. diff --git a/package/mac80211/patches/555-ath9k-allow-to-disable-bands-via-platform-data.patch b/package/mac80211/patches/555-ath9k-allow-to-disable-bands-via-platform-data.patch
  14470. deleted file mode 100644
  14471. index 584a7d7..0000000
  14472. --- a/package/mac80211/patches/555-ath9k-allow-to-disable-bands-via-platform-data.patch
  14473. +++ /dev/null
  14474. @@ -1,70 +0,0 @@
  14475. ---- a/include/linux/ath9k_platform.h
  14476. -+++ b/include/linux/ath9k_platform.h
  14477. -@@ -33,6 +33,9 @@ struct ath9k_platform_data {
  14478. -
  14479. - bool endian_check;
  14480. - bool is_clk_25mhz;
  14481. -+ bool disable_2ghz;
  14482. -+ bool disable_5ghz;
  14483. -+
  14484. - int (*get_mac_revision)(void);
  14485. - int (*external_reset)(void);
  14486. -
  14487. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  14488. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  14489. -@@ -2448,17 +2448,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw
  14490. - }
  14491. -
  14492. - eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
  14493. -- if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
  14494. -- ath_err(common,
  14495. -- "no band has been marked as supported in EEPROM\n");
  14496. -- return -EINVAL;
  14497. -+
  14498. -+ if (eeval & AR5416_OPFLAGS_11A) {
  14499. -+ if (ah->disable_5ghz)
  14500. -+ ath_warn(common, "disabling 5GHz band\n");
  14501. -+ else
  14502. -+ pCap->hw_caps |= ATH9K_HW_CAP_5GHZ;
  14503. - }
  14504. -
  14505. -- if (eeval & AR5416_OPFLAGS_11A)
  14506. -- pCap->hw_caps |= ATH9K_HW_CAP_5GHZ;
  14507. -+ if (eeval & AR5416_OPFLAGS_11G) {
  14508. -+ if (ah->disable_2ghz)
  14509. -+ ath_warn(common, "disabling 2GHz band\n");
  14510. -+ else
  14511. -+ pCap->hw_caps |= ATH9K_HW_CAP_2GHZ;
  14512. -+ }
  14513. -
  14514. -- if (eeval & AR5416_OPFLAGS_11G)
  14515. -- pCap->hw_caps |= ATH9K_HW_CAP_2GHZ;
  14516. -+ if ((pCap->hw_caps & (ATH9K_HW_CAP_2GHZ | ATH9K_HW_CAP_5GHZ)) == 0) {
  14517. -+ ath_err(common, "both bands are disabled\n");
  14518. -+ return -EINVAL;
  14519. -+ }
  14520. -
  14521. - if (AR_SREV_9485(ah) ||
  14522. - AR_SREV_9285(ah) ||
  14523. ---- a/drivers/net/wireless/ath/ath9k/hw.h
  14524. -+++ b/drivers/net/wireless/ath/ath9k/hw.h
  14525. -@@ -947,6 +947,8 @@ struct ath_hw {
  14526. - bool is_clk_25mhz;
  14527. - int (*get_mac_revision)(void);
  14528. - int (*external_reset)(void);
  14529. -+ bool disable_2ghz;
  14530. -+ bool disable_5ghz;
  14531. -
  14532. - const struct firmware *eeprom_blob;
  14533. - };
  14534. ---- a/drivers/net/wireless/ath/ath9k/init.c
  14535. -+++ b/drivers/net/wireless/ath/ath9k/init.c
  14536. -@@ -613,6 +613,8 @@ static int ath9k_init_softc(u16 devid, s
  14537. - ah->is_clk_25mhz = pdata->is_clk_25mhz;
  14538. - ah->get_mac_revision = pdata->get_mac_revision;
  14539. - ah->external_reset = pdata->external_reset;
  14540. -+ ah->disable_2ghz = pdata->disable_2ghz;
  14541. -+ ah->disable_5ghz = pdata->disable_5ghz;
  14542. - if (!pdata->endian_check)
  14543. - ah->ah_flags |= AH_NO_EEP_SWAP;
  14544. - }
  14545. diff --git a/package/mac80211/patches/556-ath9k_fix_rx_race.patch b/package/mac80211/patches/556-ath9k_fix_rx_race.patch
  14546. deleted file mode 100644
  14547. index 69030d2..0000000
  14548. --- a/package/mac80211/patches/556-ath9k_fix_rx_race.patch
  14549. +++ /dev/null
  14550. @@ -1,82 +0,0 @@
  14551. ---- a/drivers/net/wireless/ath/ath9k/ath9k.h
  14552. -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  14553. -@@ -79,10 +79,6 @@ struct ath_config {
  14554. - sizeof(struct ath_buf_state)); \
  14555. - } while (0)
  14556. -
  14557. --#define ATH_RXBUF_RESET(_bf) do { \
  14558. -- (_bf)->bf_stale = false; \
  14559. -- } while (0)
  14560. --
  14561. - /**
  14562. - * enum buffer_type - Buffer type flags
  14563. - *
  14564. -@@ -317,6 +313,7 @@ struct ath_rx {
  14565. - struct ath_descdma rxdma;
  14566. - struct ath_rx_edma rx_edma[ATH9K_RX_QUEUE_MAX];
  14567. -
  14568. -+ struct ath_buf *buf_hold;
  14569. - struct sk_buff *frag;
  14570. -
  14571. - u32 ampdu_ref;
  14572. ---- a/drivers/net/wireless/ath/ath9k/recv.c
  14573. -+++ b/drivers/net/wireless/ath/ath9k/recv.c
  14574. -@@ -42,8 +42,6 @@ static void ath_rx_buf_link(struct ath_s
  14575. - struct ath_desc *ds;
  14576. - struct sk_buff *skb;
  14577. -
  14578. -- ATH_RXBUF_RESET(bf);
  14579. --
  14580. - ds = bf->bf_desc;
  14581. - ds->ds_link = 0; /* link to null */
  14582. - ds->ds_data = bf->bf_buf_addr;
  14583. -@@ -70,6 +68,14 @@ static void ath_rx_buf_link(struct ath_s
  14584. - sc->rx.rxlink = &ds->ds_link;
  14585. - }
  14586. -
  14587. -+static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_buf *bf)
  14588. -+{
  14589. -+ if (sc->rx.buf_hold)
  14590. -+ ath_rx_buf_link(sc, sc->rx.buf_hold);
  14591. -+
  14592. -+ sc->rx.buf_hold = bf;
  14593. -+}
  14594. -+
  14595. - static void ath_setdefantenna(struct ath_softc *sc, u32 antenna)
  14596. - {
  14597. - /* XXX block beacon interrupts */
  14598. -@@ -117,7 +123,6 @@ static bool ath_rx_edma_buf_link(struct
  14599. -
  14600. - skb = bf->bf_mpdu;
  14601. -
  14602. -- ATH_RXBUF_RESET(bf);
  14603. - memset(skb->data, 0, ah->caps.rx_status_len);
  14604. - dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
  14605. - ah->caps.rx_status_len, DMA_TO_DEVICE);
  14606. -@@ -432,6 +437,7 @@ int ath_startrecv(struct ath_softc *sc)
  14607. - if (list_empty(&sc->rx.rxbuf))
  14608. - goto start_recv;
  14609. -
  14610. -+ sc->rx.buf_hold = NULL;
  14611. - sc->rx.rxlink = NULL;
  14612. - list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) {
  14613. - ath_rx_buf_link(sc, bf);
  14614. -@@ -677,6 +683,9 @@ static struct ath_buf *ath_get_next_rx_b
  14615. - }
  14616. -
  14617. - bf = list_first_entry(&sc->rx.rxbuf, struct ath_buf, list);
  14618. -+ if (bf == sc->rx.buf_hold)
  14619. -+ return NULL;
  14620. -+
  14621. - ds = bf->bf_desc;
  14622. -
  14623. - /*
  14624. -@@ -1391,7 +1400,7 @@ requeue:
  14625. - if (edma) {
  14626. - ath_rx_edma_buf_link(sc, qtype);
  14627. - } else {
  14628. -- ath_rx_buf_link(sc, bf);
  14629. -+ ath_rx_buf_relink(sc, bf);
  14630. - ath9k_hw_rxena(ah);
  14631. - }
  14632. - } while (1);
  14633. diff --git a/package/mac80211/patches/560-ath9k_tx_queueing_rework.patch b/package/mac80211/patches/560-ath9k_tx_queueing_rework.patch
  14634. deleted file mode 100644
  14635. index 47ecd74..0000000
  14636. --- a/package/mac80211/patches/560-ath9k_tx_queueing_rework.patch
  14637. +++ /dev/null
  14638. @@ -1,546 +0,0 @@
  14639. ---- a/drivers/net/wireless/ath/ath9k/ath9k.h
  14640. -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  14641. -@@ -133,7 +133,6 @@ int ath_descdma_setup(struct ath_softc *
  14642. - #define ATH_AGGR_ENCRYPTDELIM 10
  14643. - /* minimum h/w qdepth to be sustained to maximize aggregation */
  14644. - #define ATH_AGGR_MIN_QDEPTH 2
  14645. --#define ATH_AMPDU_SUBFRAME_DEFAULT 32
  14646. -
  14647. - #define IEEE80211_SEQ_SEQ_SHIFT 4
  14648. - #define IEEE80211_SEQ_MAX 4096
  14649. -@@ -208,8 +207,9 @@ struct ath_frame_info {
  14650. - int framelen;
  14651. - enum ath9k_key_type keytype;
  14652. - u8 keyix;
  14653. -- u8 retries;
  14654. - u8 rtscts_rate;
  14655. -+ u8 retries : 7;
  14656. -+ u8 baw_tracked : 1;
  14657. - };
  14658. -
  14659. - struct ath_buf_state {
  14660. -@@ -237,6 +237,7 @@ struct ath_buf {
  14661. - struct ath_atx_tid {
  14662. - struct list_head list;
  14663. - struct sk_buff_head buf_q;
  14664. -+ struct sk_buff_head retry_q;
  14665. - struct ath_node *an;
  14666. - struct ath_atx_ac *ac;
  14667. - unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
  14668. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  14669. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  14670. -@@ -607,6 +607,28 @@ static ssize_t read_file_xmit(struct fil
  14671. - return retval;
  14672. - }
  14673. -
  14674. -+static ssize_t print_queue(struct ath_softc *sc, struct ath_txq *txq,
  14675. -+ char *buf, ssize_t size)
  14676. -+{
  14677. -+ ssize_t len = 0;
  14678. -+
  14679. -+ ath_txq_lock(sc, txq);
  14680. -+
  14681. -+ len += snprintf(buf + len, size - len, "%s: %d ",
  14682. -+ "qnum", txq->axq_qnum);
  14683. -+ len += snprintf(buf + len, size - len, "%s: %2d ",
  14684. -+ "qdepth", txq->axq_depth);
  14685. -+ len += snprintf(buf + len, size - len, "%s: %2d ",
  14686. -+ "ampdu-depth", txq->axq_ampdu_depth);
  14687. -+ len += snprintf(buf + len, size - len, "%s: %3d ",
  14688. -+ "pending", txq->pending_frames);
  14689. -+ len += snprintf(buf + len, size - len, "%s: %d\n",
  14690. -+ "stopped", txq->stopped);
  14691. -+
  14692. -+ ath_txq_unlock(sc, txq);
  14693. -+ return len;
  14694. -+}
  14695. -+
  14696. - static ssize_t read_file_queues(struct file *file, char __user *user_buf,
  14697. - size_t count, loff_t *ppos)
  14698. - {
  14699. -@@ -624,24 +646,13 @@ static ssize_t read_file_queues(struct f
  14700. -
  14701. - for (i = 0; i < IEEE80211_NUM_ACS; i++) {
  14702. - txq = sc->tx.txq_map[i];
  14703. -- len += snprintf(buf + len, size - len, "(%s): ", qname[i]);
  14704. --
  14705. -- ath_txq_lock(sc, txq);
  14706. --
  14707. -- len += snprintf(buf + len, size - len, "%s: %d ",
  14708. -- "qnum", txq->axq_qnum);
  14709. -- len += snprintf(buf + len, size - len, "%s: %2d ",
  14710. -- "qdepth", txq->axq_depth);
  14711. -- len += snprintf(buf + len, size - len, "%s: %2d ",
  14712. -- "ampdu-depth", txq->axq_ampdu_depth);
  14713. -- len += snprintf(buf + len, size - len, "%s: %3d ",
  14714. -- "pending", txq->pending_frames);
  14715. -- len += snprintf(buf + len, size - len, "%s: %d\n",
  14716. -- "stopped", txq->stopped);
  14717. --
  14718. -- ath_txq_unlock(sc, txq);
  14719. -+ len += snprintf(buf + len, size - len, "(%s): ", qname[i]);
  14720. -+ len += print_queue(sc, txq, buf + len, size - len);
  14721. - }
  14722. -
  14723. -+ len += snprintf(buf + len, size - len, "(CAB): ");
  14724. -+ len += print_queue(sc, sc->beacon.cabq, buf + len, size - len);
  14725. -+
  14726. - if (len > size)
  14727. - len = size;
  14728. -
  14729. ---- a/drivers/net/wireless/ath/ath9k/main.c
  14730. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  14731. -@@ -1402,9 +1402,6 @@ static void ath9k_sta_notify(struct ieee
  14732. - struct ath_softc *sc = hw->priv;
  14733. - struct ath_node *an = (struct ath_node *) sta->drv_priv;
  14734. -
  14735. -- if (!sta->ht_cap.ht_supported)
  14736. -- return;
  14737. --
  14738. - switch (cmd) {
  14739. - case STA_NOTIFY_SLEEP:
  14740. - an->sleeping = true;
  14741. ---- a/drivers/net/wireless/ath/ath9k/xmit.c
  14742. -+++ b/drivers/net/wireless/ath/ath9k/xmit.c
  14743. -@@ -168,6 +168,36 @@ static void ath_txq_skb_done(struct ath_
  14744. - }
  14745. - }
  14746. -
  14747. -+static struct ath_atx_tid *
  14748. -+ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb)
  14749. -+{
  14750. -+ struct ieee80211_hdr *hdr;
  14751. -+ u8 tidno = 0;
  14752. -+
  14753. -+ hdr = (struct ieee80211_hdr *) skb->data;
  14754. -+ if (ieee80211_is_data_qos(hdr->frame_control))
  14755. -+ tidno = ieee80211_get_qos_ctl(hdr)[0];
  14756. -+
  14757. -+ tidno &= IEEE80211_QOS_CTL_TID_MASK;
  14758. -+ return ATH_AN_2_TID(an, tidno);
  14759. -+}
  14760. -+
  14761. -+static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
  14762. -+{
  14763. -+ return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q);
  14764. -+}
  14765. -+
  14766. -+static struct sk_buff *ath_tid_dequeue(struct ath_atx_tid *tid)
  14767. -+{
  14768. -+ struct sk_buff *skb;
  14769. -+
  14770. -+ skb = __skb_dequeue(&tid->retry_q);
  14771. -+ if (!skb)
  14772. -+ skb = __skb_dequeue(&tid->buf_q);
  14773. -+
  14774. -+ return skb;
  14775. -+}
  14776. -+
  14777. - static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
  14778. - {
  14779. - struct ath_txq *txq = tid->ac->txq;
  14780. -@@ -182,7 +212,7 @@ static void ath_tx_flush_tid(struct ath_
  14781. -
  14782. - memset(&ts, 0, sizeof(ts));
  14783. -
  14784. -- while ((skb = __skb_dequeue(&tid->buf_q))) {
  14785. -+ while ((skb = ath_tid_dequeue(tid))) {
  14786. - fi = get_frame_info(skb);
  14787. - bf = fi->bf;
  14788. -
  14789. -@@ -195,7 +225,7 @@ static void ath_tx_flush_tid(struct ath_
  14790. - }
  14791. - }
  14792. -
  14793. -- if (fi->retries) {
  14794. -+ if (fi->baw_tracked) {
  14795. - list_add_tail(&bf->list, &bf_head);
  14796. - ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
  14797. - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
  14798. -@@ -232,13 +262,16 @@ static void ath_tx_update_baw(struct ath
  14799. - }
  14800. -
  14801. - static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
  14802. -- u16 seqno)
  14803. -+ struct ath_buf *bf)
  14804. - {
  14805. -+ struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
  14806. -+ u16 seqno = bf->bf_state.seqno;
  14807. - int index, cindex;
  14808. -
  14809. - index = ATH_BA_INDEX(tid->seq_start, seqno);
  14810. - cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
  14811. - __set_bit(cindex, tid->tx_buf);
  14812. -+ fi->baw_tracked = 1;
  14813. -
  14814. - if (index >= ((tid->baw_tail - tid->baw_head) &
  14815. - (ATH_TID_MAX_BUFS - 1))) {
  14816. -@@ -266,7 +299,7 @@ static void ath_tid_drain(struct ath_sof
  14817. - memset(&ts, 0, sizeof(ts));
  14818. - INIT_LIST_HEAD(&bf_head);
  14819. -
  14820. -- while ((skb = __skb_dequeue(&tid->buf_q))) {
  14821. -+ while ((skb = ath_tid_dequeue(tid))) {
  14822. - fi = get_frame_info(skb);
  14823. - bf = fi->bf;
  14824. -
  14825. -@@ -403,7 +436,6 @@ static void ath_tx_complete_aggr(struct
  14826. - struct ieee80211_tx_rate rates[4];
  14827. - struct ath_frame_info *fi;
  14828. - int nframes;
  14829. -- u8 tidno;
  14830. - bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
  14831. - int i, retries;
  14832. - int bar_index = -1;
  14833. -@@ -440,8 +472,7 @@ static void ath_tx_complete_aggr(struct
  14834. - }
  14835. -
  14836. - an = (struct ath_node *)sta->drv_priv;
  14837. -- tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
  14838. -- tid = ATH_AN_2_TID(an, tidno);
  14839. -+ tid = ath_get_skb_tid(sc, an, skb);
  14840. - seq_first = tid->seq_start;
  14841. - isba = ts->ts_flags & ATH9K_TX_BA;
  14842. -
  14843. -@@ -453,7 +484,7 @@ static void ath_tx_complete_aggr(struct
  14844. - * Only BlockAcks have a TID and therefore normal Acks cannot be
  14845. - * checked
  14846. - */
  14847. -- if (isba && tidno != ts->tid)
  14848. -+ if (isba && tid->tidno != ts->tid)
  14849. - txok = false;
  14850. -
  14851. - isaggr = bf_isaggr(bf);
  14852. -@@ -489,7 +520,8 @@ static void ath_tx_complete_aggr(struct
  14853. - tx_info = IEEE80211_SKB_CB(skb);
  14854. - fi = get_frame_info(skb);
  14855. -
  14856. -- if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) {
  14857. -+ if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno) ||
  14858. -+ !tid->active) {
  14859. - /*
  14860. - * Outside of the current BlockAck window,
  14861. - * maybe part of a previous session
  14862. -@@ -583,7 +615,7 @@ static void ath_tx_complete_aggr(struct
  14863. - if (an->sleeping)
  14864. - ieee80211_sta_set_buffered(sta, tid->tidno, true);
  14865. -
  14866. -- skb_queue_splice(&bf_pending, &tid->buf_q);
  14867. -+ skb_queue_splice_tail(&bf_pending, &tid->retry_q);
  14868. - if (!an->sleeping) {
  14869. - ath_tx_queue_tid(txq, tid);
  14870. -
  14871. -@@ -641,7 +673,7 @@ static void ath_tx_process_buffer(struct
  14872. - } else
  14873. - ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok);
  14874. -
  14875. -- if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && !flush)
  14876. -+ if (!flush)
  14877. - ath_txq_schedule(sc, txq);
  14878. - }
  14879. -
  14880. -@@ -815,15 +847,20 @@ static int ath_compute_num_delims(struct
  14881. -
  14882. - static struct ath_buf *
  14883. - ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
  14884. -- struct ath_atx_tid *tid)
  14885. -+ struct ath_atx_tid *tid, struct sk_buff_head **q)
  14886. - {
  14887. -+ struct ieee80211_tx_info *tx_info;
  14888. - struct ath_frame_info *fi;
  14889. - struct sk_buff *skb;
  14890. - struct ath_buf *bf;
  14891. - u16 seqno;
  14892. -
  14893. - while (1) {
  14894. -- skb = skb_peek(&tid->buf_q);
  14895. -+ *q = &tid->retry_q;
  14896. -+ if (skb_queue_empty(*q))
  14897. -+ *q = &tid->buf_q;
  14898. -+
  14899. -+ skb = skb_peek(*q);
  14900. - if (!skb)
  14901. - break;
  14902. -
  14903. -@@ -833,12 +870,22 @@ ath_tx_get_tid_subframe(struct ath_softc
  14904. - bf = ath_tx_setup_buffer(sc, txq, tid, skb);
  14905. -
  14906. - if (!bf) {
  14907. -- __skb_unlink(skb, &tid->buf_q);
  14908. -+ __skb_unlink(skb, *q);
  14909. - ath_txq_skb_done(sc, txq, skb);
  14910. - ieee80211_free_txskb(sc->hw, skb);
  14911. - continue;
  14912. - }
  14913. -
  14914. -+ bf->bf_next = NULL;
  14915. -+ bf->bf_lastbf = bf;
  14916. -+
  14917. -+ tx_info = IEEE80211_SKB_CB(skb);
  14918. -+ tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT;
  14919. -+ if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
  14920. -+ bf->bf_state.bf_type = 0;
  14921. -+ return bf;
  14922. -+ }
  14923. -+
  14924. - bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR;
  14925. - seqno = bf->bf_state.seqno;
  14926. -
  14927. -@@ -852,14 +899,12 @@ ath_tx_get_tid_subframe(struct ath_softc
  14928. -
  14929. - INIT_LIST_HEAD(&bf_head);
  14930. - list_add(&bf->list, &bf_head);
  14931. -- __skb_unlink(skb, &tid->buf_q);
  14932. -+ __skb_unlink(skb, *q);
  14933. - ath_tx_update_baw(sc, tid, seqno);
  14934. - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
  14935. - continue;
  14936. - }
  14937. -
  14938. -- bf->bf_next = NULL;
  14939. -- bf->bf_lastbf = bf;
  14940. - return bf;
  14941. - }
  14942. -
  14943. -@@ -874,16 +919,17 @@ static enum ATH_AGGR_STATUS ath_tx_form_
  14944. - {
  14945. - #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
  14946. - struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL;
  14947. -- int rl = 0, nframes = 0, ndelim, prev_al = 0;
  14948. -+ int nframes = 0, ndelim;
  14949. - u16 aggr_limit = 0, al = 0, bpad = 0,
  14950. -- al_delta, h_baw = tid->baw_size / 2;
  14951. -+ al_delta, h_baw = tid->baw_size / 2;
  14952. - enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
  14953. - struct ieee80211_tx_info *tx_info;
  14954. - struct ath_frame_info *fi;
  14955. - struct sk_buff *skb;
  14956. -+ struct sk_buff_head *tid_q;
  14957. -
  14958. - do {
  14959. -- bf = ath_tx_get_tid_subframe(sc, txq, tid);
  14960. -+ bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q);
  14961. - if (!bf) {
  14962. - status = ATH_AGGR_BAW_CLOSED;
  14963. - break;
  14964. -@@ -892,33 +938,24 @@ static enum ATH_AGGR_STATUS ath_tx_form_
  14965. - skb = bf->bf_mpdu;
  14966. - fi = get_frame_info(skb);
  14967. -
  14968. -- if (!bf_first)
  14969. -+ if (!bf_first) {
  14970. - bf_first = bf;
  14971. --
  14972. -- if (!rl) {
  14973. - ath_set_rates(tid->an->vif, tid->an->sta, bf);
  14974. - aggr_limit = ath_lookup_rate(sc, bf, tid);
  14975. -- rl = 1;
  14976. - }
  14977. -
  14978. - /* do not exceed aggregation limit */
  14979. - al_delta = ATH_AGGR_DELIM_SZ + fi->framelen;
  14980. -+ if (nframes) {
  14981. -+ if (aggr_limit < al + bpad + al_delta ||
  14982. -+ ath_lookup_legacy(bf) || nframes >= h_baw) {
  14983. -+ status = ATH_AGGR_LIMITED;
  14984. -+ break;
  14985. -+ }
  14986. -
  14987. -- if (nframes &&
  14988. -- ((aggr_limit < (al + bpad + al_delta + prev_al)) ||
  14989. -- ath_lookup_legacy(bf))) {
  14990. -- status = ATH_AGGR_LIMITED;
  14991. -- break;
  14992. -- }
  14993. --
  14994. -- tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
  14995. -- if (nframes && (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE))
  14996. -- break;
  14997. --
  14998. -- /* do not exceed subframe limit */
  14999. -- if (nframes >= min((int)h_baw, ATH_AMPDU_SUBFRAME_DEFAULT)) {
  15000. -- status = ATH_AGGR_LIMITED;
  15001. -- break;
  15002. -+ tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
  15003. -+ if (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
  15004. -+ break;
  15005. - }
  15006. -
  15007. - /* add padding for previous frame to aggregation length */
  15008. -@@ -936,18 +973,18 @@ static enum ATH_AGGR_STATUS ath_tx_form_
  15009. - bf->bf_next = NULL;
  15010. -
  15011. - /* link buffers of this frame to the aggregate */
  15012. -- if (!fi->retries)
  15013. -- ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
  15014. -+ if (!fi->baw_tracked)
  15015. -+ ath_tx_addto_baw(sc, tid, bf);
  15016. - bf->bf_state.ndelim = ndelim;
  15017. -
  15018. -- __skb_unlink(skb, &tid->buf_q);
  15019. -+ __skb_unlink(skb, tid_q);
  15020. - list_add_tail(&bf->list, bf_q);
  15021. - if (bf_prev)
  15022. - bf_prev->bf_next = bf;
  15023. -
  15024. - bf_prev = bf;
  15025. -
  15026. -- } while (!skb_queue_empty(&tid->buf_q));
  15027. -+ } while (ath_tid_has_buffered(tid));
  15028. -
  15029. - *aggr_len = al;
  15030. -
  15031. -@@ -1222,7 +1259,7 @@ static void ath_tx_sched_aggr(struct ath
  15032. - int aggr_len;
  15033. -
  15034. - do {
  15035. -- if (skb_queue_empty(&tid->buf_q))
  15036. -+ if (!ath_tid_has_buffered(tid))
  15037. - return;
  15038. -
  15039. - INIT_LIST_HEAD(&bf_q);
  15040. -@@ -1301,7 +1338,7 @@ void ath_tx_aggr_stop(struct ath_softc *
  15041. -
  15042. - ath_txq_lock(sc, txq);
  15043. - txtid->active = false;
  15044. -- txtid->paused = true;
  15045. -+ txtid->paused = false;
  15046. - ath_tx_flush_tid(sc, txtid);
  15047. - ath_txq_unlock_complete(sc, txq);
  15048. - }
  15049. -@@ -1326,7 +1363,7 @@ void ath_tx_aggr_sleep(struct ieee80211_
  15050. -
  15051. - ath_txq_lock(sc, txq);
  15052. -
  15053. -- buffered = !skb_queue_empty(&tid->buf_q);
  15054. -+ buffered = ath_tid_has_buffered(tid);
  15055. -
  15056. - tid->sched = false;
  15057. - list_del(&tid->list);
  15058. -@@ -1358,7 +1395,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
  15059. - ath_txq_lock(sc, txq);
  15060. - ac->clear_ps_filter = true;
  15061. -
  15062. -- if (!skb_queue_empty(&tid->buf_q) && !tid->paused) {
  15063. -+ if (!tid->paused && ath_tid_has_buffered(tid)) {
  15064. - ath_tx_queue_tid(txq, tid);
  15065. - ath_txq_schedule(sc, txq);
  15066. - }
  15067. -@@ -1383,7 +1420,7 @@ void ath_tx_aggr_resume(struct ath_softc
  15068. - tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
  15069. - tid->paused = false;
  15070. -
  15071. -- if (!skb_queue_empty(&tid->buf_q)) {
  15072. -+ if (ath_tid_has_buffered(tid)) {
  15073. - ath_tx_queue_tid(txq, tid);
  15074. - ath_txq_schedule(sc, txq);
  15075. - }
  15076. -@@ -1403,6 +1440,7 @@ void ath9k_release_buffered_frames(struc
  15077. - struct ieee80211_tx_info *info;
  15078. - struct list_head bf_q;
  15079. - struct ath_buf *bf_tail = NULL, *bf;
  15080. -+ struct sk_buff_head *tid_q;
  15081. - int sent = 0;
  15082. - int i;
  15083. -
  15084. -@@ -1418,15 +1456,15 @@ void ath9k_release_buffered_frames(struc
  15085. - continue;
  15086. -
  15087. - ath_txq_lock(sc, tid->ac->txq);
  15088. -- while (!skb_queue_empty(&tid->buf_q) && nframes > 0) {
  15089. -- bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid);
  15090. -+ while (nframes > 0) {
  15091. -+ bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid, &tid_q);
  15092. - if (!bf)
  15093. - break;
  15094. -
  15095. -- __skb_unlink(bf->bf_mpdu, &tid->buf_q);
  15096. -+ __skb_unlink(bf->bf_mpdu, tid_q);
  15097. - list_add_tail(&bf->list, &bf_q);
  15098. - ath_set_rates(tid->an->vif, tid->an->sta, bf);
  15099. -- ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
  15100. -+ ath_tx_addto_baw(sc, tid, bf);
  15101. - bf->bf_state.bf_type &= ~BUF_AGGR;
  15102. - if (bf_tail)
  15103. - bf_tail->bf_next = bf;
  15104. -@@ -1436,7 +1474,7 @@ void ath9k_release_buffered_frames(struc
  15105. - sent++;
  15106. - TX_STAT_INC(txq->axq_qnum, a_queued_hw);
  15107. -
  15108. -- if (skb_queue_empty(&tid->buf_q))
  15109. -+ if (!ath_tid_has_buffered(tid))
  15110. - ieee80211_sta_set_buffered(an->sta, i, false);
  15111. - }
  15112. - ath_txq_unlock_complete(sc, tid->ac->txq);
  15113. -@@ -1722,7 +1760,7 @@ void ath_txq_schedule(struct ath_softc *
  15114. - * add tid to round-robin queue if more frames
  15115. - * are pending for the tid
  15116. - */
  15117. -- if (!skb_queue_empty(&tid->buf_q))
  15118. -+ if (ath_tid_has_buffered(tid))
  15119. - ath_tx_queue_tid(txq, tid);
  15120. -
  15121. - if (tid == last_tid ||
  15122. -@@ -1831,7 +1869,7 @@ static void ath_tx_send_ampdu(struct ath
  15123. - * - seqno is not within block-ack window
  15124. - * - h/w queue depth exceeds low water mark
  15125. - */
  15126. -- if ((!skb_queue_empty(&tid->buf_q) || tid->paused ||
  15127. -+ if ((ath_tid_has_buffered(tid) || tid->paused ||
  15128. - !BAW_WITHIN(tid->seq_start, tid->baw_size, tid->seq_next) ||
  15129. - txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) &&
  15130. - txq != sc->tx.uapsdq) {
  15131. -@@ -1859,7 +1897,7 @@ static void ath_tx_send_ampdu(struct ath
  15132. - list_add(&bf->list, &bf_head);
  15133. -
  15134. - /* Add sub-frame to BAW */
  15135. -- ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
  15136. -+ ath_tx_addto_baw(sc, tid, bf);
  15137. -
  15138. - /* Queue to h/w without aggregation */
  15139. - TX_STAT_INC(txq->axq_qnum, a_queued_hw);
  15140. -@@ -2066,7 +2104,6 @@ int ath_tx_start(struct ieee80211_hw *hw
  15141. - struct ath_txq *txq = txctl->txq;
  15142. - struct ath_atx_tid *tid = NULL;
  15143. - struct ath_buf *bf;
  15144. -- u8 tidno;
  15145. - int q;
  15146. - int ret;
  15147. -
  15148. -@@ -2097,9 +2134,7 @@ int ath_tx_start(struct ieee80211_hw *hw
  15149. - }
  15150. -
  15151. - if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) {
  15152. -- tidno = ieee80211_get_qos_ctl(hdr)[0] &
  15153. -- IEEE80211_QOS_CTL_TID_MASK;
  15154. -- tid = ATH_AN_2_TID(txctl->an, tidno);
  15155. -+ tid = ath_get_skb_tid(sc, txctl->an, skb);
  15156. -
  15157. - WARN_ON(tid->ac->txq != txctl->txq);
  15158. - }
  15159. -@@ -2372,8 +2407,7 @@ static void ath_tx_processq(struct ath_s
  15160. -
  15161. - if (list_empty(&txq->axq_q)) {
  15162. - txq->axq_link = NULL;
  15163. -- if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
  15164. -- ath_txq_schedule(sc, txq);
  15165. -+ ath_txq_schedule(sc, txq);
  15166. - break;
  15167. - }
  15168. - bf = list_first_entry(&txq->axq_q, struct ath_buf, list);
  15169. -@@ -2595,6 +2629,7 @@ void ath_tx_node_init(struct ath_softc *
  15170. - tid->paused = false;
  15171. - tid->active = false;
  15172. - __skb_queue_head_init(&tid->buf_q);
  15173. -+ __skb_queue_head_init(&tid->retry_q);
  15174. - acno = TID_TO_WME_AC(tidno);
  15175. - tid->ac = &an->ac[acno];
  15176. - }
  15177. -@@ -2602,6 +2637,7 @@ void ath_tx_node_init(struct ath_softc *
  15178. - for (acno = 0, ac = &an->ac[acno];
  15179. - acno < IEEE80211_NUM_ACS; acno++, ac++) {
  15180. - ac->sched = false;
  15181. -+ ac->clear_ps_filter = true;
  15182. - ac->txq = sc->tx.txq_map[acno];
  15183. - INIT_LIST_HEAD(&ac->tid_q);
  15184. - }
  15185. diff --git a/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch b/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch
  15186. deleted file mode 100644
  15187. index d9a20bc..0000000
  15188. --- a/package/mac80211/patches/601-rt2x00-set_pci_mwi.patch
  15189. +++ /dev/null
  15190. @@ -1,13 +0,0 @@
  15191. ---- a/drivers/net/wireless/rt2x00/rt2x00pci.c
  15192. -+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
  15193. -@@ -96,8 +96,10 @@ int rt2x00pci_probe(struct pci_dev *pci_
  15194. -
  15195. - pci_set_master(pci_dev);
  15196. -
  15197. -+#ifdef CONFIG_PCI_SET_MWI
  15198. - if (pci_set_mwi(pci_dev))
  15199. - rt2x00_probe_err("MWI not available\n");
  15200. -+#endif
  15201. -
  15202. - if (dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32))) {
  15203. - rt2x00_probe_err("PCI DMA not supported\n");
  15204. diff --git a/package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch b/package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch
  15205. deleted file mode 100644
  15206. index 6c80c3d..0000000
  15207. --- a/package/mac80211/patches/602-rt2x00-introduce-rt2x00_platform_h.patch
  15208. +++ /dev/null
  15209. @@ -1,32 +0,0 @@
  15210. ---- /dev/null
  15211. -+++ b/include/linux/rt2x00_platform.h
  15212. -@@ -0,0 +1,19 @@
  15213. -+/*
  15214. -+ * Platform data definition for the rt2x00 driver
  15215. -+ *
  15216. -+ * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
  15217. -+ *
  15218. -+ * This program is free software; you can redistribute it and/or modify it
  15219. -+ * under the terms of the GNU General Public License version 2 as published
  15220. -+ * by the Free Software Foundation.
  15221. -+ *
  15222. -+ */
  15223. -+
  15224. -+#ifndef _RT2X00_PLATFORM_H
  15225. -+#define _RT2X00_PLATFORM_H
  15226. -+
  15227. -+struct rt2x00_platform_data {
  15228. -+ char *eeprom_file_name;
  15229. -+};
  15230. -+
  15231. -+#endif /* _RT2X00_PLATFORM_H */
  15232. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  15233. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  15234. -@@ -39,6 +39,7 @@
  15235. - #include <linux/input-polldev.h>
  15236. - #include <linux/kfifo.h>
  15237. - #include <linux/hrtimer.h>
  15238. -+#include <linux/rt2x00_platform.h>
  15239. -
  15240. - #include <net/mac80211.h>
  15241. -
  15242. diff --git a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
  15243. deleted file mode 100644
  15244. index f47c1a5..0000000
  15245. --- a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
  15246. +++ /dev/null
  15247. @@ -1,289 +0,0 @@
  15248. ---- /dev/null
  15249. -+++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c
  15250. -@@ -0,0 +1,98 @@
  15251. -+/*
  15252. -+ Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
  15253. -+ Copyright (C) 2004 - 2009 Gertjan van Wingerde <gwingerde@gmail.com>
  15254. -+ <http://rt2x00.serialmonkey.com>
  15255. -+
  15256. -+ This program is free software; you can redistribute it and/or modify
  15257. -+ it under the terms of the GNU General Public License as published by
  15258. -+ the Free Software Foundation; either version 2 of the License, or
  15259. -+ (at your option) any later version.
  15260. -+
  15261. -+ This program is distributed in the hope that it will be useful,
  15262. -+ but WITHOUT ANY WARRANTY; without even the implied warranty of
  15263. -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15264. -+ GNU General Public License for more details.
  15265. -+
  15266. -+ You should have received a copy of the GNU General Public License
  15267. -+ along with this program; if not, write to the
  15268. -+ Free Software Foundation, Inc.,
  15269. -+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15270. -+ */
  15271. -+
  15272. -+/*
  15273. -+ Module: rt2x00lib
  15274. -+ Abstract: rt2x00 eeprom file loading routines.
  15275. -+ */
  15276. -+
  15277. -+#include <linux/kernel.h>
  15278. -+#include <linux/module.h>
  15279. -+
  15280. -+#include "rt2x00.h"
  15281. -+#include "rt2x00lib.h"
  15282. -+
  15283. -+static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15284. -+{
  15285. -+ const struct firmware *ee;
  15286. -+ char *ee_name;
  15287. -+ int retval;
  15288. -+
  15289. -+ ee_name = rt2x00dev->ops->lib->get_eeprom_file_name(rt2x00dev);
  15290. -+ if (!ee_name) {
  15291. -+ rt2x00_err(rt2x00dev,
  15292. -+ "Invalid EEPROM filename.\n"
  15293. -+ "Please file bug report to %s.\n", DRV_PROJECT);
  15294. -+ return -EINVAL;
  15295. -+ }
  15296. -+
  15297. -+ rt2x00_info(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name);
  15298. -+
  15299. -+ retval = request_firmware(&ee, ee_name, rt2x00dev->dev);
  15300. -+ if (retval) {
  15301. -+ rt2x00_err(rt2x00dev, "Failed to request EEPROM.\n");
  15302. -+ return retval;
  15303. -+ }
  15304. -+
  15305. -+ if (!ee || !ee->size || !ee->data) {
  15306. -+ rt2x00_err(rt2x00dev, "Failed to read EEPROM file.\n");
  15307. -+ retval = -ENOENT;
  15308. -+ goto err_exit;
  15309. -+ }
  15310. -+
  15311. -+ if (ee->size != rt2x00dev->ops->eeprom_size) {
  15312. -+ rt2x00_err(rt2x00dev,
  15313. -+ "EEPROM file size is invalid, it should be %d bytes\n",
  15314. -+ rt2x00dev->ops->eeprom_size);
  15315. -+ retval = -EINVAL;
  15316. -+ goto err_release_ee;
  15317. -+ }
  15318. -+
  15319. -+ rt2x00dev->eeprom_file = ee;
  15320. -+ return 0;
  15321. -+
  15322. -+err_release_ee:
  15323. -+ release_firmware(ee);
  15324. -+err_exit:
  15325. -+ return retval;
  15326. -+}
  15327. -+
  15328. -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15329. -+{
  15330. -+ int retval;
  15331. -+
  15332. -+ if (!test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags))
  15333. -+ return 0;
  15334. -+
  15335. -+ if (!rt2x00dev->eeprom_file) {
  15336. -+ retval = rt2x00lib_request_eeprom_file(rt2x00dev);
  15337. -+ if (retval)
  15338. -+ return retval;
  15339. -+ }
  15340. -+
  15341. -+ return 0;
  15342. -+}
  15343. -+
  15344. -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15345. -+{
  15346. -+ release_firmware(rt2x00dev->eeprom_file);
  15347. -+ rt2x00dev->eeprom_file = NULL;
  15348. -+}
  15349. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  15350. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  15351. -@@ -549,6 +549,7 @@ struct rt2x00lib_ops {
  15352. - const u8 *data, const size_t len);
  15353. - int (*load_firmware) (struct rt2x00_dev *rt2x00dev,
  15354. - const u8 *data, const size_t len);
  15355. -+ char *(*get_eeprom_file_name) (struct rt2x00_dev *rt2x00dev);
  15356. -
  15357. - /*
  15358. - * Device initialization/deinitialization handlers.
  15359. -@@ -705,6 +706,7 @@ enum rt2x00_capability_flags {
  15360. - REQUIRE_SW_SEQNO,
  15361. - REQUIRE_HT_TX_DESC,
  15362. - REQUIRE_PS_AUTOWAKE,
  15363. -+ REQUIRE_EEPROM_FILE,
  15364. -
  15365. - /*
  15366. - * Capabilities
  15367. -@@ -974,6 +976,11 @@ struct rt2x00_dev {
  15368. - const struct firmware *fw;
  15369. -
  15370. - /*
  15371. -+ * EEPROM image.
  15372. -+ */
  15373. -+ const struct firmware *eeprom_file;
  15374. -+
  15375. -+ /*
  15376. - * FIFO for storing tx status reports between isr and tasklet.
  15377. - */
  15378. - DECLARE_KFIFO_PTR(txstatus_fifo, u32);
  15379. ---- a/drivers/net/wireless/rt2x00/rt2x00lib.h
  15380. -+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
  15381. -@@ -322,6 +322,22 @@ static inline void rt2x00lib_free_firmwa
  15382. - #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */
  15383. -
  15384. - /*
  15385. -+ * EEPROM file handlers.
  15386. -+ */
  15387. -+#ifdef CPTCFG_RT2X00_LIB_EEPROM
  15388. -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev);
  15389. -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev);
  15390. -+#else
  15391. -+static inline int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15392. -+{
  15393. -+ return 0;
  15394. -+}
  15395. -+static inline void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15396. -+{
  15397. -+}
  15398. -+#endif /* CPTCFG_RT2X00_LIB_EEPROM */
  15399. -+
  15400. -+/*
  15401. - * Debugfs handlers.
  15402. - */
  15403. - #ifdef CPTCFG_RT2X00_LIB_DEBUGFS
  15404. ---- a/drivers/net/wireless/rt2x00/Kconfig
  15405. -+++ b/drivers/net/wireless/rt2x00/Kconfig
  15406. -@@ -69,6 +69,7 @@ config RT2800PCI
  15407. - select RT2X00_LIB_PCI if PCI
  15408. - select RT2X00_LIB_SOC if SOC_RT288X || SOC_RT305X
  15409. - select RT2X00_LIB_FIRMWARE
  15410. -+ select RT2X00_LIB_EEPROM
  15411. - select RT2X00_LIB_CRYPTO
  15412. - depends on CRC_CCITT
  15413. - depends on EEPROM_93CX6
  15414. -@@ -238,6 +239,9 @@ config RT2X00_LIB_FIRMWARE
  15415. - config RT2X00_LIB_CRYPTO
  15416. - boolean
  15417. -
  15418. -+config RT2X00_LIB_EEPROM
  15419. -+ boolean
  15420. -+
  15421. - config RT2X00_LIB_LEDS
  15422. - depends on !BACKPORT_KERNEL_2_6_25
  15423. - boolean
  15424. ---- a/drivers/net/wireless/rt2x00/Makefile
  15425. -+++ b/drivers/net/wireless/rt2x00/Makefile
  15426. -@@ -7,6 +7,7 @@ rt2x00lib-$(CPTCFG_RT2X00_LIB_DEBUGFS) +
  15427. - rt2x00lib-$(CPTCFG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o
  15428. - rt2x00lib-$(CPTCFG_RT2X00_LIB_FIRMWARE) += rt2x00firmware.o
  15429. - rt2x00lib-$(CPTCFG_RT2X00_LIB_LEDS) += rt2x00leds.o
  15430. -+rt2x00lib-$(CPTCFG_RT2X00_LIB_EEPROM) += rt2x00eeprom.o
  15431. -
  15432. - obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o
  15433. - obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o
  15434. ---- a/drivers/net/wireless/rt2x00/rt2800pci.c
  15435. -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  15436. -@@ -90,25 +90,11 @@ static void rt2800pci_mcu_status(struct
  15437. - rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
  15438. - }
  15439. -
  15440. --#if defined(CONFIG_SOC_RT288X) || defined(CONFIG_SOC_RT305X)
  15441. - static int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
  15442. - {
  15443. -- void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
  15444. --
  15445. -- if (!base_addr)
  15446. -- return -ENOMEM;
  15447. --
  15448. -- memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
  15449. --
  15450. -- iounmap(base_addr);
  15451. -+ memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE);
  15452. - return 0;
  15453. - }
  15454. --#else
  15455. --static inline int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
  15456. --{
  15457. -- return -ENOMEM;
  15458. --}
  15459. --#endif /* CONFIG_SOC_RT288X || CONFIG_SOC_RT305X */
  15460. -
  15461. - #ifdef CONFIG_PCI
  15462. - static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
  15463. -@@ -332,6 +318,20 @@ static int rt2800pci_write_firmware(stru
  15464. - }
  15465. -
  15466. - /*
  15467. -+ * EEPROM file functions.
  15468. -+ */
  15469. -+static char *rt2800pci_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
  15470. -+{
  15471. -+ struct rt2x00_platform_data *pdata;
  15472. -+
  15473. -+ pdata = rt2x00dev->dev->platform_data;
  15474. -+ if (pdata)
  15475. -+ return pdata->eeprom_file_name;
  15476. -+
  15477. -+ return NULL;
  15478. -+}
  15479. -+
  15480. -+/*
  15481. - * Initialization functions.
  15482. - */
  15483. - static bool rt2800pci_get_entry_state(struct queue_entry *entry)
  15484. -@@ -1156,6 +1156,7 @@ static const struct rt2x00lib_ops rt2800
  15485. - .get_firmware_name = rt2800pci_get_firmware_name,
  15486. - .check_firmware = rt2800_check_firmware,
  15487. - .load_firmware = rt2800_load_firmware,
  15488. -+ .get_eeprom_file_name = rt2800pci_get_eeprom_file_name,
  15489. - .initialize = rt2x00mmio_initialize,
  15490. - .uninitialize = rt2x00mmio_uninitialize,
  15491. - .get_entry_state = rt2800pci_get_entry_state,
  15492. ---- a/drivers/net/wireless/rt2x00/rt2x00dev.c
  15493. -+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
  15494. -@@ -1325,6 +1325,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
  15495. - INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
  15496. - INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
  15497. -
  15498. -+ retval = rt2x00lib_load_eeprom_file(rt2x00dev);
  15499. -+ if (retval)
  15500. -+ goto exit;
  15501. -+
  15502. - /*
  15503. - * Let the driver probe the device to detect the capabilities.
  15504. - */
  15505. -@@ -1455,6 +1459,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
  15506. - */
  15507. - if (rt2x00dev->drv_data)
  15508. - kfree(rt2x00dev->drv_data);
  15509. -+
  15510. -+ /*
  15511. -+ * Free EEPROM image.
  15512. -+ */
  15513. -+ rt2x00lib_free_eeprom_file(rt2x00dev);
  15514. - }
  15515. - EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev);
  15516. -
  15517. ---- a/drivers/net/wireless/rt2x00/rt2x00soc.c
  15518. -+++ b/drivers/net/wireless/rt2x00/rt2x00soc.c
  15519. -@@ -94,6 +94,7 @@ int rt2x00soc_probe(struct platform_devi
  15520. - rt2x00dev->hw = hw;
  15521. - rt2x00dev->irq = platform_get_irq(pdev, 0);
  15522. - rt2x00dev->name = pdev->dev.driver->name;
  15523. -+ set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
  15524. -
  15525. - rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
  15526. -
  15527. ---- a/.local-symbols
  15528. -+++ b/.local-symbols
  15529. -@@ -272,6 +272,7 @@ RT2X00_LIB_FIRMWARE=
  15530. - RT2X00_LIB_CRYPTO=
  15531. - RT2X00_LIB_LEDS=
  15532. - RT2X00_LIB_DEBUGFS=
  15533. -+RT2X00_LIB_EEPROM=
  15534. - RT2X00_DEBUG=
  15535. - RTLWIFI=
  15536. - RTLWIFI_DEBUG=
  15537. diff --git a/package/mac80211/patches/605-rt2x00-pci-eeprom.patch b/package/mac80211/patches/605-rt2x00-pci-eeprom.patch
  15538. deleted file mode 100644
  15539. index bcbb435..0000000
  15540. --- a/package/mac80211/patches/605-rt2x00-pci-eeprom.patch
  15541. +++ /dev/null
  15542. @@ -1,46 +0,0 @@
  15543. ---- a/drivers/net/wireless/rt2x00/rt2800pci.c
  15544. -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  15545. -@@ -90,7 +90,7 @@ static void rt2800pci_mcu_status(struct
  15546. - rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
  15547. - }
  15548. -
  15549. --static int rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
  15550. -+static int rt2800pci_read_eeprom_file(struct rt2x00_dev *rt2x00dev)
  15551. - {
  15552. - memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, EEPROM_SIZE);
  15553. - return 0;
  15554. -@@ -1093,8 +1093,9 @@ static int rt2800pci_read_eeprom(struct
  15555. - {
  15556. - int retval;
  15557. -
  15558. -- if (rt2x00_is_soc(rt2x00dev))
  15559. -- retval = rt2800pci_read_eeprom_soc(rt2x00dev);
  15560. -+ if (rt2x00_is_soc(rt2x00dev) ||
  15561. -+ test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags))
  15562. -+ retval = rt2800pci_read_eeprom_file(rt2x00dev);
  15563. - else if (rt2800pci_efuse_detect(rt2x00dev))
  15564. - retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
  15565. - else
  15566. ---- a/drivers/net/wireless/rt2x00/rt2x00pci.c
  15567. -+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
  15568. -@@ -78,6 +78,7 @@ exit:
  15569. - int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops)
  15570. - {
  15571. - struct ieee80211_hw *hw;
  15572. -+ struct rt2x00_platform_data *pdata;
  15573. - struct rt2x00_dev *rt2x00dev;
  15574. - int retval;
  15575. - u16 chip;
  15576. -@@ -125,6 +126,12 @@ int rt2x00pci_probe(struct pci_dev *pci_
  15577. - rt2x00dev->irq = pci_dev->irq;
  15578. - rt2x00dev->name = pci_name(pci_dev);
  15579. -
  15580. -+ /* if we get passed the name of a eeprom_file_name, then use this in
  15581. -+ favour of the eeprom */
  15582. -+ pdata = rt2x00dev->dev->platform_data;
  15583. -+ if (pdata && pdata->eeprom_file_name)
  15584. -+ set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
  15585. -+
  15586. - if (pci_is_pcie(pci_dev))
  15587. - rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE);
  15588. - else
  15589. diff --git a/package/mac80211/patches/606-rt2x00_no_realign.patch b/package/mac80211/patches/606-rt2x00_no_realign.patch
  15590. deleted file mode 100644
  15591. index 9608df2..0000000
  15592. --- a/package/mac80211/patches/606-rt2x00_no_realign.patch
  15593. +++ /dev/null
  15594. @@ -1,67 +0,0 @@
  15595. -[RFC] rt2x00: For drivers that only need L2 padding don't realign frames
  15596. -
  15597. -Signed-off-by: Helmut Schaa <helmut.schaa@...>
  15598. ----
  15599. -
  15600. -Ivo, Gertjan, do you remeber by any chance why this alignment stuff was added
  15601. -in the first place? Was it because of DMA restrictions?
  15602. -
  15603. -While doing some profiling on the rt3052 SoC I noticed that 30-40% time was
  15604. -spent in memmove calls. And the culprit is the memmove aligning the payload
  15605. -to a 4byte boundary since that has to move a whole bunch of data.
  15606. -
  15607. -Interesstingly the legacy drivers insert an l2pad between the header and the
  15608. -payload but doesn't realign the payload itself to a 4-byte boundary. Hence,
  15609. -I came up with this patch and indeed CPU usage improves impressively.
  15610. -
  15611. -Only tested on rt2800pci!
  15612. -
  15613. -Thanks,
  15614. -Helmut
  15615. -
  15616. - drivers/net/wireless/rt2x00/rt2x00queue.c | 30 +++-------------------------
  15617. - 1 files changed, 4 insertions(+), 26 deletions(-)
  15618. -
  15619. ---- a/drivers/net/wireless/rt2x00/rt2x00queue.c
  15620. -+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
  15621. -@@ -163,36 +163,14 @@ void rt2x00queue_align_frame(struct sk_b
  15622. - void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
  15623. - {
  15624. - unsigned int payload_length = skb->len - header_length;
  15625. -- unsigned int header_align = ALIGN_SIZE(skb, 0);
  15626. -- unsigned int payload_align = ALIGN_SIZE(skb, header_length);
  15627. - unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
  15628. -
  15629. -- /*
  15630. -- * Adjust the header alignment if the payload needs to be moved more
  15631. -- * than the header.
  15632. -- */
  15633. -- if (payload_align > header_align)
  15634. -- header_align += 4;
  15635. --
  15636. -- /* There is nothing to do if no alignment is needed */
  15637. -- if (!header_align)
  15638. -+ if (!l2pad)
  15639. - return;
  15640. -
  15641. -- /* Reserve the amount of space needed in front of the frame */
  15642. -- skb_push(skb, header_align);
  15643. --
  15644. -- /*
  15645. -- * Move the header.
  15646. -- */
  15647. -- memmove(skb->data, skb->data + header_align, header_length);
  15648. --
  15649. -- /* Move the payload, if present and if required */
  15650. -- if (payload_length && payload_align)
  15651. -- memmove(skb->data + header_length + l2pad,
  15652. -- skb->data + header_length + l2pad + payload_align,
  15653. -- payload_length);
  15654. --
  15655. -- /* Trim the skb to the correct size */
  15656. -+ /* insert l2pad -> Move header */
  15657. -+ skb_push(skb, l2pad);
  15658. -+ memmove(skb->data, skb->data + l2pad, header_length);
  15659. - skb_trim(skb, header_length + l2pad + payload_length);
  15660. - }
  15661. -
  15662. diff --git a/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch
  15663. deleted file mode 100644
  15664. index 5e6e27d..0000000
  15665. --- a/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch
  15666. +++ /dev/null
  15667. @@ -1,47 +0,0 @@
  15668. ---- a/include/linux/rt2x00_platform.h
  15669. -+++ b/include/linux/rt2x00_platform.h
  15670. -@@ -14,6 +14,9 @@
  15671. -
  15672. - struct rt2x00_platform_data {
  15673. - char *eeprom_file_name;
  15674. -+
  15675. -+ int disable_2ghz;
  15676. -+ int disable_5ghz;
  15677. - };
  15678. -
  15679. - #endif /* _RT2X00_PLATFORM_H */
  15680. ---- a/drivers/net/wireless/rt2x00/rt2x00dev.c
  15681. -+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
  15682. -@@ -938,6 +938,22 @@ static int rt2x00lib_probe_hw_modes(stru
  15683. - unsigned int num_rates;
  15684. - unsigned int i;
  15685. -
  15686. -+ if (rt2x00dev->dev->platform_data) {
  15687. -+ struct rt2x00_platform_data *pdata;
  15688. -+
  15689. -+ pdata = rt2x00dev->dev->platform_data;
  15690. -+ if (pdata->disable_2ghz)
  15691. -+ spec->supported_bands &= ~SUPPORT_BAND_2GHZ;
  15692. -+ if (pdata->disable_5ghz)
  15693. -+ spec->supported_bands &= ~SUPPORT_BAND_5GHZ;
  15694. -+ }
  15695. -+
  15696. -+ if ((spec->supported_bands & SUPPORT_BAND_BOTH) == 0) {
  15697. -+ rt2x00_err(rt2x00dev, "No supported bands\n");
  15698. -+ return -EINVAL;
  15699. -+ }
  15700. -+
  15701. -+
  15702. - num_rates = 0;
  15703. - if (spec->supported_rates & SUPPORT_RATE_CCK)
  15704. - num_rates += 4;
  15705. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  15706. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  15707. -@@ -414,6 +414,7 @@ struct hw_mode_spec {
  15708. - unsigned int supported_bands;
  15709. - #define SUPPORT_BAND_2GHZ 0x00000001
  15710. - #define SUPPORT_BAND_5GHZ 0x00000002
  15711. -+#define SUPPORT_BAND_BOTH (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ)
  15712. -
  15713. - unsigned int supported_rates;
  15714. - #define SUPPORT_RATE_CCK 0x00000001
  15715. diff --git a/package/mac80211/patches/608-add_platform_data_mac_addr.patch b/package/mac80211/patches/608-add_platform_data_mac_addr.patch
  15716. deleted file mode 100644
  15717. index 0695b89..0000000
  15718. --- a/package/mac80211/patches/608-add_platform_data_mac_addr.patch
  15719. +++ /dev/null
  15720. @@ -1,63 +0,0 @@
  15721. ---- a/include/linux/rt2x00_platform.h
  15722. -+++ b/include/linux/rt2x00_platform.h
  15723. -@@ -14,6 +14,7 @@
  15724. -
  15725. - struct rt2x00_platform_data {
  15726. - char *eeprom_file_name;
  15727. -+ const u8 *mac_address;
  15728. -
  15729. - int disable_2ghz;
  15730. - int disable_5ghz;
  15731. ---- a/drivers/net/wireless/rt2x00/rt2x00dev.c
  15732. -+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
  15733. -@@ -929,6 +929,18 @@ static void rt2x00lib_rate(struct ieee80
  15734. - entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE;
  15735. - }
  15736. -
  15737. -+const u8 *rt2x00lib_get_mac_address(struct rt2x00_dev *rt2x00dev)
  15738. -+{
  15739. -+ struct rt2x00_platform_data *pdata;
  15740. -+
  15741. -+ pdata = rt2x00dev->dev->platform_data;
  15742. -+ if (!pdata)
  15743. -+ return NULL;
  15744. -+
  15745. -+ return pdata->mac_address;
  15746. -+}
  15747. -+EXPORT_SYMBOL_GPL(rt2x00lib_get_mac_address);
  15748. -+
  15749. - static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
  15750. - struct hw_mode_spec *spec)
  15751. - {
  15752. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  15753. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  15754. -@@ -1326,6 +1326,7 @@ static inline void rt2x00debug_dump_fram
  15755. - */
  15756. - u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
  15757. - struct ieee80211_vif *vif);
  15758. -+const u8 *rt2x00lib_get_mac_address(struct rt2x00_dev *rt2x00dev);
  15759. -
  15760. - /*
  15761. - * Interrupt context handlers.
  15762. ---- a/drivers/net/wireless/rt2x00/rt61pci.c
  15763. -+++ b/drivers/net/wireless/rt2x00/rt61pci.c
  15764. -@@ -2395,6 +2395,7 @@ static int rt61pci_validate_eeprom(struc
  15765. - u32 reg;
  15766. - u16 word;
  15767. - u8 *mac;
  15768. -+ const u8 *pdata_mac;
  15769. - s8 value;
  15770. -
  15771. - rt2x00mmio_register_read(rt2x00dev, E2PROM_CSR, &reg);
  15772. -@@ -2415,7 +2416,11 @@ static int rt61pci_validate_eeprom(struc
  15773. - /*
  15774. - * Start validation of the data that has been read.
  15775. - */
  15776. -+ pdata_mac = rt2x00lib_get_mac_address(rt2x00dev);
  15777. - mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
  15778. -+ if (pdata_mac)
  15779. -+ memcpy(mac, pdata_mac, 6);
  15780. -+
  15781. - if (!is_valid_ether_addr(mac)) {
  15782. - eth_random_addr(mac);
  15783. - rt2x00_eeprom_dbg(rt2x00dev, "MAC: %pM\n", mac);
  15784. diff --git a/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch b/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch
  15785. deleted file mode 100644
  15786. index 8369a78..0000000
  15787. --- a/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch
  15788. +++ /dev/null
  15789. @@ -1,214 +0,0 @@
  15790. ---- a/drivers/net/wireless/rt2x00/rt2800lib.c
  15791. -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  15792. -@@ -2631,15 +2631,18 @@ static void rt2800_config_channel(struct
  15793. - /*
  15794. - * Change BBP settings
  15795. - */
  15796. -+ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  15797. -+ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  15798. -+ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  15799. -+
  15800. - if (rt2x00_rt(rt2x00dev, RT3352)) {
  15801. - rt2800_bbp_write(rt2x00dev, 27, 0x0);
  15802. - rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev->lna_gain);
  15803. - rt2800_bbp_write(rt2x00dev, 27, 0x20);
  15804. - rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev->lna_gain);
  15805. -+ rt2800_bbp_write(rt2x00dev, 86, 0x38);
  15806. -+ rt2800_bbp_write(rt2x00dev, 83, 0x6a);
  15807. - } else {
  15808. -- rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  15809. -- rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  15810. -- rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  15811. - rt2800_bbp_write(rt2x00dev, 86, 0);
  15812. - }
  15813. -
  15814. -@@ -4971,6 +4974,12 @@ static void rt2800_init_rfcsr_3290(struc
  15815. -
  15816. - static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev)
  15817. - {
  15818. -+ int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0,
  15819. -+ &rt2x00dev->cap_flags);
  15820. -+ int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1,
  15821. -+ &rt2x00dev->cap_flags);
  15822. -+ u8 rfcsr;
  15823. -+
  15824. - rt2800_rf_init_calibration(rt2x00dev, 30);
  15825. -
  15826. - rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
  15827. -@@ -5006,15 +5015,30 @@ static void rt2800_init_rfcsr_3352(struc
  15828. - rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  15829. - rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  15830. - rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
  15831. -- rt2800_rfcsr_write(rt2x00dev, 34, 0x01);
  15832. -+ rfcsr = 0x01;
  15833. -+ if (!tx0_int_pa)
  15834. -+ rt2x00_set_field8(&rfcsr, RFCSR34_TX0_EXT_PA, 1);
  15835. -+ if (!tx1_int_pa)
  15836. -+ rt2x00_set_field8(&rfcsr, RFCSR34_TX1_EXT_PA, 1);
  15837. -+ rt2800_rfcsr_write(rt2x00dev, 34, rfcsr);
  15838. - rt2800_rfcsr_write(rt2x00dev, 35, 0x03);
  15839. - rt2800_rfcsr_write(rt2x00dev, 36, 0xbd);
  15840. - rt2800_rfcsr_write(rt2x00dev, 37, 0x3c);
  15841. - rt2800_rfcsr_write(rt2x00dev, 38, 0x5f);
  15842. - rt2800_rfcsr_write(rt2x00dev, 39, 0xc5);
  15843. - rt2800_rfcsr_write(rt2x00dev, 40, 0x33);
  15844. -- rt2800_rfcsr_write(rt2x00dev, 41, 0x5b);
  15845. -- rt2800_rfcsr_write(rt2x00dev, 42, 0x5b);
  15846. -+ rfcsr = 0x52;
  15847. -+ if (tx0_int_pa) {
  15848. -+ rt2x00_set_field8(&rfcsr, RFCSR41_BIT1, 1);
  15849. -+ rt2x00_set_field8(&rfcsr, RFCSR41_BIT4, 1);
  15850. -+ }
  15851. -+ rt2800_rfcsr_write(rt2x00dev, 41, rfcsr);
  15852. -+ rfcsr = 0x52;
  15853. -+ if (tx1_int_pa) {
  15854. -+ rt2x00_set_field8(&rfcsr, RFCSR42_BIT1, 1);
  15855. -+ rt2x00_set_field8(&rfcsr, RFCSR42_BIT4, 1);
  15856. -+ }
  15857. -+ rt2800_rfcsr_write(rt2x00dev, 42, rfcsr);
  15858. - rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
  15859. - rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
  15860. - rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
  15861. -@@ -5022,15 +5046,20 @@ static void rt2800_init_rfcsr_3352(struc
  15862. - rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
  15863. - rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
  15864. - rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
  15865. -- rt2800_rfcsr_write(rt2x00dev, 50, 0x2d);
  15866. -- rt2800_rfcsr_write(rt2x00dev, 51, 0x7f);
  15867. -- rt2800_rfcsr_write(rt2x00dev, 52, 0x00);
  15868. -- rt2800_rfcsr_write(rt2x00dev, 53, 0x52);
  15869. -- rt2800_rfcsr_write(rt2x00dev, 54, 0x1b);
  15870. -- rt2800_rfcsr_write(rt2x00dev, 55, 0x7f);
  15871. -- rt2800_rfcsr_write(rt2x00dev, 56, 0x00);
  15872. -- rt2800_rfcsr_write(rt2x00dev, 57, 0x52);
  15873. -- rt2800_rfcsr_write(rt2x00dev, 58, 0x1b);
  15874. -+ rfcsr = 0x2d;
  15875. -+ if (!tx0_int_pa)
  15876. -+ rt2x00_set_field8(&rfcsr, RFCSR50_TX0_EXT_PA, 1);
  15877. -+ if (!tx1_int_pa)
  15878. -+ rt2x00_set_field8(&rfcsr, RFCSR50_TX1_EXT_PA, 1);
  15879. -+ rt2800_rfcsr_write(rt2x00dev, 50, rfcsr);
  15880. -+ rt2800_rfcsr_write(rt2x00dev, 51, (tx0_int_pa ? 0x7f : 0x52));
  15881. -+ rt2800_rfcsr_write(rt2x00dev, 52, (tx0_int_pa ? 0x00 : 0xc0));
  15882. -+ rt2800_rfcsr_write(rt2x00dev, 53, (tx0_int_pa ? 0x52 : 0xd2));
  15883. -+ rt2800_rfcsr_write(rt2x00dev, 54, (tx0_int_pa ? 0x1b : 0xc0));
  15884. -+ rt2800_rfcsr_write(rt2x00dev, 55, (tx1_int_pa ? 0x7f : 0x52));
  15885. -+ rt2800_rfcsr_write(rt2x00dev, 56, (tx1_int_pa ? 0x00 : 0xc0));
  15886. -+ rt2800_rfcsr_write(rt2x00dev, 57, (tx0_int_pa ? 0x52 : 0x49));
  15887. -+ rt2800_rfcsr_write(rt2x00dev, 58, (tx1_int_pa ? 0x1b : 0xc0));
  15888. - rt2800_rfcsr_write(rt2x00dev, 59, 0x00);
  15889. - rt2800_rfcsr_write(rt2x00dev, 60, 0x00);
  15890. - rt2800_rfcsr_write(rt2x00dev, 61, 0x00);
  15891. -@@ -5716,6 +5745,7 @@ static int rt2800_init_eeprom(struct rt2
  15892. - * RT53xx: defined in "EEPROM_CHIP_ID" field
  15893. - */
  15894. - if (rt2x00_rt(rt2x00dev, RT3290) ||
  15895. -+ rt2x00_rt(rt2x00dev, RT3352) ||
  15896. - rt2x00_rt(rt2x00dev, RT5390) ||
  15897. - rt2x00_rt(rt2x00dev, RT5392))
  15898. - rt2x00_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  15899. -@@ -5805,7 +5835,8 @@ static int rt2800_init_eeprom(struct rt2
  15900. - /*
  15901. - * Detect if this device has Bluetooth co-existence.
  15902. - */
  15903. -- if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST))
  15904. -+ if (!rt2x00_rt(rt2x00dev, RT3352) &&
  15905. -+ rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_BT_COEXIST))
  15906. - __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags);
  15907. -
  15908. - /*
  15909. -@@ -5834,6 +5865,22 @@ static int rt2800_init_eeprom(struct rt2
  15910. - EIRP_MAX_TX_POWER_LIMIT)
  15911. - __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags);
  15912. -
  15913. -+ /*
  15914. -+ * Detect if device uses internal or external PA
  15915. -+ */
  15916. -+ rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
  15917. -+
  15918. -+ if (rt2x00_rt(rt2x00dev, RT3352)) {
  15919. -+ if (!rt2x00_get_field16(eeprom,
  15920. -+ EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
  15921. -+ __set_bit(CAPABILITY_INTERNAL_PA_TX0,
  15922. -+ &rt2x00dev->cap_flags);
  15923. -+ if (!rt2x00_get_field16(eeprom,
  15924. -+ EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352))
  15925. -+ __set_bit(CAPABILITY_INTERNAL_PA_TX1,
  15926. -+ &rt2x00dev->cap_flags);
  15927. -+ }
  15928. -+
  15929. - return 0;
  15930. - }
  15931. -
  15932. ---- a/drivers/net/wireless/rt2x00/rt2800.h
  15933. -+++ b/drivers/net/wireless/rt2x00/rt2800.h
  15934. -@@ -2153,6 +2153,12 @@ struct mac_iveiv_entry {
  15935. - #define RFCSR31_RX_CALIB FIELD8(0x7f)
  15936. -
  15937. - /*
  15938. -+ * RFCSR 34:
  15939. -+ */
  15940. -+#define RFCSR34_TX0_EXT_PA FIELD8(0x04)
  15941. -+#define RFCSR34_TX1_EXT_PA FIELD8(0x08)
  15942. -+
  15943. -+/*
  15944. - * RFCSR 38:
  15945. - */
  15946. - #define RFCSR38_RX_LO1_EN FIELD8(0x20)
  15947. -@@ -2163,6 +2169,18 @@ struct mac_iveiv_entry {
  15948. - #define RFCSR39_RX_LO2_EN FIELD8(0x80)
  15949. -
  15950. - /*
  15951. -+ * RFCSR 41:
  15952. -+ */
  15953. -+#define RFCSR41_BIT1 FIELD8(0x01)
  15954. -+#define RFCSR41_BIT4 FIELD8(0x08)
  15955. -+
  15956. -+/*
  15957. -+ * RFCSR 42:
  15958. -+ */
  15959. -+#define RFCSR42_BIT1 FIELD8(0x01)
  15960. -+#define RFCSR42_BIT4 FIELD8(0x08)
  15961. -+
  15962. -+/*
  15963. - * RFCSR 49:
  15964. - */
  15965. - #define RFCSR49_TX FIELD8(0x3f)
  15966. -@@ -2172,6 +2190,8 @@ struct mac_iveiv_entry {
  15967. - * RFCSR 50:
  15968. - */
  15969. - #define RFCSR50_TX FIELD8(0x3f)
  15970. -+#define RFCSR50_TX0_EXT_PA FIELD8(0x02)
  15971. -+#define RFCSR50_TX1_EXT_PA FIELD8(0x10)
  15972. - #define RFCSR50_EP FIELD8(0xc0)
  15973. -
  15974. - /*
  15975. -@@ -2260,6 +2280,8 @@ struct mac_iveiv_entry {
  15976. - * INTERNAL_TX_ALC: 0: disable, 1: enable
  15977. - * BT_COEXIST: 0: disable, 1: enable
  15978. - * DAC_TEST: 0: disable, 1: enable
  15979. -+ * EXTERNAL_TX0_PA: 0: disable, 1: enable (only on RT3352)
  15980. -+ * EXTERNAL_TX1_PA: 0: disable, 1: enable (only on RT3352)
  15981. - */
  15982. - #define EEPROM_NIC_CONF1 0x001b
  15983. - #define EEPROM_NIC_CONF1_HW_RADIO FIELD16(0x0001)
  15984. -@@ -2277,6 +2299,8 @@ struct mac_iveiv_entry {
  15985. - #define EEPROM_NIC_CONF1_INTERNAL_TX_ALC FIELD16(0x2000)
  15986. - #define EEPROM_NIC_CONF1_BT_COEXIST FIELD16(0x4000)
  15987. - #define EEPROM_NIC_CONF1_DAC_TEST FIELD16(0x8000)
  15988. -+#define EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352 FIELD16(0x4000)
  15989. -+#define EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352 FIELD16(0x8000)
  15990. -
  15991. - /*
  15992. - * EEPROM frequency
  15993. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  15994. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  15995. -@@ -726,6 +726,8 @@ enum rt2x00_capability_flags {
  15996. - CAPABILITY_DOUBLE_ANTENNA,
  15997. - CAPABILITY_BT_COEXIST,
  15998. - CAPABILITY_VCO_RECALIBRATION,
  15999. -+ CAPABILITY_INTERNAL_PA_TX0,
  16000. -+ CAPABILITY_INTERNAL_PA_TX1,
  16001. - };
  16002. -
  16003. - /*
  16004. diff --git a/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch b/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch
  16005. deleted file mode 100644
  16006. index e16d970..0000000
  16007. --- a/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch
  16008. +++ /dev/null
  16009. @@ -1,115 +0,0 @@
  16010. ---- a/drivers/net/wireless/rt2x00/rt2800lib.c
  16011. -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  16012. -@@ -6157,6 +6157,27 @@ static const struct rf_channel rf_vals_5
  16013. - {196, 83, 0, 12, 1},
  16014. - };
  16015. -
  16016. -+/*
  16017. -+ * RF value list for rt3xxx with Xtal20MHz
  16018. -+ * Supports: 2.4 GHz (all) (RF3322)
  16019. -+ */
  16020. -+static const struct rf_channel rf_vals_xtal20mhz_3x[] = {
  16021. -+ {1, 0xE2, 2, 0x14},
  16022. -+ {2, 0xE3, 2, 0x14},
  16023. -+ {3, 0xE4, 2, 0x14},
  16024. -+ {4, 0xE5, 2, 0x14},
  16025. -+ {5, 0xE6, 2, 0x14},
  16026. -+ {6, 0xE7, 2, 0x14},
  16027. -+ {7, 0xE8, 2, 0x14},
  16028. -+ {8, 0xE9, 2, 0x14},
  16029. -+ {9, 0xEA, 2, 0x14},
  16030. -+ {10, 0xEB, 2, 0x14},
  16031. -+ {11, 0xEC, 2, 0x14},
  16032. -+ {12, 0xED, 2, 0x14},
  16033. -+ {13, 0xEE, 2, 0x14},
  16034. -+ {14, 0xF0, 2, 0x18},
  16035. -+};
  16036. -+
  16037. - static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
  16038. - {
  16039. - struct hw_mode_spec *spec = &rt2x00dev->spec;
  16040. -@@ -6235,7 +6256,6 @@ static int rt2800_probe_hw_mode(struct r
  16041. - rt2x00_rf(rt2x00dev, RF3022) ||
  16042. - rt2x00_rf(rt2x00dev, RF3290) ||
  16043. - rt2x00_rf(rt2x00dev, RF3320) ||
  16044. -- rt2x00_rf(rt2x00dev, RF3322) ||
  16045. - rt2x00_rf(rt2x00dev, RF5360) ||
  16046. - rt2x00_rf(rt2x00dev, RF5370) ||
  16047. - rt2x00_rf(rt2x00dev, RF5372) ||
  16048. -@@ -6243,6 +6263,12 @@ static int rt2800_probe_hw_mode(struct r
  16049. - rt2x00_rf(rt2x00dev, RF5392)) {
  16050. - spec->num_channels = 14;
  16051. - spec->channels = rf_vals_3x;
  16052. -+ } else if (rt2x00_rf(rt2x00dev, RF3322)) {
  16053. -+ spec->num_channels = 14;
  16054. -+ if (spec->clk_is_20mhz)
  16055. -+ spec->channels = rf_vals_xtal20mhz_3x;
  16056. -+ else
  16057. -+ spec->channels = rf_vals_3x;
  16058. - } else if (rt2x00_rf(rt2x00dev, RF3052)) {
  16059. - spec->supported_bands |= SUPPORT_BAND_5GHZ;
  16060. - spec->num_channels = ARRAY_SIZE(rf_vals_3x);
  16061. -@@ -6390,6 +6416,19 @@ static int rt2800_probe_rt(struct rt2x00
  16062. - return 0;
  16063. - }
  16064. -
  16065. -+int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
  16066. -+{
  16067. -+ struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
  16068. -+ struct hw_mode_spec *spec = &rt2x00dev->spec;
  16069. -+
  16070. -+ if (!pdata)
  16071. -+ return -EINVAL;
  16072. -+
  16073. -+ spec->clk_is_20mhz = pdata->clk_is_20mhz;
  16074. -+
  16075. -+ return 0;
  16076. -+}
  16077. -+
  16078. - int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
  16079. - {
  16080. - int retval;
  16081. -@@ -6419,6 +6458,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  16082. - rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
  16083. -
  16084. - /*
  16085. -+ * Probe SoC clock.
  16086. -+ */
  16087. -+ if (rt2x00_is_soc(rt2x00dev)) {
  16088. -+ retval = rt2800_probe_clk(rt2x00dev);
  16089. -+ if (retval)
  16090. -+ return retval;
  16091. -+ }
  16092. -+
  16093. -+ /*
  16094. - * Initialize hw specifications.
  16095. - */
  16096. - retval = rt2800_probe_hw_mode(rt2x00dev);
  16097. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  16098. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  16099. -@@ -409,6 +409,7 @@ static inline struct rt2x00_intf* vif_to
  16100. - * @channels: Device/chipset specific channel values (See &struct rf_channel).
  16101. - * @channels_info: Additional information for channels (See &struct channel_info).
  16102. - * @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap).
  16103. -+ * @clk_is_20mhz: External crystal of WiSoC is 20MHz instead of 40MHz
  16104. - */
  16105. - struct hw_mode_spec {
  16106. - unsigned int supported_bands;
  16107. -@@ -425,6 +426,7 @@ struct hw_mode_spec {
  16108. - const struct channel_info *channels_info;
  16109. -
  16110. - struct ieee80211_sta_ht_cap ht;
  16111. -+ int clk_is_20mhz;
  16112. - };
  16113. -
  16114. - /*
  16115. ---- a/include/linux/rt2x00_platform.h
  16116. -+++ b/include/linux/rt2x00_platform.h
  16117. -@@ -18,6 +18,7 @@ struct rt2x00_platform_data {
  16118. -
  16119. - int disable_2ghz;
  16120. - int disable_5ghz;
  16121. -+ int clk_is_20mhz;
  16122. - };
  16123. -
  16124. - #endif /* _RT2X00_PLATFORM_H */
  16125. 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
  16126. deleted file mode 100644
  16127. index 81125a9..0000000
  16128. --- a/package/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
  16129. +++ /dev/null
  16130. @@ -1,34 +0,0 @@
  16131. -From 04dbd87265f6ba4a373b211ba324b437d224fb2d Mon Sep 17 00:00:00 2001
  16132. -From: John Crispin <blogic@openwrt.org>
  16133. -Date: Sun, 17 Mar 2013 00:03:31 +0100
  16134. -Subject: [PATCH 21/38] rt2x00: make wmac loadable via OF on rt288x/305x SoC
  16135. -
  16136. -This patch ads the match table to allow loading the wmac support from a
  16137. -devicetree.
  16138. -
  16139. -Signed-off-by: John Crispin <blogic@openwrt.org>
  16140. ----
  16141. - drivers/net/wireless/rt2x00/rt2800pci.c | 7 +++++++
  16142. - 1 file changed, 7 insertions(+)
  16143. -
  16144. ---- a/drivers/net/wireless/rt2x00/rt2800pci.c
  16145. -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  16146. -@@ -1309,11 +1309,18 @@ static int rt2800soc_probe(struct platfo
  16147. - return rt2x00soc_probe(pdev, &rt2800pci_ops);
  16148. - }
  16149. -
  16150. -+static const struct of_device_id rt2880_wmac_match[] = {
  16151. -+ { .compatible = "ralink,rt2880-wmac" },
  16152. -+ {},
  16153. -+};
  16154. -+MODULE_DEVICE_TABLE(of, rt2880_wmac_match);
  16155. -+
  16156. - static struct platform_driver rt2800soc_driver = {
  16157. - .driver = {
  16158. - .name = "rt2800_wmac",
  16159. - .owner = THIS_MODULE,
  16160. - .mod_name = KBUILD_MODNAME,
  16161. -+ .of_match_table = rt2880_wmac_match,
  16162. - },
  16163. - .probe = rt2800soc_probe,
  16164. - .remove = rt2x00soc_remove,
  16165. diff --git a/package/mac80211/patches/614-rt2x00-of_load_eeprom_filename.patch b/package/mac80211/patches/614-rt2x00-of_load_eeprom_filename.patch
  16166. deleted file mode 100644
  16167. index 293b71a..0000000
  16168. --- a/package/mac80211/patches/614-rt2x00-of_load_eeprom_filename.patch
  16169. +++ /dev/null
  16170. @@ -1,28 +0,0 @@
  16171. ---- a/drivers/net/wireless/rt2x00/rt2800pci.c
  16172. -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  16173. -@@ -39,6 +39,7 @@
  16174. - #include <linux/pci.h>
  16175. - #include <linux/platform_device.h>
  16176. - #include <linux/eeprom_93cx6.h>
  16177. -+#include <linux/of.h>
  16178. -
  16179. - #include "rt2x00.h"
  16180. - #include "rt2x00mmio.h"
  16181. -@@ -323,11 +324,17 @@ static int rt2800pci_write_firmware(stru
  16182. - static char *rt2800pci_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
  16183. - {
  16184. - struct rt2x00_platform_data *pdata;
  16185. -+ struct device_node *np;
  16186. -+ char *eep;
  16187. -
  16188. - pdata = rt2x00dev->dev->platform_data;
  16189. - if (pdata)
  16190. - return pdata->eeprom_file_name;
  16191. -
  16192. -+ np = rt2x00dev->dev->of_node;
  16193. -+ if (np && !of_property_read_string(np, "ralink,eeprom", &eep))
  16194. -+ return eep;
  16195. -+
  16196. - return NULL;
  16197. - }
  16198. -
  16199. diff --git a/package/mac80211/patches/616-rt2x00-support-rt5350.patch b/package/mac80211/patches/616-rt2x00-support-rt5350.patch
  16200. deleted file mode 100644
  16201. index 9dc5835..0000000
  16202. --- a/package/mac80211/patches/616-rt2x00-support-rt5350.patch
  16203. +++ /dev/null
  16204. @@ -1,281 +0,0 @@
  16205. ---- a/drivers/net/wireless/rt2x00/rt2800.h
  16206. -+++ b/drivers/net/wireless/rt2x00/rt2800.h
  16207. -@@ -71,6 +71,7 @@
  16208. - #define RF3053 0x000d
  16209. - #define RF5592 0x000f
  16210. - #define RF3290 0x3290
  16211. -+#define RF5350 0x5350
  16212. - #define RF5360 0x5360
  16213. - #define RF5370 0x5370
  16214. - #define RF5372 0x5372
  16215. ---- a/drivers/net/wireless/rt2x00/rt2800lib.c
  16216. -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  16217. -@@ -2140,6 +2140,15 @@ static void rt2800_config_channel_rf53xx
  16218. - if (rf->channel <= 14) {
  16219. - int idx = rf->channel-1;
  16220. -
  16221. -+ if (rt2x00_rt(rt2x00dev, RT5350)) {
  16222. -+ static const char r59_non_bt[] = {0x0b, 0x0b,
  16223. -+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a,
  16224. -+ 0x0a, 0x09, 0x08, 0x07, 0x07, 0x06};
  16225. -+
  16226. -+ rt2800_rfcsr_write(rt2x00dev, 59,
  16227. -+ r59_non_bt[idx]);
  16228. -+ }
  16229. -+
  16230. - if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) {
  16231. - if (rt2x00_rt_rev_gte(rt2x00dev, RT5390, REV_RT5390F)) {
  16232. - /* r55/r59 value array of channel 1~14 */
  16233. -@@ -2597,6 +2606,7 @@ static void rt2800_config_channel(struct
  16234. - case RF3322:
  16235. - rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
  16236. - break;
  16237. -+ case RF5350:
  16238. - case RF5360:
  16239. - case RF5370:
  16240. - case RF5372:
  16241. -@@ -2613,6 +2623,7 @@ static void rt2800_config_channel(struct
  16242. -
  16243. - if (rt2x00_rf(rt2x00dev, RF3290) ||
  16244. - rt2x00_rf(rt2x00dev, RF3322) ||
  16245. -+ rt2x00_rf(rt2x00dev, RF5350) ||
  16246. - rt2x00_rf(rt2x00dev, RF5360) ||
  16247. - rt2x00_rf(rt2x00dev, RF5370) ||
  16248. - rt2x00_rf(rt2x00dev, RF5372) ||
  16249. -@@ -2777,7 +2788,8 @@ static void rt2800_config_channel(struct
  16250. - /*
  16251. - * Clear update flag
  16252. - */
  16253. -- if (rt2x00_rt(rt2x00dev, RT3352)) {
  16254. -+ if (rt2x00_rt(rt2x00dev, RT3352) ||
  16255. -+ rt2x00_rt(rt2x00dev, RT5350)) {
  16256. - rt2800_bbp_read(rt2x00dev, 49, &bbp);
  16257. - rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0);
  16258. - rt2800_bbp_write(rt2x00dev, 49, bbp);
  16259. -@@ -3223,6 +3235,7 @@ void rt2800_vco_calibration(struct rt2x0
  16260. - rt2800_rfcsr_write(rt2x00dev, 7, rfcsr);
  16261. - break;
  16262. - case RF3290:
  16263. -+ case RF5350:
  16264. - case RF5360:
  16265. - case RF5370:
  16266. - case RF5372:
  16267. -@@ -3562,7 +3575,8 @@ static int rt2800_init_registers(struct
  16268. - } else if (rt2x00_rt(rt2x00dev, RT3572)) {
  16269. - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400);
  16270. - rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
  16271. -- } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  16272. -+ } else if (rt2x00_rt(rt2x00dev, RT5350) ||
  16273. -+ rt2x00_rt(rt2x00dev, RT5390) ||
  16274. - rt2x00_rt(rt2x00dev, RT5392) ||
  16275. - rt2x00_rt(rt2x00dev, RT5592)) {
  16276. - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
  16277. -@@ -4215,9 +4229,13 @@ static void rt2800_init_bbp_3352(struct
  16278. -
  16279. - rt2800_bbp_write(rt2x00dev, 82, 0x62);
  16280. -
  16281. -- rt2800_bbp_write(rt2x00dev, 83, 0x6a);
  16282. --
  16283. -- rt2800_bbp_write(rt2x00dev, 84, 0x99);
  16284. -+ if (rt2x00_rt(rt2x00dev, RT5350)) {
  16285. -+ rt2800_bbp_write(rt2x00dev, 83, 0x7a);
  16286. -+ rt2800_bbp_write(rt2x00dev, 84, 0x9a);
  16287. -+ } else {
  16288. -+ rt2800_bbp_write(rt2x00dev, 83, 0x6a);
  16289. -+ rt2800_bbp_write(rt2x00dev, 84, 0x99);
  16290. -+ }
  16291. -
  16292. - rt2800_bbp_write(rt2x00dev, 86, 0x38);
  16293. -
  16294. -@@ -4231,9 +4249,13 @@ static void rt2800_init_bbp_3352(struct
  16295. -
  16296. - rt2800_bbp_write(rt2x00dev, 104, 0x92);
  16297. -
  16298. -- rt2800_bbp_write(rt2x00dev, 105, 0x34);
  16299. --
  16300. -- rt2800_bbp_write(rt2x00dev, 106, 0x05);
  16301. -+ if (rt2x00_rt(rt2x00dev, RT5350)) {
  16302. -+ rt2800_bbp_write(rt2x00dev, 105, 0x3c);
  16303. -+ rt2800_bbp_write(rt2x00dev, 106, 0x03);
  16304. -+ } else {
  16305. -+ rt2800_bbp_write(rt2x00dev, 105, 0x34);
  16306. -+ rt2800_bbp_write(rt2x00dev, 106, 0x05);
  16307. -+ }
  16308. -
  16309. - rt2800_bbp_write(rt2x00dev, 120, 0x50);
  16310. -
  16311. -@@ -4258,6 +4280,13 @@ static void rt2800_init_bbp_3352(struct
  16312. - rt2800_bbp_write(rt2x00dev, 143, 0xa2);
  16313. -
  16314. - rt2800_bbp_write(rt2x00dev, 148, 0xc8);
  16315. -+
  16316. -+ if (rt2x00_rt(rt2x00dev, RT5350)) {
  16317. -+ rt2800_bbp_write(rt2x00dev, 150, 0x40); /* Antenna Software OFDM */
  16318. -+ rt2800_bbp_write(rt2x00dev, 151, 0x30); /* Antenna Software CCK */
  16319. -+ rt2800_bbp_write(rt2x00dev, 152, 0xa3);
  16320. -+ rt2800_bbp_write(rt2x00dev, 154, 0); /* Clear previously selected antenna */
  16321. -+ }
  16322. - }
  16323. -
  16324. - static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev)
  16325. -@@ -4542,6 +4571,7 @@ static void rt2800_init_bbp(struct rt2x0
  16326. - rt2800_init_bbp_3290(rt2x00dev);
  16327. - break;
  16328. - case RT3352:
  16329. -+ case RT5350:
  16330. - rt2800_init_bbp_3352(rt2x00dev);
  16331. - break;
  16332. - case RT3390:
  16333. -@@ -5181,6 +5211,76 @@ static void rt2800_init_rfcsr_3572(struc
  16334. - rt2800_normal_mode_setup_3xxx(rt2x00dev);
  16335. - }
  16336. -
  16337. -+static void rt2800_init_rfcsr_5350(struct rt2x00_dev *rt2x00dev)
  16338. -+{
  16339. -+ rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
  16340. -+ rt2800_rfcsr_write(rt2x00dev, 1, 0x23);
  16341. -+ rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
  16342. -+ rt2800_rfcsr_write(rt2x00dev, 3, 0x08);
  16343. -+ rt2800_rfcsr_write(rt2x00dev, 4, 0x49);
  16344. -+ rt2800_rfcsr_write(rt2x00dev, 5, 0x10);
  16345. -+ rt2800_rfcsr_write(rt2x00dev, 6, 0xe0);
  16346. -+ rt2800_rfcsr_write(rt2x00dev, 7, 0x00);
  16347. -+ rt2800_rfcsr_write(rt2x00dev, 8, 0xf1);
  16348. -+ rt2800_rfcsr_write(rt2x00dev, 9, 0x02);
  16349. -+ rt2800_rfcsr_write(rt2x00dev, 10, 0x53);
  16350. -+ rt2800_rfcsr_write(rt2x00dev, 11, 0x4a);
  16351. -+ rt2800_rfcsr_write(rt2x00dev, 12, 0x46);
  16352. -+ if(rt2x00dev->spec.clk_is_20mhz)
  16353. -+ rt2800_rfcsr_write(rt2x00dev, 13, 0x1f);
  16354. -+ else
  16355. -+ rt2800_rfcsr_write(rt2x00dev, 13, 0x9f);
  16356. -+ rt2800_rfcsr_write(rt2x00dev, 14, 0x00);
  16357. -+ rt2800_rfcsr_write(rt2x00dev, 15, 0x00);
  16358. -+ rt2800_rfcsr_write(rt2x00dev, 16, 0xc0);
  16359. -+ rt2800_rfcsr_write(rt2x00dev, 18, 0x03);
  16360. -+ rt2800_rfcsr_write(rt2x00dev, 19, 0x00);
  16361. -+ rt2800_rfcsr_write(rt2x00dev, 20, 0x00);
  16362. -+ rt2800_rfcsr_write(rt2x00dev, 21, 0x00);
  16363. -+ rt2800_rfcsr_write(rt2x00dev, 22, 0x20);
  16364. -+ rt2800_rfcsr_write(rt2x00dev, 23, 0x00);
  16365. -+ rt2800_rfcsr_write(rt2x00dev, 24, 0x00);
  16366. -+ rt2800_rfcsr_write(rt2x00dev, 25, 0x80);
  16367. -+ rt2800_rfcsr_write(rt2x00dev, 26, 0x00);
  16368. -+ rt2800_rfcsr_write(rt2x00dev, 27, 0x03);
  16369. -+ rt2800_rfcsr_write(rt2x00dev, 28, 0x00);
  16370. -+ rt2800_rfcsr_write(rt2x00dev, 29, 0xd0);
  16371. -+ rt2800_rfcsr_write(rt2x00dev, 30, 0x10);
  16372. -+ rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  16373. -+ rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  16374. -+ rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
  16375. -+ rt2800_rfcsr_write(rt2x00dev, 34, 0x07);
  16376. -+ rt2800_rfcsr_write(rt2x00dev, 35, 0x12);
  16377. -+ rt2800_rfcsr_write(rt2x00dev, 36, 0x00);
  16378. -+ rt2800_rfcsr_write(rt2x00dev, 37, 0x08);
  16379. -+ rt2800_rfcsr_write(rt2x00dev, 38, 0x85);
  16380. -+ rt2800_rfcsr_write(rt2x00dev, 39, 0x1b);
  16381. -+ rt2800_rfcsr_write(rt2x00dev, 40, 0x0b);
  16382. -+ rt2800_rfcsr_write(rt2x00dev, 41, 0xbb);
  16383. -+ rt2800_rfcsr_write(rt2x00dev, 42, 0xd5);
  16384. -+ rt2800_rfcsr_write(rt2x00dev, 43, 0x9b);
  16385. -+ rt2800_rfcsr_write(rt2x00dev, 44, 0x0c);
  16386. -+ rt2800_rfcsr_write(rt2x00dev, 45, 0xa6);
  16387. -+ rt2800_rfcsr_write(rt2x00dev, 46, 0x73);
  16388. -+ rt2800_rfcsr_write(rt2x00dev, 47, 0x00);
  16389. -+ rt2800_rfcsr_write(rt2x00dev, 48, 0x10);
  16390. -+ rt2800_rfcsr_write(rt2x00dev, 49, 0x80);
  16391. -+ rt2800_rfcsr_write(rt2x00dev, 50, 0x00);
  16392. -+ rt2800_rfcsr_write(rt2x00dev, 51, 0x00);
  16393. -+ rt2800_rfcsr_write(rt2x00dev, 52, 0x38);
  16394. -+ rt2800_rfcsr_write(rt2x00dev, 53, 0x00);
  16395. -+ rt2800_rfcsr_write(rt2x00dev, 54, 0x38);
  16396. -+ rt2800_rfcsr_write(rt2x00dev, 55, 0x43);
  16397. -+ rt2800_rfcsr_write(rt2x00dev, 56, 0x82);
  16398. -+ rt2800_rfcsr_write(rt2x00dev, 57, 0x00);
  16399. -+ rt2800_rfcsr_write(rt2x00dev, 58, 0x39);
  16400. -+ rt2800_rfcsr_write(rt2x00dev, 59, 0x0b);
  16401. -+ rt2800_rfcsr_write(rt2x00dev, 60, 0x45);
  16402. -+ rt2800_rfcsr_write(rt2x00dev, 61, 0xd1);
  16403. -+ rt2800_rfcsr_write(rt2x00dev, 62, 0x00);
  16404. -+ rt2800_rfcsr_write(rt2x00dev, 63, 0x00);
  16405. -+}
  16406. -+
  16407. - static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev)
  16408. - {
  16409. - rt2800_rf_init_calibration(rt2x00dev, 2);
  16410. -@@ -5409,6 +5509,9 @@ static void rt2800_init_rfcsr(struct rt2
  16411. - case RT3572:
  16412. - rt2800_init_rfcsr_3572(rt2x00dev);
  16413. - break;
  16414. -+ case RT5350:
  16415. -+ rt2800_init_rfcsr_5350(rt2x00dev);
  16416. -+ break;
  16417. - case RT5390:
  16418. - rt2800_init_rfcsr_5390(rt2x00dev);
  16419. - break;
  16420. -@@ -5621,6 +5724,12 @@ static int rt2800_validate_eeprom(struct
  16421. - rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820);
  16422. - rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
  16423. - rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
  16424. -+ } else if (rt2x00_rt(rt2x00dev, RT5350)) {
  16425. -+ rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 1);
  16426. -+ rt2x00_set_field16(&word, EEPROM_NIC_CONF0_TXPATH, 1);
  16427. -+ rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF3320);
  16428. -+ rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
  16429. -+ rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
  16430. - } else if (rt2x00_rt(rt2x00dev, RT2860) ||
  16431. - rt2x00_rt(rt2x00dev, RT2872)) {
  16432. - /*
  16433. -@@ -5749,6 +5858,8 @@ static int rt2800_init_eeprom(struct rt2
  16434. - rt2x00_rt(rt2x00dev, RT5390) ||
  16435. - rt2x00_rt(rt2x00dev, RT5392))
  16436. - rt2x00_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  16437. -+ else if (rt2x00_rt(rt2x00dev, RT5350))
  16438. -+ rf = RF5350;
  16439. - else
  16440. - rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
  16441. -
  16442. -@@ -5765,6 +5876,7 @@ static int rt2800_init_eeprom(struct rt2
  16443. - case RF3290:
  16444. - case RF3320:
  16445. - case RF3322:
  16446. -+ case RF5350:
  16447. - case RF5360:
  16448. - case RF5370:
  16449. - case RF5372:
  16450. -@@ -6263,7 +6375,8 @@ static int rt2800_probe_hw_mode(struct r
  16451. - rt2x00_rf(rt2x00dev, RF5392)) {
  16452. - spec->num_channels = 14;
  16453. - spec->channels = rf_vals_3x;
  16454. -- } else if (rt2x00_rf(rt2x00dev, RF3322)) {
  16455. -+ } else if (rt2x00_rf(rt2x00dev, RF3322) ||
  16456. -+ rt2x00_rf(rt2x00dev, RF5350)) {
  16457. - spec->num_channels = 14;
  16458. - if (spec->clk_is_20mhz)
  16459. - spec->channels = rf_vals_xtal20mhz_3x;
  16460. -@@ -6364,6 +6477,7 @@ static int rt2800_probe_hw_mode(struct r
  16461. - case RF3320:
  16462. - case RF3052:
  16463. - case RF3290:
  16464. -+ case RF5350:
  16465. - case RF5360:
  16466. - case RF5370:
  16467. - case RF5372:
  16468. -@@ -6401,6 +6515,7 @@ static int rt2800_probe_rt(struct rt2x00
  16469. - case RT3352:
  16470. - case RT3390:
  16471. - case RT3572:
  16472. -+ case RT5350:
  16473. - case RT5390:
  16474. - case RT5392:
  16475. - case RT5592:
  16476. ---- a/drivers/net/wireless/rt2x00/rt2x00.h
  16477. -+++ b/drivers/net/wireless/rt2x00/rt2x00.h
  16478. -@@ -181,6 +181,7 @@ struct rt2x00_chip {
  16479. - #define RT3572 0x3572
  16480. - #define RT3593 0x3593
  16481. - #define RT3883 0x3883 /* WSOC */
  16482. -+#define RT5350 0x5350 /* WSOC 2.4GHz */
  16483. - #define RT5390 0x5390 /* 2.4GHz */
  16484. - #define RT5392 0x5392 /* 2.4GHz */
  16485. - #define RT5592 0x5592
  16486. diff --git a/package/mac80211/patches/617-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/mac80211/patches/617-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch
  16487. deleted file mode 100644
  16488. index d5af4c9..0000000
  16489. --- a/package/mac80211/patches/617-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch
  16490. +++ /dev/null
  16491. @@ -1,102 +0,0 @@
  16492. -From 339fe73f340161a624cc08e738d2244814852c3e Mon Sep 17 00:00:00 2001
  16493. -From: John Crispin <blogic@openwrt.org>
  16494. -Date: Sun, 17 Mar 2013 00:55:04 +0100
  16495. -Subject: [PATCH] rt2x00: load eeprom on SoC from a mtd device defines inside
  16496. - OF
  16497. -
  16498. -Signed-off-by: John Crispin <blogic@openwrt.org>
  16499. ----
  16500. - drivers/net/wireless/rt2x00/Kconfig | 1 +
  16501. - drivers/net/wireless/rt2x00/rt2800pci.c | 44 ++++++++++++++++++++++++++-----
  16502. - 2 files changed, 39 insertions(+), 6 deletions(-)
  16503. -
  16504. ---- a/drivers/net/wireless/rt2x00/Kconfig
  16505. -+++ b/drivers/net/wireless/rt2x00/Kconfig
  16506. -@@ -71,6 +71,7 @@ config RT2800PCI
  16507. - select RT2X00_LIB_FIRMWARE
  16508. - select RT2X00_LIB_EEPROM
  16509. - select RT2X00_LIB_CRYPTO
  16510. -+ select MTD if SOC_RT288X || SOC_RT305X
  16511. - depends on CRC_CCITT
  16512. - depends on EEPROM_93CX6
  16513. - ---help---
  16514. ---- a/drivers/net/wireless/rt2x00/rt2x00eeprom.c
  16515. -+++ b/drivers/net/wireless/rt2x00/rt2x00eeprom.c
  16516. -@@ -30,12 +30,77 @@
  16517. - #include "rt2x00.h"
  16518. - #include "rt2x00lib.h"
  16519. -
  16520. -+#ifdef CONFIG_OF
  16521. -+#include <linux/of.h>
  16522. -+#include <linux/mtd/mtd.h>
  16523. -+#include <linux/mtd/partitions.h>
  16524. -+
  16525. -+static struct firmware mtd_fw;
  16526. -+
  16527. -+static int rt2800pci_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
  16528. -+{
  16529. -+ struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL;
  16530. -+ size_t retlen, len = rt2x00dev->ops->eeprom_size;
  16531. -+ int ret, size, offset = 0;
  16532. -+ struct mtd_info *mtd;
  16533. -+ const char *part;
  16534. -+ const __be32 *list;
  16535. -+ phandle phandle;
  16536. -+
  16537. -+ list = of_get_property(np, "ralink,mtd-eeprom", &size);
  16538. -+ if (!list) {
  16539. -+ dev_err(rt2x00dev->dev, "failed to load eeprom property\n");
  16540. -+ return -ENOENT;
  16541. -+ }
  16542. -+
  16543. -+ phandle = be32_to_cpup(list++);
  16544. -+ if (phandle)
  16545. -+ mtd_np = of_find_node_by_phandle(phandle);
  16546. -+ if (!mtd_np) {
  16547. -+ dev_err(rt2x00dev->dev, "failed to load mtd phandle\n");
  16548. -+ return -EINVAL;
  16549. -+ }
  16550. -+
  16551. -+ part = of_get_property(mtd_np, "label", NULL);
  16552. -+ if (!part)
  16553. -+ part = mtd_np->name;
  16554. -+
  16555. -+ mtd = get_mtd_device_nm(part);
  16556. -+ if (IS_ERR(mtd)) {
  16557. -+ dev_err(rt2x00dev->dev, "failed to get mtd device \"%s\"\n", part);
  16558. -+ return PTR_ERR(mtd);
  16559. -+ }
  16560. -+
  16561. -+ if (size > sizeof(*list))
  16562. -+ offset = be32_to_cpup(list);
  16563. -+
  16564. -+ ret = mtd_read(mtd, offset, len, &retlen, (u_char *) rt2x00dev->eeprom);
  16565. -+ put_mtd_device(mtd);
  16566. -+
  16567. -+ if (!ret) {
  16568. -+ rt2x00dev->eeprom_file = &mtd_fw;
  16569. -+ mtd_fw.size = len;
  16570. -+ mtd_fw.data = rt2x00dev->eeprom;
  16571. -+ }
  16572. -+
  16573. -+ return ret;
  16574. -+}
  16575. -+#else
  16576. -+static inline int rt2800pci_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
  16577. -+{
  16578. -+ return -EINVAL;
  16579. -+}
  16580. -+#endif
  16581. -+
  16582. - static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
  16583. - {
  16584. - const struct firmware *ee;
  16585. - char *ee_name;
  16586. - int retval;
  16587. -
  16588. -+ if (!rt2800pci_read_eeprom_mtd(rt2x00dev))
  16589. -+ return 0;
  16590. -+
  16591. - ee_name = rt2x00dev->ops->lib->get_eeprom_file_name(rt2x00dev);
  16592. - if (!ee_name) {
  16593. - rt2x00_err(rt2x00dev,
  16594. diff --git a/package/mac80211/patches/618-rt2x00-msi-fix.patch b/package/mac80211/patches/618-rt2x00-msi-fix.patch
  16595. deleted file mode 100644
  16596. index ceddbe4..0000000
  16597. --- a/package/mac80211/patches/618-rt2x00-msi-fix.patch
  16598. +++ /dev/null
  16599. @@ -1,32 +0,0 @@
  16600. ---- a/drivers/net/wireless/rt2x00/rt2x00pci.c
  16601. -+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
  16602. -@@ -108,7 +108,9 @@ int rt2x00pci_probe(struct pci_dev *pci_
  16603. - goto exit_release_regions;
  16604. - }
  16605. -
  16606. -+#ifdef CONFIG_PCI_MSI
  16607. - pci_enable_msi(pci_dev);
  16608. -+#endif
  16609. -
  16610. - hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
  16611. - if (!hw) {
  16612. -@@ -162,7 +164,9 @@ exit_free_device:
  16613. - ieee80211_free_hw(hw);
  16614. -
  16615. - exit_disable_msi:
  16616. -+#ifdef CONFIG_PCI_SET_MWI
  16617. - pci_disable_msi(pci_dev);
  16618. -+#endif
  16619. -
  16620. - exit_release_regions:
  16621. - pci_release_regions(pci_dev);
  16622. -@@ -188,7 +192,9 @@ void rt2x00pci_remove(struct pci_dev *pc
  16623. - rt2x00pci_free_reg(rt2x00dev);
  16624. - ieee80211_free_hw(hw);
  16625. -
  16626. -+#ifdef CONFIG_PCI_MSI
  16627. - pci_disable_msi(pci_dev);
  16628. -+#endif
  16629. -
  16630. - /*
  16631. - * Free the PCI device data.
  16632. diff --git a/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch b/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch
  16633. deleted file mode 100644
  16634. index ef6b1af..0000000
  16635. --- a/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch
  16636. +++ /dev/null
  16637. @@ -1,15 +0,0 @@
  16638. ---- a/drivers/net/wireless/rt2x00/rt2800lib.c
  16639. -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  16640. -@@ -5854,10 +5854,11 @@ static int rt2800_init_eeprom(struct rt2
  16641. - * RT53xx: defined in "EEPROM_CHIP_ID" field
  16642. - */
  16643. - if (rt2x00_rt(rt2x00dev, RT3290) ||
  16644. -- rt2x00_rt(rt2x00dev, RT3352) ||
  16645. - rt2x00_rt(rt2x00dev, RT5390) ||
  16646. - rt2x00_rt(rt2x00dev, RT5392))
  16647. - rt2x00_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  16648. -+ else if (rt2x00_rt(rt2x00dev, RT3352))
  16649. -+ rf = RF3322;
  16650. - else if (rt2x00_rt(rt2x00dev, RT5350))
  16651. - rf = RF5350;
  16652. - else
  16653. 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
  16654. deleted file mode 100644
  16655. index 3381ba5..0000000
  16656. --- a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
  16657. +++ /dev/null
  16658. @@ -1,10 +0,0 @@
  16659. ---- a/drivers/net/wireless/mwl8k.c
  16660. -+++ b/drivers/net/wireless/mwl8k.c
  16661. -@@ -5530,6 +5530,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  16662. - MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  16663. -
  16664. - static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
  16665. -+ { PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
  16666. - { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
  16667. - { PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, },
  16668. - { PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, },
  16669. diff --git a/package/mac80211/patches/750-rtlwifi-Align-private-space-in-rtl_priv-struct.patch b/package/mac80211/patches/750-rtlwifi-Align-private-space-in-rtl_priv-struct.patch
  16670. deleted file mode 100644
  16671. index 050defa..0000000
  16672. --- a/package/mac80211/patches/750-rtlwifi-Align-private-space-in-rtl_priv-struct.patch
  16673. +++ /dev/null
  16674. @@ -1,27 +0,0 @@
  16675. -From 60ce314d1750fef843e9db70050e09e49f838b69 Mon Sep 17 00:00:00 2001
  16676. -From: Larry Finger <Larry.Finger@lwfinger.net>
  16677. -Date: Thu, 19 Sep 2013 02:21:35 +0000
  16678. -Subject: rtlwifi: Align private space in rtl_priv struct
  16679. -
  16680. -The private array at the end of the rtl_priv struct is not aligned.
  16681. -On ARM architecture, this causes an alignment trap and is fixed by aligning
  16682. -that array with __align(sizeof(void *)). That should properly align that
  16683. -space according to the requirements of all architectures.
  16684. -
  16685. -Reported-by: Jason Andrews <jasona@cadence.com>
  16686. -Tested-by: Jason Andrews <jasona@cadence.com>
  16687. -Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
  16688. -Cc: Stable <stable@vger.kernel.org>
  16689. -Signed-off-by: John W. Linville <linville@tuxdriver.com>
  16690. ----
  16691. ---- a/drivers/net/wireless/rtlwifi/wifi.h
  16692. -+++ b/drivers/net/wireless/rtlwifi/wifi.h
  16693. -@@ -2057,7 +2057,7 @@ struct rtl_priv {
  16694. - that it points to the data allocated
  16695. - beyond this structure like:
  16696. - rtl_pci_priv or rtl_usb_priv */
  16697. -- u8 priv[0];
  16698. -+ u8 priv[0] __aligned(sizeof(void *));
  16699. - };
  16700. -
  16701. - #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv))
  16702. diff --git a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch b/package/mac80211/patches/800-b43-gpio-mask-module-option.patch
  16703. deleted file mode 100644
  16704. index 46de746..0000000
  16705. --- a/package/mac80211/patches/800-b43-gpio-mask-module-option.patch
  16706. +++ /dev/null
  16707. @@ -1,37 +0,0 @@
  16708. ---- a/drivers/net/wireless/b43/b43.h
  16709. -+++ b/drivers/net/wireless/b43/b43.h
  16710. -@@ -820,6 +820,7 @@ struct b43_wldev {
  16711. - bool qos_enabled; /* TRUE, if QoS is used. */
  16712. - bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */
  16713. - bool use_pio; /* TRUE if next init should use PIO */
  16714. -+ int gpiomask; /* GPIO LED mask as a module parameter */
  16715. -
  16716. - /* PHY/Radio device. */
  16717. - struct b43_phy phy;
  16718. ---- a/drivers/net/wireless/b43/main.c
  16719. -+++ b/drivers/net/wireless/b43/main.c
  16720. -@@ -76,6 +76,11 @@ MODULE_FIRMWARE("b43/ucode16_mimo.fw");
  16721. - MODULE_FIRMWARE("b43/ucode5.fw");
  16722. - MODULE_FIRMWARE("b43/ucode9.fw");
  16723. -
  16724. -+static int modparam_gpiomask = 0x000F;
  16725. -+module_param_named(gpiomask, modparam_gpiomask, int, 0444);
  16726. -+MODULE_PARM_DESC(gpiomask,
  16727. -+ "GPIO mask for LED control (default 0x000F)");
  16728. -+
  16729. - static int modparam_bad_frames_preempt;
  16730. - module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
  16731. - MODULE_PARM_DESC(bad_frames_preempt,
  16732. -@@ -2742,10 +2747,10 @@ static int b43_gpio_init(struct b43_wlde
  16733. - u32 mask, set;
  16734. -
  16735. - b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_GPOUTSMSK, 0);
  16736. -- b43_maskset16(dev, B43_MMIO_GPIO_MASK, ~0, 0xF);
  16737. -+ b43_maskset16(dev, B43_MMIO_GPIO_MASK, ~0, modparam_gpiomask);
  16738. -
  16739. - mask = 0x0000001F;
  16740. -- set = 0x0000000F;
  16741. -+ set = modparam_gpiomask;
  16742. - if (dev->dev->chip_id == 0x4301) {
  16743. - mask |= 0x0060;
  16744. - set |= 0x0060;
  16745. diff --git a/package/mac80211/patches/810-b43_no_pio.patch b/package/mac80211/patches/810-b43_no_pio.patch
  16746. deleted file mode 100644
  16747. index 1206923..0000000
  16748. --- a/package/mac80211/patches/810-b43_no_pio.patch
  16749. +++ /dev/null
  16750. @@ -1,86 +0,0 @@
  16751. ---- a/drivers/net/wireless/b43/Makefile
  16752. -+++ b/drivers/net/wireless/b43/Makefile
  16753. -@@ -20,7 +20,7 @@ b43-y += xmit.o
  16754. - b43-y += lo.o
  16755. - b43-y += wa.o
  16756. - b43-y += dma.o
  16757. --b43-y += pio.o
  16758. -+b43-$(CONFIG_B43_PIO) += pio.o
  16759. - b43-y += rfkill.o
  16760. - b43-$(CPTCFG_B43_LEDS) += leds.o
  16761. - b43-$(CPTCFG_B43_PCMCIA) += pcmcia.o
  16762. ---- a/drivers/net/wireless/b43/main.c
  16763. -+++ b/drivers/net/wireless/b43/main.c
  16764. -@@ -1915,10 +1915,12 @@ static void b43_do_interrupt_thread(stru
  16765. - dma_reason[0], dma_reason[1],
  16766. - dma_reason[2], dma_reason[3],
  16767. - dma_reason[4], dma_reason[5]);
  16768. -+#ifdef CONFIG_B43_PIO
  16769. - b43err(dev->wl, "This device does not support DMA "
  16770. - "on your system. It will now be switched to PIO.\n");
  16771. - /* Fall back to PIO transfers if we get fatal DMA errors! */
  16772. - dev->use_pio = true;
  16773. -+#endif
  16774. - b43_controller_restart(dev, "DMA error");
  16775. - return;
  16776. - }
  16777. ---- a/drivers/net/wireless/b43/pio.h
  16778. -+++ b/drivers/net/wireless/b43/pio.h
  16779. -@@ -150,7 +150,7 @@ static inline void b43_piorx_write32(str
  16780. - b43_write32(q->dev, q->mmio_base + offset, value);
  16781. - }
  16782. -
  16783. --
  16784. -+#ifdef CONFIG_B43_PIO
  16785. - int b43_pio_init(struct b43_wldev *dev);
  16786. - void b43_pio_free(struct b43_wldev *dev);
  16787. -
  16788. -@@ -161,5 +161,37 @@ void b43_pio_rx(struct b43_pio_rxqueue *
  16789. -
  16790. - void b43_pio_tx_suspend(struct b43_wldev *dev);
  16791. - void b43_pio_tx_resume(struct b43_wldev *dev);
  16792. -+#else
  16793. -+static inline int b43_pio_init(struct b43_wldev *dev)
  16794. -+{
  16795. -+ return 0;
  16796. -+}
  16797. -+
  16798. -+static inline void b43_pio_free(struct b43_wldev *dev)
  16799. -+{
  16800. -+}
  16801. -+
  16802. -+static inline int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
  16803. -+{
  16804. -+ return 0;
  16805. -+}
  16806. -+
  16807. -+static inline void b43_pio_handle_txstatus(struct b43_wldev *dev,
  16808. -+ const struct b43_txstatus *status)
  16809. -+{
  16810. -+}
  16811. -+
  16812. -+static inline void b43_pio_rx(struct b43_pio_rxqueue *q)
  16813. -+{
  16814. -+}
  16815. -+
  16816. -+static inline void b43_pio_tx_suspend(struct b43_wldev *dev)
  16817. -+{
  16818. -+}
  16819. -+
  16820. -+static inline void b43_pio_tx_resume(struct b43_wldev *dev)
  16821. -+{
  16822. -+}
  16823. -+#endif /* CONFIG_B43_PIO */
  16824. -
  16825. - #endif /* B43_PIO_H_ */
  16826. ---- a/drivers/net/wireless/b43/Kconfig
  16827. -+++ b/drivers/net/wireless/b43/Kconfig
  16828. -@@ -98,7 +98,7 @@ config B43_BCMA_PIO
  16829. - default y
  16830. -
  16831. - config B43_PIO
  16832. -- bool
  16833. -+ bool "Broadcom 43xx PIO support"
  16834. - depends on B43
  16835. - select SSB_BLOCKIO
  16836. - default y
  16837. diff --git a/package/mac80211/patches/820-b43-add-antenna-control.patch b/package/mac80211/patches/820-b43-add-antenna-control.patch
  16838. deleted file mode 100644
  16839. index 56aef89..0000000
  16840. --- a/package/mac80211/patches/820-b43-add-antenna-control.patch
  16841. +++ /dev/null
  16842. @@ -1,131 +0,0 @@
  16843. ---- a/drivers/net/wireless/b43/main.c
  16844. -+++ b/drivers/net/wireless/b43/main.c
  16845. -@@ -1562,7 +1562,7 @@ static void b43_write_beacon_template(st
  16846. - len, ram_offset, shm_size_offset, rate);
  16847. -
  16848. - /* Write the PHY TX control parameters. */
  16849. -- antenna = B43_ANTENNA_DEFAULT;
  16850. -+ antenna = dev->tx_antenna;
  16851. - antenna = b43_antenna_to_phyctl(antenna);
  16852. - ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL);
  16853. - /* We can't send beacons with short preamble. Would get PHY errors. */
  16854. -@@ -3100,8 +3100,8 @@ static int b43_chip_init(struct b43_wlde
  16855. -
  16856. - /* Select the antennae */
  16857. - if (phy->ops->set_rx_antenna)
  16858. -- phy->ops->set_rx_antenna(dev, B43_ANTENNA_DEFAULT);
  16859. -- b43_mgmtframe_txantenna(dev, B43_ANTENNA_DEFAULT);
  16860. -+ phy->ops->set_rx_antenna(dev, dev->rx_antenna);
  16861. -+ b43_mgmtframe_txantenna(dev, dev->tx_antenna);
  16862. -
  16863. - if (phy->type == B43_PHYTYPE_B) {
  16864. - value16 = b43_read16(dev, 0x005E);
  16865. -@@ -3845,7 +3845,6 @@ static int b43_op_config(struct ieee8021
  16866. - struct b43_wldev *dev;
  16867. - struct b43_phy *phy;
  16868. - struct ieee80211_conf *conf = &hw->conf;
  16869. -- int antenna;
  16870. - int err = 0;
  16871. - bool reload_bss = false;
  16872. -
  16873. -@@ -3899,11 +3898,9 @@ static int b43_op_config(struct ieee8021
  16874. - }
  16875. -
  16876. - /* Antennas for RX and management frame TX. */
  16877. -- antenna = B43_ANTENNA_DEFAULT;
  16878. -- b43_mgmtframe_txantenna(dev, antenna);
  16879. -- antenna = B43_ANTENNA_DEFAULT;
  16880. -+ b43_mgmtframe_txantenna(dev, dev->tx_antenna);
  16881. - if (phy->ops->set_rx_antenna)
  16882. -- phy->ops->set_rx_antenna(dev, antenna);
  16883. -+ phy->ops->set_rx_antenna(dev, dev->rx_antenna);
  16884. -
  16885. - if (wl->radio_enabled != phy->radio_on) {
  16886. - if (wl->radio_enabled) {
  16887. -@@ -5028,6 +5025,47 @@ static int b43_op_get_survey(struct ieee
  16888. - return 0;
  16889. - }
  16890. -
  16891. -+static int b43_op_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
  16892. -+{
  16893. -+ struct b43_wl *wl = hw_to_b43_wl(hw);
  16894. -+ struct b43_wldev *dev = wl->current_dev;
  16895. -+
  16896. -+ if (tx_ant == 1 && rx_ant == 1) {
  16897. -+ dev->tx_antenna = B43_ANTENNA0;
  16898. -+ dev->rx_antenna = B43_ANTENNA0;
  16899. -+ }
  16900. -+ else if (tx_ant == 2 && rx_ant == 2) {
  16901. -+ dev->tx_antenna = B43_ANTENNA1;
  16902. -+ dev->rx_antenna = B43_ANTENNA1;
  16903. -+ }
  16904. -+ else if ((tx_ant & 3) == 3 && (rx_ant & 3) == 3) {
  16905. -+ dev->tx_antenna = B43_ANTENNA_DEFAULT;
  16906. -+ dev->rx_antenna = B43_ANTENNA_DEFAULT;
  16907. -+ }
  16908. -+ else {
  16909. -+ return -EINVAL;
  16910. -+ }
  16911. -+
  16912. -+ return 0;
  16913. -+}
  16914. -+
  16915. -+
  16916. -+static int b43_op_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant)
  16917. -+{
  16918. -+ struct b43_wl *wl = hw_to_b43_wl(hw);
  16919. -+ struct b43_wldev *dev = wl->current_dev;
  16920. -+
  16921. -+ switch (dev->tx_antenna) {
  16922. -+ case B43_ANTENNA0:
  16923. -+ *tx_ant = 1; *rx_ant = 1; break;
  16924. -+ case B43_ANTENNA1:
  16925. -+ *tx_ant = 2; *rx_ant = 2; break;
  16926. -+ case B43_ANTENNA_DEFAULT:
  16927. -+ *tx_ant = 3; *rx_ant = 3; break;
  16928. -+ }
  16929. -+ return 0;
  16930. -+}
  16931. -+
  16932. - static const struct ieee80211_ops b43_hw_ops = {
  16933. - .tx = b43_op_tx,
  16934. - .conf_tx = b43_op_conf_tx,
  16935. -@@ -5049,6 +5087,8 @@ static const struct ieee80211_ops b43_hw
  16936. - .sw_scan_complete = b43_op_sw_scan_complete_notifier,
  16937. - .get_survey = b43_op_get_survey,
  16938. - .rfkill_poll = b43_rfkill_poll,
  16939. -+ .set_antenna = b43_op_set_antenna,
  16940. -+ .get_antenna = b43_op_get_antenna,
  16941. - };
  16942. -
  16943. - /* Hard-reset the chip. Do not call this directly.
  16944. -@@ -5295,6 +5335,8 @@ static int b43_one_core_attach(struct b4
  16945. - if (!wldev)
  16946. - goto out;
  16947. -
  16948. -+ wldev->rx_antenna = B43_ANTENNA_DEFAULT;
  16949. -+ wldev->tx_antenna = B43_ANTENNA_DEFAULT;
  16950. - wldev->use_pio = b43_modparam_pio;
  16951. - wldev->dev = dev;
  16952. - wldev->wl = wl;
  16953. -@@ -5385,6 +5427,9 @@ static struct b43_wl *b43_wireless_init(
  16954. -
  16955. - hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
  16956. -
  16957. -+ hw->wiphy->available_antennas_rx = 0x3;
  16958. -+ hw->wiphy->available_antennas_tx = 0x3;
  16959. -+
  16960. - wl->hw_registred = false;
  16961. - hw->max_rates = 2;
  16962. - SET_IEEE80211_DEV(hw, dev->dev);
  16963. ---- a/drivers/net/wireless/b43/b43.h
  16964. -+++ b/drivers/net/wireless/b43/b43.h
  16965. -@@ -821,6 +821,8 @@ struct b43_wldev {
  16966. - bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */
  16967. - bool use_pio; /* TRUE if next init should use PIO */
  16968. - int gpiomask; /* GPIO LED mask as a module parameter */
  16969. -+ int rx_antenna; /* Used RX antenna (B43_ANTENNAxxx) */
  16970. -+ int tx_antenna; /* Used TX antenna (B43_ANTENNAxxx) */
  16971. -
  16972. - /* PHY/Radio device. */
  16973. - struct b43_phy phy;
  16974. diff --git a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch b/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
  16975. deleted file mode 100644
  16976. index e55d4fe..0000000
  16977. --- a/package/mac80211/patches/830-b43-workaround-pcie-bcm4716.patch
  16978. +++ /dev/null
  16979. @@ -1,134 +0,0 @@
  16980. -From 4f214b1ead0af7439921637645cb63f378516175 Mon Sep 17 00:00:00 2001
  16981. -From: Hauke Mehrtens <hauke@hauke-m.de>
  16982. -Date: Sat, 21 Jan 2012 18:48:38 +0100
  16983. -Subject: [PATCH 33/34] b43: add workaround for b43 on pcie bus of bcm4716.
  16984. -
  16985. -bcm4716 (which includes 4717 & 4718), plus 4706 on PCIe can reorder
  16986. -transactions. As a fix, a read after write is performed on certain
  16987. -places in the code. Older chips and the newer 5357 family don't require
  16988. -this fix.
  16989. -This code is based on the brcmsmac driver.
  16990. -
  16991. -Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  16992. ----
  16993. - drivers/net/wireless/b43/b43.h | 26 ++++++++++++++++++++++++++
  16994. - drivers/net/wireless/b43/bus.h | 10 ++++++++++
  16995. - drivers/net/wireless/b43/phy_common.c | 6 ++++++
  16996. - drivers/net/wireless/b43/phy_n.c | 10 +++++-----
  16997. - 4 files changed, 47 insertions(+), 5 deletions(-)
  16998. -
  16999. ---- a/drivers/net/wireless/b43/b43.h
  17000. -+++ b/drivers/net/wireless/b43/b43.h
  17001. -@@ -1061,6 +1061,32 @@ static inline bool b43_using_pio_transfe
  17002. - return dev->__using_pio_transfers;
  17003. - }
  17004. -
  17005. -+/*
  17006. -+ * bcm4716 (which includes 4717 & 4718), plus 4706 on PCIe can reorder
  17007. -+ * transactions. As a fix, a read after write is performed on certain places
  17008. -+ * in the code. Older chips and the newer 5357 family don't require this fix.
  17009. -+ */
  17010. -+#ifdef CONFIG_BCM47XX_BCMA
  17011. -+#include <asm/mach-bcm47xx/bcm47xx.h>
  17012. -+static inline void b43_wflush16(struct b43_wldev *dev, u16 offset, u16 value)
  17013. -+{
  17014. -+ if (b43_bus_host_is_pci(dev->dev) &&
  17015. -+ bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA &&
  17016. -+ (bcm47xx_bus.bcma.bus.chipinfo.id == 0x4716 ||
  17017. -+ bcm47xx_bus.bcma.bus.chipinfo.id == 0x5300)) {
  17018. -+ b43_write16(dev, offset, value);
  17019. -+ b43_read16(dev, offset);
  17020. -+ } else {
  17021. -+ b43_write16(dev, offset, value);
  17022. -+ }
  17023. -+}
  17024. -+#else
  17025. -+static inline void b43_wflush16(struct b43_wldev *dev, u16 offset, u16 value)
  17026. -+{
  17027. -+ b43_write16(dev, offset, value);
  17028. -+}
  17029. -+#endif
  17030. -+
  17031. - /* Message printing */
  17032. - __printf(2, 3) void b43info(struct b43_wl *wl, const char *fmt, ...);
  17033. - __printf(2, 3) void b43err(struct b43_wl *wl, const char *fmt, ...);
  17034. ---- a/drivers/net/wireless/b43/bus.h
  17035. -+++ b/drivers/net/wireless/b43/bus.h
  17036. -@@ -60,6 +60,16 @@ static inline bool b43_bus_host_is_sdio(
  17037. - return (dev->bus_type == B43_BUS_SSB &&
  17038. - dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO);
  17039. - }
  17040. -+static inline bool b43_bus_host_is_pci(struct b43_bus_dev *dev)
  17041. -+{
  17042. -+ if (dev->bus_type == B43_BUS_SSB)
  17043. -+ return (dev->sdev->bus->bustype == SSB_BUSTYPE_PCI);
  17044. -+#ifdef CONFIG_B43_BCMA
  17045. -+ if (dev->bus_type == B43_BUS_BCMA)
  17046. -+ return (dev->bdev->bus->hosttype == BCMA_HOSTTYPE_PCI);
  17047. -+#endif
  17048. -+ return false;
  17049. -+}
  17050. -
  17051. - struct b43_bus_dev *b43_bus_dev_bcma_init(struct bcma_device *core);
  17052. - struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev);
  17053. ---- a/drivers/net/wireless/b43/phy_common.c
  17054. -+++ b/drivers/net/wireless/b43/phy_common.c
  17055. -@@ -266,6 +266,12 @@ void b43_phy_write(struct b43_wldev *dev
  17056. - {
  17057. - assert_mac_suspended(dev);
  17058. - dev->phy.ops->phy_write(dev, reg, value);
  17059. -+#ifdef CONFIG_BCM47XX
  17060. -+ if (b43_bus_host_is_pci(dev->dev) && reg == 0x72) {
  17061. -+ b43_read16(dev, B43_MMIO_PHY_VER);
  17062. -+ return;
  17063. -+ }
  17064. -+#endif
  17065. - if (++dev->phy.writes_counter == B43_MAX_WRITES_IN_ROW) {
  17066. - b43_read16(dev, B43_MMIO_PHY_VER);
  17067. - dev->phy.writes_counter = 0;
  17068. ---- a/drivers/net/wireless/b43/phy_n.c
  17069. -+++ b/drivers/net/wireless/b43/phy_n.c
  17070. -@@ -5417,14 +5417,14 @@ static inline void check_phyreg(struct b
  17071. - static u16 b43_nphy_op_read(struct b43_wldev *dev, u16 reg)
  17072. - {
  17073. - check_phyreg(dev, reg);
  17074. -- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
  17075. -+ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
  17076. - return b43_read16(dev, B43_MMIO_PHY_DATA);
  17077. - }
  17078. -
  17079. - static void b43_nphy_op_write(struct b43_wldev *dev, u16 reg, u16 value)
  17080. - {
  17081. - check_phyreg(dev, reg);
  17082. -- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
  17083. -+ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
  17084. - b43_write16(dev, B43_MMIO_PHY_DATA, value);
  17085. - }
  17086. -
  17087. -@@ -5432,7 +5432,7 @@ static void b43_nphy_op_maskset(struct b
  17088. - u16 set)
  17089. - {
  17090. - check_phyreg(dev, reg);
  17091. -- b43_write16(dev, B43_MMIO_PHY_CONTROL, reg);
  17092. -+ b43_wflush16(dev, B43_MMIO_PHY_CONTROL, reg);
  17093. - b43_maskset16(dev, B43_MMIO_PHY_DATA, mask, set);
  17094. - }
  17095. -
  17096. -@@ -5443,7 +5443,7 @@ static u16 b43_nphy_op_radio_read(struct
  17097. - /* N-PHY needs 0x100 for read access */
  17098. - reg |= 0x100;
  17099. -
  17100. -- b43_write16(dev, B43_MMIO_RADIO_CONTROL, reg);
  17101. -+ b43_wflush16(dev, B43_MMIO_RADIO_CONTROL, reg);
  17102. - return b43_read16(dev, B43_MMIO_RADIO_DATA_LOW);
  17103. - }
  17104. -
  17105. -@@ -5452,7 +5452,7 @@ static void b43_nphy_op_radio_write(stru
  17106. - /* Register 1 is a 32-bit register. */
  17107. - B43_WARN_ON(reg == 1);
  17108. -
  17109. -- b43_write16(dev, B43_MMIO_RADIO_CONTROL, reg);
  17110. -+ b43_wflush16(dev, B43_MMIO_RADIO_CONTROL, reg);
  17111. - b43_write16(dev, B43_MMIO_RADIO_DATA_LOW, value);
  17112. - }
  17113. -
  17114. diff --git a/package/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch b/package/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch
  17115. deleted file mode 100644
  17116. index 9c51ac6..0000000
  17117. --- a/package/mac80211/patches/841-b43-reduce-number-of-RX-slots.patch
  17118. +++ /dev/null
  17119. @@ -1,11 +0,0 @@
  17120. ---- a/drivers/net/wireless/b43/dma.h
  17121. -+++ b/drivers/net/wireless/b43/dma.h
  17122. -@@ -169,7 +169,7 @@ struct b43_dmadesc_generic {
  17123. -
  17124. - /* DMA engine tuning knobs */
  17125. - #define B43_TXRING_SLOTS 256
  17126. --#define B43_RXRING_SLOTS 256
  17127. -+#define B43_RXRING_SLOTS 32
  17128. - #define B43_DMA0_RX_FW598_BUFSIZE (B43_DMA0_RX_FW598_FO + IEEE80211_MAX_FRAME_LEN)
  17129. - #define B43_DMA0_RX_FW351_BUFSIZE (B43_DMA0_RX_FW351_FO + IEEE80211_MAX_FRAME_LEN)
  17130. -
  17131. diff --git a/package/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch b/package/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch
  17132. deleted file mode 100644
  17133. index a1eafa4..0000000
  17134. --- a/package/mac80211/patches/845-b43-only-use-gpio-0-1-for-led.patch
  17135. +++ /dev/null
  17136. @@ -1,17 +0,0 @@
  17137. ---- a/drivers/net/wireless/b43/main.c
  17138. -+++ b/drivers/net/wireless/b43/main.c
  17139. -@@ -2759,6 +2759,14 @@ static int b43_gpio_init(struct b43_wlde
  17140. - } else if (dev->dev->chip_id == 0x5354) {
  17141. - /* Don't allow overtaking buttons GPIOs */
  17142. - set &= 0x2; /* 0x2 is LED GPIO on BCM5354 */
  17143. -+ } else if (dev->dev->chip_id == BCMA_CHIP_ID_BCM4716 ||
  17144. -+ dev->dev->chip_id == BCMA_CHIP_ID_BCM47162 ||
  17145. -+ dev->dev->chip_id == BCMA_CHIP_ID_BCM5356 ||
  17146. -+ dev->dev->chip_id == BCMA_CHIP_ID_BCM5357 ||
  17147. -+ dev->dev->chip_id == BCMA_CHIP_ID_BCM53572) {
  17148. -+ /* just use gpio 0 and 1 for 2.4 GHz wifi led */
  17149. -+ set &= 0x3;
  17150. -+ mask &= 0x3;
  17151. - }
  17152. -
  17153. - if (0 /* FIXME: conditional unknown */ ) {
  17154. diff --git a/package/mac80211/patches/847-b43-always-take-overlapping-devs.patch b/package/mac80211/patches/847-b43-always-take-overlapping-devs.patch
  17155. deleted file mode 100644
  17156. index 9d1d419..0000000
  17157. --- a/package/mac80211/patches/847-b43-always-take-overlapping-devs.patch
  17158. +++ /dev/null
  17159. @@ -1,11 +0,0 @@
  17160. ---- a/drivers/net/wireless/b43/main.c
  17161. -+++ b/drivers/net/wireless/b43/main.c
  17162. -@@ -118,7 +118,7 @@ static int b43_modparam_pio = 0;
  17163. - module_param_named(pio, b43_modparam_pio, int, 0644);
  17164. - MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO");
  17165. -
  17166. --static int modparam_allhwsupport = !IS_ENABLED(CPTCFG_BRCMSMAC);
  17167. -+static int modparam_allhwsupport = 1;
  17168. - module_param_named(allhwsupport, modparam_allhwsupport, int, 0444);
  17169. - MODULE_PARM_DESC(allhwsupport, "Enable support for all hardware (even it if overlaps with the brcmsmac driver)");
  17170. -
  17171. diff --git a/package/mac80211/patches/851-brcmsmac-remove-extra-regulation-restriction.patch b/package/mac80211/patches/851-brcmsmac-remove-extra-regulation-restriction.patch
  17172. deleted file mode 100644
  17173. index dd1393a..0000000
  17174. --- a/package/mac80211/patches/851-brcmsmac-remove-extra-regulation-restriction.patch
  17175. +++ /dev/null
  17176. @@ -1,31 +0,0 @@
  17177. ---- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
  17178. -+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
  17179. -@@ -59,23 +59,16 @@
  17180. -
  17181. - #define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0)
  17182. - #define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \
  17183. -- NL80211_RRF_PASSIVE_SCAN | \
  17184. -- NL80211_RRF_NO_IBSS)
  17185. -+ 0)
  17186. -
  17187. - #define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \
  17188. -- NL80211_RRF_PASSIVE_SCAN | \
  17189. -- NL80211_RRF_NO_IBSS)
  17190. -+ 0)
  17191. - #define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \
  17192. -- NL80211_RRF_PASSIVE_SCAN | \
  17193. -- NL80211_RRF_DFS | \
  17194. -- NL80211_RRF_NO_IBSS)
  17195. -+ 0)
  17196. - #define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \
  17197. -- NL80211_RRF_PASSIVE_SCAN | \
  17198. -- NL80211_RRF_DFS | \
  17199. -- NL80211_RRF_NO_IBSS)
  17200. -+ 0)
  17201. - #define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \
  17202. -- NL80211_RRF_PASSIVE_SCAN | \
  17203. -- NL80211_RRF_NO_IBSS)
  17204. -+ 0)
  17205. -
  17206. - static const struct ieee80211_regdomain brcms_regdom_x2 = {
  17207. - .n_reg_rules = 6,