linux/net/wireless/wext-compat.c
<<
ue="2ue="2ue//spa.6.ue/spa. class="lxr_search">ue="ue="2ue="2ue="2typ Searchue="2ue//spa.6.="2< ue/input typ u="2< . /div id < <1//a>/spa. class="comment">/*//spa.6.< <2//a>/spa. class="comment"> * cfg80211 - wext compat code//spa.6.< <3//a>/spa. class="comment"> *//spa.6.< <4//a>/spa. class="comment"> * This is temporary code until all wireless func v2.ality is migrated//spa.6.< <5//a>/spa. class="comment"> * into cfg80211, when>that happens all the exports here go away and//spa.6.< <6//a>/spa. class="comment"> * we directly assign the wireless handlers of wireless interfaces.//spa.6.< <7//a>/spa. class="comment"> *//spa.6.< <8//a>/spa. class="comment"> * Copyright 2008-2009 Johannes Berg <johannes@sipsolu v2.s.net>//spa.6.< <9//a>/spa. class="comment"> *///spa.6.< > a6.< 11//a>#include <linux/export.h//a>>.< 12//a>#include <linux/wireless.h//a>>.< 13//a>#include <linux/nl80211.h//a>>.< 14//a>#include <linux/if_arp.h//a>>.< 15//a>#include <linux/etherdevice.h//a>>.< 16//a>#include <linux/slab.h//a>>.< 17//a>#include <net/iw_handler.h//a>>.< 18//a>#include <net/cfg80211.h//a>>.< 19//a>#include <net/cfg80211-wext.h//a>>.< 20//a>#include "wext-compat.h//a>".< 21//a>#include "core.h//a>".< 22> a6.< 23//a>intcfg80211_wext_giwnam //a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.< 24//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.< 25//a> char */a href="+code=nam " class="sref">nam //a>, char */a href="+code=extra" class="sref">extra//a>).< 26//a>{.< 27//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.< 28//a> structieee80211_supported_band//a> */a href="+code=sband" class="sref">sband//a>;.< 29//a> /a href="+code=bool" class="sref">bool//a> /a href="+code=is_ht" class="sref">is_ht//a> =false//a>, /a href="+code=is_a" class="sref">is_a//a> =false//a>, /a href="+code=is_b" class="sref">is_b//a> =false//a>, /a href="+code=is_g" class="sref">is_g//a> =false//a>;.< 3 > a6.< 31//a> if (!/a href="+code=wdev" class="sref">wdev//a>).< 32//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.< 33> a6.< 34//a> /a href="+code=sband" class="sref">sband//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=bands" class="sref">bands//a>[/a href="+code=IEEE80211_BAND_5GHZ" class="sref">IEEE80211_BAND_5GHZ//a>];.< 35//a> if (/a href="+code=sband" class="sref">sband//a>) {.< 36//a> /a href="+code=is_a" class="sref">is_a//a> =true//a>;.< 37//a> /a href="+code=is_ht" class="sref">is_ht//a> |=sband//a>->/a href="+code=ht_cap" class="sref">ht_cap//a>./a href="+code=ht_supported" class="sref">ht_supported//a>;.< 38//a> }.< 39> a6.< 40//a> /a href="+code=sband" class="sref">sband//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=bands" class="sref">bands//a>[/a href="+code=IEEE80211_BAND_2GHZ" class="sref">IEEE80211_BAND_2GHZ//a>];.< 41//a> if (/a href="+code=sband" class="sref">sband//a>) {.< 42//a> inti//a>;.< 43//a> /spa. class="comment">/* Check for mandatory rates *///spa.6.< 44//a> for (/a href="+code=i" class="sref">i//a> =<0;i//a> <sband//a>->/a href="+code=n_bitrates" class="sref">n_bitrates//a>;i//a>++) {.< 45//a> if (/a href="+code=sband" class="sref">sband//a>->/a href="+code=bitrates" class="sref">bitrates//a>[/a href="+code=i" class="sref">i//a>]./a href="+code=bitrate" class="sref">bitrate//a> == 10).< 46//a> /a href="+code=is_b" class="sref">is_b//a> =true//a>;.< 47//a> if (/a href="+code=sband" class="sref">sband//a>->/a href="+code=bitrates" class="sref">bitrates//a>[/a href="+code=i" class="sref">i//a>]./a href="+code=bitrate" class="sref">bitrate//a> == 60).< 48//a> /a href="+code=is_g" class="sref">is_g//a> =true//a>;.< 49//a> }.< 50//a> /a href="+code=is_ht" class="sref">is_ht//a> |=sband//a>->/a href="+code=ht_cap" class="sref">ht_cap//a>./a href="+code=ht_supported" class="sref">ht_supported//a>;.< 51//a> }.< 52> a6.< 53//a> /a href="+code=strcpy" class="sref">strcpy//a>(/a href="+code=nam " class="sref">nam //a>, /spa. class="string">"IEEE 802.11"< 54//a> if (/a href="+code=is_a" class="sref">is_a//a>).< 55//a> /a href="+code=strcat" class="sref">strcat//a>(/a href="+code=nam " class="sref">nam //a>, /spa. class="string">"a"< 56//a> if (/a href="+code=is_b" class="sref">is_b//a>).< 57//a> /a href="+code=strcat" class="sref">strcat//a>(/a href="+code=nam " class="sref">nam //a>, /spa. class="string">"b"< 58//a> if (/a href="+code=is_g" class="sref">is_g//a>).< 59//a> /a href="+code=strcat" class="sref">strcat//a>(/a href="+code=nam " class="sref">nam //a>, /spa. class="string">"g"< 60//a> if (/a href="+code=is_ht" class="sref">is_ht//a>).< 61//a> /a href="+code=strcat" class="sref">strcat//a>(/a href="+code=nam " class="sref">nam //a>, /spa. class="string">"n"< 62> a6.< 63//a> return 0;.< 64//a>}.< 65//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwnam " class="sref">cfg80211_wext_giwnam //a>);.< 66> a6.< 67//a>intcfg80211_wext_siwmode//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>, structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.< 68//a> /a href="+code=u32" class="sref">u32//a> */a href="+code=mode" class="sref">mode//a>, char */a href="+code=extra" class="sref">extra//a>).< 69//a>{.< 70//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.< 71//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a>;.< 72//a> structvif_params//a> /a href="+code=vifparams" class="sref">vifparams//a>;.< 73//a> enumnl80211_iftyp //a> /a href="+code=typ " class="sref">typ //a>;.< 74//a> intret//a>;.< 75> a6.< 76//a> /a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.< 77> a6.< 78//a> switch (*/a href="+code=mode" class="sref">mode//a>) {.< 79//a> caseIW_MODE_INFRA//a>:.< 80//a> /a href="+code=typ " class="sref">typ //a> =NL80211_IFTYPE_STATION//a>;.< 81//a> break;.< 82//a> caseIW_MODE_ADHOC//a>:.< 83//a> /a href="+code=typ " class="sref">typ //a> =NL80211_IFTYPE_ADHOC//a>;.< 84//a> break;.< 85//a> caseIW_MODE_REPEAT//a>:.< 86//a> /a href="+code=typ " class="sref">typ //a> =NL80211_IFTYPE_WDS//a>;.< 87//a> break;.< 88//a> caseIW_MODE_MONITOR//a>:.< 89//a> /a href="+code=typ " class="sref">typ //a> =NL80211_IFTYPE_MONITOR//a>;.< 90//a> break;.< 91//a> default:.< 92//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.< 93//a> }.< 94> a6.< 95//a> if (/a href="+code=typ " class="sref">typ //a> ==wdev//a>->/a href="+code=iftyp " class="sref">iftyp //a>).< 96//a> return 0;.< 97> a6.< 98//a> /a href="+code=memset" class="sref">memset//a>(&/a href="+code=vifparams" class="sref">vifparams//a>, 0, sizeof(/a href="+code=vifparams" class="sref">vifparams//a>));.< 99> a6.<100//a> /a href="+code=cfg80211_lock_rdev" class="sref">cfg80211_lock_rdev//a>(/a href="+code=rdev" class="sref">rdev//a>);.<101//a> /a href="+code=ret" class="sref">ret//a> =cfg80211_change_iface//a>(/a href="+code=rdev" class="sref">rdev//a>, /a href="+code=dev" class="sref">dev//a>, /a href="+code=typ " class="sref">typ //a>, /a href="+code=NULL" class="sref">NULL//a>, &/a href="+code=vifparams" class="sref">vifparams//a>);.<102//a> /a href="+code=cfg80211_unlock_rdev" class="sref">cfg80211_unlock_rdev//a>(/a href="+code=rdev" class="sref">rdev//a>);.<103> a6.<104//a> return /a href="+code=ret" class="sref">ret//a>;.<105//a>}.<106//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_siwmode" class="sref">cfg80211_wext_siwmode//a>);.<107> a6.<108//a>intcfg80211_wext_giwmode//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>, structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<109//a> /a href="+code=u32" class="sref">u32//a> */a href="+code=mode" class="sref">mode//a>, char */a href="+code=extra" class="sref">extra//a>).<1 > a6{.<111//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<112> a6.<113//a> if (!/a href="+code=wdev" class="sref">wdev//a>).<114//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<115> a6.<116//a> switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftyp " class="sref">iftyp //a>) {.<117//a> caseNL80211_IFTYPE_AP//a>:.<118//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_MASTER//a>;.<119//a> break;.<120//a> caseNL80211_IFTYPE_STATION//a>:.<121//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_INFRA//a>;.<122//a> break;.<123//a> caseNL80211_IFTYPE_ADHOC//a>:.<124//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_ADHOC//a>;.<125//a> break;.<126//a> caseNL80211_IFTYPE_MONITOR//a>:.<127//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_MONITOR//a>;.<128//a> break;.<129//a> caseNL80211_IFTYPE_WDS//a>:.<130//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_REPEAT//a>;.<131//a> break;.<132//a> caseNL80211_IFTYPE_AP_VLAN//a>:.<133//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_SECOND//a>; /spa. class="comment">/* FIXME *///spa.6.<134//a> break;.<135//a> default:.<136//a> */a href="+code=mode" class="sref">mode//a> =IW_MODE_AUTO//a>;.<137//a> break;.<138//a> }.<139//a> return 0;.<140//a>}.<141//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwmode" class="sref">cfg80211_wext_giwmode//a>);.<142> a6.<143> a6.<144//a>intcfg80211_wext_giwrange//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<145//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<146//a> structiw_point//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).<147//a>{.<148//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<149//a> structiw_range//a> */a href="+code=range" class="sref">range//a> = (structiw_range//a> *)extra//a>;.<150//a> enumieee80211_band//a> /a href="+code=band" class="sref">band//a>;.<151//a> inti//a>, /a href="+code=c" class="sref">c//a> = 0;.<152> a6.<153//a> if (!/a href="+code=wdev" class="sref">wdev//a>).<154//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<155> a6.<156//a> /a href="+code=data" class="sref">data//a>->/a href="+code=length" class="sref">length//a> = sizeof(structiw_range//a>);.<157//a> /a href="+code=memset" class="sref">memset//a>(/a href="+code=range" class="sref">range//a>, 0, sizeof(structiw_range//a>));.<158//a>.<159//a> /a href="+code=range" class="sref">range//a>->/a href="+code=we_version_compiled" class="sref">we_version_compiled//a> =WIRELESS_EXT//a>;.<160//a> /a href="+code=range" class="sref">range//a>->/a href="+code=we_version_source" class="sref">we_version_source//a> =<21;.<161//a> /a href="+code=range" class="sref">range//a>->/a href="+code=retry_capa" class="sref">retry_capa//a> =IW_RETRY_LIMIT//a>;.<162//a> /a href="+code=range" class="sref">range//a>->/a href="+code=retry_flags" class="sref">retry_flags//a> =IW_RETRY_LIMIT//a>;.<163//a> /a href="+code=range" class="sref">range//a>->/a href="+code=min_retry" class="sref">min_retry//a> = 0;.<164//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_retry" class="sref">max_retry//a> =<255;.<165//a> /a href="+code=range" class="sref">range//a>->/a href="+code=min_rts" class="sref">min_rts//a> = 0;.<166//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_rts" class="sref">max_rts//a> =<2347;.<167//a> /a href="+code=range" class="sref">range//a>->/a href="+code=min_frag" class="sref">min_frag//a> =<256;.<168//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_frag" class="sref">max_frag//a> =<2346;.<169> a6.<170//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_encoding_tokens" class="sref">max_encoding_tokens//a> =<4;.<171//a>.<172//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> =IW_QUAL_NOISE_INVALID//a>;.<173> a6.<174//a> switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=signal_typ " class="sref">signal_typ //a>) {.<175//a> caseCFG80211_SIGNAL_TYPE_NONE//a>:.<176//a> break;.<177//a> caseCFG80211_SIGNAL_TYPE_MBM//a>:.<178//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=level" class="sref">level//a> =<-110;.<179//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=qual" class="sref">qual//a> =<70;.<180//a> /a href="+code=range" class="sref">range//a>->/a href="+code=avg_qual" class="sref">avg_qual//a>./a href="+code=qual" class="sref">qual//a> =<35;.<181//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> |=IW_QUAL_DBM//a>;.<182//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> |=IW_QUAL_QUAL_UPDATED//a>;.<183//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> |=IW_QUAL_LEVEL_UPDATED//a>;.<184//a> break;.<185//a> caseCFG80211_SIGNAL_TYPE_UNSPEC//a>:.<186//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=level" class="sref">level//a> =<100;.<187//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=qual" class="sref">qual//a> =<100;.<188//a> /a href="+code=range" class="sref">range//a>->/a href="+code=avg_qual" class="sref">avg_qual//a>./a href="+code=qual" class="sref">qual//a> =<50;.<189//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> |=IW_QUAL_QUAL_UPDATED//a>;.<190//a> /a href="+code=range" class="sref">range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a> |=IW_QUAL_LEVEL_UPDATED//a>;.<191//a> break;.<192//a> }.<193> a6.<194//a> /a href="+code=range" class="sref">range//a>->/a href="+code=avg_qual" class="sref">avg_qual//a>./a href="+code=level" class="sref">level//a> =range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=level" class="sref">level//a> / 2;.<195//a> /a href="+code=range" class="sref">range//a>->/a href="+code=avg_qual" class="sref">avg_qual//a>./a href="+code=noise" class="sref">noise//a> =range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=noise" class="sref">noise//a> / 2;.<196//a> /a href="+code=range" class="sref">range//a>->/a href="+code=avg_qual" class="sref">avg_qual//a>./a href="+code=updated" class="sref">updated//a> =range//a>->/a href="+code=max_qual" class="sref">max_qual//a>./a href="+code=updated" class="sref">updated//a>;.<197> a6.<198//a> for (/a href="+code=i" class="sref">i//a> =<0;i//a> <wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=n_cipher_suites" class="sref">n_cipher_suites//a>;i//a>++) {.<199//a> switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=cipher_suites" class="sref">cipher_suites//a>[/a href="+code=i" class="sref">i//a>]) {.<200//a> caseWLAN_CIPHER_SUITE_TKIP//a>:.<201//a> /a href="+code=range" class="sref">range//a>->/a href="+code=enc_capa" class="sref">enc_capa//a> |=<(/a href="+code=IW_ENC_CAPA_CIPHER_TKIP" class="sref">IW_ENC_CAPA_CIPHER_TKIP//a> |.<202//a> /a href="+code=IW_ENC_CAPA_WPA" class="sref">IW_ENC_CAPA_WPA//a>);.<203//a> break;.<204> a6.<205//a> caseWLAN_CIPHER_SUITE_CCMP//a>:.<206//a> /a href="+code=range" class="sref">range//a>->/a href="+code=enc_capa" class="sref">enc_capa//a> |=<(/a href="+code=IW_ENC_CAPA_CIPHER_CCMP" class="sref">IW_ENC_CAPA_CIPHER_CCMP//a> |.<207//a> /a href="+code=IW_ENC_CAPA_WPA2" class="sref">IW_ENC_CAPA_WPA2//a>);.<208//a> break;.<209> a6.<210//a> caseWLAN_CIPHER_SUITE_WEP40//a>:.<211//a> /a href="+code=range" class="sref">range//a>->/a href="+code=encoding_size" class="sref">encoding_size//a>[/a href="+code=range" class="sref">range//a>->/a href="+code=num_encoding_sizes" class="sref">num_encoding_sizes//a>++] =.<212//a> /a href="+code=WLAN_KEY_LEN_WEP40" class="sref">WLAN_KEY_LEN_WEP40//a>;.<213//a> break;.<214> a6.<215//a> caseWLAN_CIPHER_SUITE_WEP104//a>:.<216//a> /a href="+code=range" class="sref">range//a>->/a href="+code=encoding_size" class="sref">encoding_size//a>[/a href="+code=range" class="sref">range//a>->/a href="+code=num_encoding_sizes" class="sref">num_encoding_sizes//a>++] =.<217//a> /a href="+code=WLAN_KEY_LEN_WEP104" class="sref">WLAN_KEY_LEN_WEP104//a>;.<218//a> break;.<219//a> }.<220//a> }.<221//a>.<222//a> for (/a href="+code=band" class="sref">band//a> =<0;band//a> <IEEE80211_NUM_BANDS//a>;band//a> ++) {.<223//a> structieee80211_supported_band//a> */a href="+code=sband" class="sref">sband//a>;.<224> a6.<225//a> /a href="+code=sband" class="sref">sband//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=bands" class="sref">bands//a>[/a href="+code=band" class="sref">band//a>];.<226> a6.<227//a> if (!/a href="+code=sband" class="sref">sband//a>).<228//a> continue;.<229> a6.<230//a> for (/a href="+code=i" class="sref">i//a> =<0;i//a> <sband//a>->/a href="+code=n_channels" class="sref">n_channels//a> && /a href="+code=c" class="sref">c//a> <IW_MAX_FREQUENCIES//a>;i//a>++) {.<231//a> structieee80211_channel//a> */a href="+code=chan" class="sref">chan//a> =<&/a href="+code=sband" class="sref">sband//a>->/a href="+code=channels" class="sref">channels//a>[/a href="+code=i" class="sref">i//a>];.<232> a6.<233//a> if (!(/a href="+code=chan" class="sref">chan//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IEEE80211_CHAN_DISABLED" class="sref">IEEE80211_CHAN_DISABLED//a>)) {.<234//a> /a href="+code=range" class="sref">range//a>->/a href="+code=freq" class="sref">freq//a>[/a href="+code=c" class="sref">c//a>]./a href="+code=i" class="sref">i//a> =.<235//a> /a href="+code=ieee80211_frequency_to_channel" class="sref">ieee80211_frequency_to_channel//a>(.<236//a> /a href="+code=chan" class="sref">chan//a>->/a href="+code=center_freq" class="sref">center_freq//a>);.<237//a> /a href="+code=range" class="sref">range//a>->/a href="+code=freq" class="sref">freq//a>[/a href="+code=c" class="sref">c//a>]./a href="+code=m" class="sref">m//a> =chan//a>->/a href="+code=center_freq" class="sref">center_freq//a>;.<238//a> /a href="+code=range" class="sref">range//a>->/a href="+code=freq" class="sref">freq//a>[/a href="+code=c" class="sref">c//a>]./a href="+code=e" class="sref">e//a> =<6;.<239//a> /a href="+code=c" class="sref">c//a>++;.<240//a> }.<241//a> }.<242//a> }.<243//a> /a href="+code=range" class="sref">range//a>->/a href="+code=num_channels" class="sref">num_channels//a> =c//a>;.<244//a> /a href="+code=range" class="sref">range//a>->/a href="+code=num_frequency" class="sref">num_frequency//a> =c//a>;.<245> a6.<246//a> /a href="+code=IW_EVENT_CAPA_SET_KERNEL" class="sref">IW_EVENT_CAPA_SET_KERNEL//a>(/a href="+code=range" class="sref">range//a>->/a href="+code=event_capa" class="sref">event_capa//a>);.<247//a> /a href="+code=IW_EVENT_CAPA_SET" class="sref">IW_EVENT_CAPA_SET//a>(/a href="+code=range" class="sref">range//a>->/a href="+code=event_capa" class="sref">event_capa//a>, /a href="+code=SIOCGIWAP" class="sref">SIOCGIWAP//a>);.<248//a> /a href="+code=IW_EVENT_CAPA_SET" class="sref">IW_EVENT_CAPA_SET//a>(/a href="+code=range" class="sref">range//a>->/a href="+code=event_capa" class="sref">event_capa//a>, /a href="+code=SIOCGIWSCAN" class="sref">SIOCGIWSCAN//a>);.<249> a6.<250//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=max_scan_ssids" class="sref">max_scan_ssids//a> > 0).<251//a> /a href="+code=range" class="sref">range//a>->/a href="+code=scan_capa" class="sref">scan_capa//a> |=IW_SCAN_CAPA_ESSID//a>;.<252> a6.<253//a> return 0;.<254//a>}.<255> a6/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwrange" class="sref">cfg80211_wext_giwrange//a>);.<256> a6.<257> a6.<258//a>/spa. class="comment">/**//spa.6.<259//a>/spa. class="comment"> * cfg80211_wext_freq - get wext frequency for non-"auto"//spa.6.<260//a>/spa. class="comment"> * @wiphy: the wiphy//spa.6.<261//a>/spa. class="comment"> * @freq: the wext freq encoding//spa.6.<262//a>/spa. class="comment"> *//spa.6.<263//a>/spa. class="comment"> * Returns a frequency, or a negative error code, or 0 for auto.//spa.6.<264//a>/spa. class="comment"> *///spa.6.<265//a>intcfg80211_wext_freq//a>(structwiphy//a> */a href="+code=wiphy" class="sref">wiphy//a>, structiw_freq//a> */a href="+code=freq" class="sref">freq//a>).<266//a>{.<267//a> /spa. class="comment">/*//spa.6.<268//a>/spa. class="comment"> * Parse frequency - return 0 for auto and//spa.6.<269//a>/spa. class="comment"> * -EINVAL for impossible things.//spa.6.<270//a>/spa. class="comment"> *///spa.6.<271//a> if (/a href="+code=freq" class="sref">freq//a>->/a href="+code=e" class="sref">e//a> == 0) {.<272//a> enumieee80211_band//a> /a href="+code=band" class="sref">band//a> =IEEE80211_BAND_2GHZ//a>;.<273//a> if (/a href="+code=freq" class="sref">freq//a>->/a href="+code=m" class="sref">m//a> <<0).<274//a> return 0;.<275//a> if (/a href="+code=freq" class="sref">freq//a>->/a href="+code=m" class="sref">m//a> > 14).<276//a> /a href="+code=band" class="sref">band//a> =IEEE80211_BAND_5GHZ//a>;.<277//a> return /a href="+code=ieee80211_channel_to_frequency" class="sref">ieee80211_channel_to_frequency//a>(/a href="+code=freq" class="sref">freq//a>->/a href="+code=m" class="sref">m//a>, /a href="+code=band" class="sref">band//a>);.<278//a> } else {.<279//a> inti//a>, /a href="+code=div" class="sref">div//a> =<1000000;.<280//a> for (/a href="+code=i" class="sref">i//a> =<0;i//a> <freq//a>->/a href="+code=e" class="sref">e//a>;i//a>++).<281//a> /a href="+code=div" class="sref">div//a> /=<10;.<282//a> if (/a href="+code=div" class="sref">div//a> <=<0).<283//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<284//a> return /a href="+code=freq" class="sref">freq//a>->/a href="+code=m" class="sref">m//a> / /a href="+code=div" class="sref">div//a>;.<285//a> }.<286//a>}.<287> a6.<288//a>intcfg80211_wext_siwrts//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<289//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<290//a> structiw_param//a> */a href="+code=rts" class="sref">rts//a>, char */a href="+code=extra" class="sref">extra//a>).<291//a>{.<292//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<293//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<294//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=orts" class="sref">orts//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=rts_threshold" class="sref">rts_threshold//a>;.<295//a> interr//a>;.<296> a6.<297//a> if (/a href="+code=rts" class="sref">rts//a>->/a href="+code=disabled" class="sref">disabled//a> || !/a href="+code=rts" class="sref">rts//a>->/a href="+code=fixed" class="sref">fixed//a>).<298//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=rts_threshold" class="sref">rts_threshold//a> =<(/a href="+code=u32" class="sref">u32//a>) -1;.<299//a> else if (/a href="+code=rts" class="sref">rts//a>->/a href="+code=value" class="sref">value//a> <<0).<300//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<301//a> else.<302//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=rts_threshold" class="sref">rts_threshold//a> =rts//a>->/a href="+code=value" class="sref">value//a>;.<303> a6.<304//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_wiphy_params" class="sref">set_wiphy_params//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,.<305//a> /a href="+code=WIPHY_PARAM_RTS_THRESHOLD" class="sref">WIPHY_PARAM_RTS_THRESHOLD//a>);.<306//a> if (/a href="+code=err" class="sref">err//a>).<307//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=rts_threshold" class="sref">rts_threshold//a> =orts//a>;.<308//a>.<309//a> return /a href="+code=err" class="sref">err//a>;.<310//a>}.<311//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_siwrts" class="sref">cfg80211_wext_siwrts//a>);.<312> a6.<313//a>intcfg80211_wext_giwrts//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<314//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<315//a> structiw_param//a> */a href="+code=rts" class="sref">rts//a>, char */a href="+code=extra" class="sref">extra//a>).<316//a>{.<317//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<318//a>.<319//a> /a href="+code=rts" class="sref">rts//a>->/a href="+code=value" class="sref">value//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=rts_threshold" class="sref">rts_threshold//a>;.<320//a> /a href="+code=rts" class="sref">rts//a>->/a href="+code=disabled" class="sref">disabled//a> =rts//a>->/a href="+code=value" class="sref">value//a> == (/a href="+code=u32" class="sref">u32//a>) -1;.<321//a> /a href="+code=rts" class="sref">rts//a>->/a href="+code=fixed" class="sref">fixed//a> =<1;.<322> a6.<323//a> return 0;.<324//a>}.<325> a6/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwrts" class="sref">cfg80211_wext_giwrts//a>);.<326> a6.<327//a>intcfg80211_wext_siwfrag//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<328//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<329//a> structiw_param//a> */a href="+code=frag" class="sref">frag//a>, char */a href="+code=extra" class="sref">extra//a>).<330//a>{.<331//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<332//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<333//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=ofrag" class="sref">ofrag//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=frag_threshold" class="sref">frag_threshold//a>;.<334//a> interr//a>;.<335> a6.<336//a> if (/a href="+code=frag" class="sref">frag//a>->/a href="+code=disabled" class="sref">disabled//a> || !/a href="+code=frag" class="sref">frag//a>->/a href="+code=fixed" class="sref">fixed//a>).<337//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=frag_threshold" class="sref">frag_threshold//a> =<(/a href="+code=u32" class="sref">u32//a>) -1;.<338//a> else if (/a href="+code=frag" class="sref">frag//a>->/a href="+code=value" class="sref">value//a> <<256).<339//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<340//a> else {.<341//a> /spa. class="comment">/* Fragment length must be even, so strip LSB. *///spa.6.<342//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=frag_threshold" class="sref">frag_threshold//a> =frag//a>->/a href="+code=value" class="sref">value//a> & ~0x1;.<343//a> }.<344> a6.<345//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_wiphy_params" class="sref">set_wiphy_params//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,.<346//a> /a href="+code=WIPHY_PARAM_FRAG_THRESHOLD" class="sref">WIPHY_PARAM_FRAG_THRESHOLD//a>);.<347//a> if (/a href="+code=err" class="sref">err//a>).<348//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=frag_threshold" class="sref">frag_threshold//a> =ofrag//a>;.<349> a6.<350//a> return /a href="+code=err" class="sref">err//a>;.<351//a>}.<352> a6/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_siwfrag" class="sref">cfg80211_wext_siwfrag//a>);.<353> a6.<354//a>intcfg80211_wext_giwfrag//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<355//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<356//a> structiw_param//a> */a href="+code=frag" class="sref">frag//a>, char */a href="+code=extra" class="sref">extra//a>).<357> a6{.<358//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<359> a6.<360//a> /a href="+code=frag" class="sref">frag//a>->/a href="+code=value" class="sref">value//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=frag_threshold" class="sref">frag_threshold//a>;.<361//a> /a href="+code=frag" class="sref">frag//a>->/a href="+code=disabled" class="sref">disabled//a> =frag//a>->/a href="+code=value" class="sref">value//a> == (/a href="+code=u32" class="sref">u32//a>) -1;.<362//a> /a href="+code=frag" class="sref">frag//a>->/a href="+code=fixed" class="sref">fixed//a> =<1;.<363> a6.<364//a> return 0;.<365//a>}.<366//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwfrag" class="sref">cfg80211_wext_giwfrag//a>);.<367> a6.<368//a>static intcfg80211_wext_siwretry//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<369//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<370//a> structiw_param//a> */a href="+code=retry" class="sref">retry//a>, char */a href="+code=extra" class="sref">extra//a>).<371//a>{.<372//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<373//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<374//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=changed" class="sref">changed//a> =<0;.<375//a> /a href="+code=u8" class="sref">u8//a> /a href="+code=olong" class="sref">olong//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a>;.<376//a> /a href="+code=u8" class="sref">u8//a> /a href="+code=oshort" class="sref">oshort//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a>;.<377//a> interr//a>;.<378//a>.<379//a> if (/a href="+code=retry" class="sref">retry//a>->/a href="+code=disabled" class="sref">disabled//a> ||.<380//a> (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_RETRY_TYPE" class="sref">IW_RETRY_TYPE//a>) !=IW_RETRY_LIMIT//a>).<381//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<382> a6.<383//a> if (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_RETRY_LONG" class="sref">IW_RETRY_LONG//a>) {.<384//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a> =retry//a>->/a href="+code=value" class="sref">value//a>;.<385//a> /a href="+code=changed" class="sref">changed//a> |=WIPHY_PARAM_RETRY_LONG//a>;.<386//a> } else if (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_RETRY_SHORT" class="sref">IW_RETRY_SHORT//a>) {.<387//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a> =retry//a>->/a href="+code=value" class="sref">value//a>;.<388//a> /a href="+code=changed" class="sref">changed//a> |=WIPHY_PARAM_RETRY_SHORT//a>;.<389//a> } else {.<390//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a> =retry//a>->/a href="+code=value" class="sref">value//a>;.<391//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a> =retry//a>->/a href="+code=value" class="sref">value//a>;.<392//a> /a href="+code=changed" class="sref">changed//a> |=WIPHY_PARAM_RETRY_LONG//a>;.<393//a> /a href="+code=changed" class="sref">changed//a> |=WIPHY_PARAM_RETRY_SHORT//a>;.<394//a> }.<395> a6.<396//a> if (!/a href="+code=changed" class="sref">changed//a>).<397//a> return 0;.<398//a>.<399//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_wiphy_params" class="sref">set_wiphy_params//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>, /a href="+code=changed" class="sref">changed//a>);.<400//a> if (/a href="+code=err" class="sref">err//a>) {.<401//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a> =oshort//a>;.<402//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a> =olong//a>;.<403//a> }.<404> a6.<405//a> return /a href="+code=err" class="sref">err//a>;.<406//a>}.<407> a6.<408//a>intcfg80211_wext_giwretry//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<409//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<410//a> structiw_param//a> */a href="+code=retry" class="sref">retry//a>, char */a href="+code=extra" class="sref">extra//a>).<411//a>{.<412//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<413> a6.<414//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=disabled" class="sref">disabled//a> =<0;.<415> a6.<416//a> if (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> == 0 || (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_RETRY_SHORT" class="sref">IW_RETRY_SHORT//a>)) {.<417//a> /spa. class="comment">/*//spa.6.<418//a>/spa. class="comment"> * First return short value, iwconfig will ask long value//spa.6.<419//a>/spa. class="comment"> * later if needed//spa.6.<420//a>/spa. class="comment"> *///spa.6.<421//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> |=IW_RETRY_LIMIT//a>;.<422//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=value" class="sref">value//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a>;.<423//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a> !=wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_short" class="sref">retry_short//a>).<424//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> |=IW_RETRY_LONG//a>;.<425> a6.<426//a> return 0;.<427//a> }.<428//a>.<429//a> if (/a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_RETRY_LONG" class="sref">IW_RETRY_LONG//a>) {.<430//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=flags" class="sref">flags//a> =IW_RETRY_LIMIT//a> |IW_RETRY_LONG//a>;.<431//a> /a href="+code=retry" class="sref">retry//a>->/a href="+code=value" class="sref">value//a> =wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=retry_long" class="sref">retry_long//a>;.<432//a> }.<433> a6.<434//a> return 0;.<435//a>}.<436//a>/a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL//a>(/a href="+code=cfg80211_wext_giwretry" class="sref">cfg80211_wext_giwretry//a>);.<437> a6.<438//a>static int__cfg80211_set_encryption//a>(structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a>,.<439//a> structnet_device//a> */a href="+code=dev" class="sref">dev//a>,bool//a> /a href="+code=pairwise" class="sref">pairwise//a>,.<440//a> constu8//a> */a href="+code=addr" class="sref">addr//a>,bool//a> /a href="+code=remove" class="sref">remove//a>,bool//a> /a href="+code=tx_key" class="sref">tx_key//a>,.<441//a> intidx//a>,key_params//a> */a href="+code=params" class="sref">params//a>).<442//a>{.<443//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<444//a> interr//a>,i//a>;.<445//a> /a href="+code=bool" class="sref">bool//a> /a href="+code=rejoin" class="sref">rejoin//a> =false//a>;.<446> a6.<447//a> if (/a href="+code=pairwise" class="sref">pairwise//a> && !/a href="+code=addr" class="sref">addr//a>).<448//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<449> a6.<450//a> if (!/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>) {.<451//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a> =kzalloc//a>(sizeof(*/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>),.<452//a> /a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL//a>);.<453//a> if (!/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>).<454//a> return -/a href="+code=ENOMEM" class="sref">ENOMEM//a>;.<455//a> for (/a href="+code=i" class="sref">i//a> =<0;i//a> <<6;i//a>++).<456//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=i" class="sref">i//a>]./a href="+code=key" class="sref">key//a> =.<457//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=data" class="sref">data//a>[/a href="+code=i" class="sref">i//a>];.<458//a> }.<459> a6.<460//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_ADHOC//a> &&.<461//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).<462//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<463> a6.<464//a> if (/a href="+code=params" class="sref">params//a>->/a href="+code=cipher" class="sref">cipher//a> ==WLAN_CIPHER_SUITE_AES_CMAC//a>) {.<465//a> if (!/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>).<466//a> return -/a href="+code=ENOLINK" class="sref">ENOLINK//a>;.<467> a6.<468//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_mgmt_key" class="sref">set_default_mgmt_key//a>).<469//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<470//a>.<471//a> if (/a href="+code=idx" class="sref">idx//a> <<4 || /a href="+code=idx" class="sref">idx//a> > 5).<472//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<473//a> } else if (/a href="+code=idx" class="sref">idx//a> <<0 || /a href="+code=idx" class="sref">idx//a> > 3).<474//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<475> a6.<476//a> if (/a href="+code=remove" class="sref">remove//a>) {.<477//a> /a href="+code=err" class="sref">err//a> =<0;.<478//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>) {.<479//a> /spa. class="comment">/*//spa.6.<480//a>/spa. class="comment"> * If removing the current TX key, we will need to//spa.6.<481//a>/spa. class="comment"> * join a new IBSS without the privacy bit clear.//spa.6.<482> a6/spa. class="comment"> *///spa.6.<483//a> if (/a href="+code=idx" class="sref">idx//a> ==wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> &&.<484//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> ==NL80211_IFTYPE_ADHOC//a>) {.<485//a> /a href="+code=__cfg80211_leave_ibss" class="sref">__cfg80211_leave_ibss//a>(/a href="+code=rdev" class="sref">rdev//a>,wdev//a>->/a href="+code=netdev" class="sref">netdev//a>,true//a>);.<486//a> /a href="+code=rejoin" class="sref">rejoin//a> =true//a>;.<487//a> }.<488//a>.<489//a> if (!/a href="+code=pairwise" class="sref">pairwise//a> && /a href="+code=addr" class="sref">addr//a> &&.<490//a> !(/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>./a href="+code=flags" class="sref">flags//a> & /a href="+code=WIPHY_FLAG_IBSS_RSN" class="sref">WIPHY_FLAG_IBSS_RSN//a>)).<491//a> /a href="+code=err" class="sref">err//a> =<-/a href="+code=ENOENT" class="sref">ENOENT//a>;.<492//a> else.<493//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=del_key" class="sref">del_key//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>,idx//a>,.<494//a> /a href="+code=pairwise" class="sref">pairwise//a>, /a href="+code=addr" class="sref">addr//a>);.<495//a> }.<496//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=privacy" class="sref">privacy//a> =false//a>;.<497//a> /spa. class="comment">/*//spa.6.<498//a>/spa. class="comment"> * Applications using wireless extensions expect to be//spa.6.<499//a>/spa. class="comment"> * able to delete keys that don't exist, so allow that.//spa.6.<500//a>/spa. class="comment"> *///spa.6.<501//a> if (/a href="+code=err" class="sref">err//a> ==<-/a href="+code=ENOENT" class="sref">ENOENT//a>).<502//a> /a href="+code=err" class="sref">err//a> =<0;.<503//a> if (!/a href="+code=err" class="sref">err//a>) {.<504//a> if (!/a href="+code=addr" class="sref">addr//a>) {.<505//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=key_len" class="sref">key_len//a> =<0;.<506//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=cipher" class="sref">cipher//a> =<0;.<507//a> }.<508//a> if (/a href="+code=idx" class="sref">idx//a> ==wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a>).<509//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> = -1;.<510//a> else if (/a href="+code=idx" class="sref">idx//a> ==wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_mgmt_key" class="sref">default_mgmt_key//a>).<511//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_mgmt_key" class="sref">default_mgmt_key//a> = -1;.<512//a> }.<513> a6.<514//a> if (!/a href="+code=err" class="sref">err//a> && /a href="+code=rejoin" class="sref">rejoin//a>).<515//a> /a href="+code=err" class="sref">err//a> =cfg80211_ibss_wext_join//a>(/a href="+code=rdev" class="sref">rdev//a>,wdev//a>);.<516> a6.<517//a> return /a href="+code=err" class="sref">err//a>;.<518//a> }.<519> a6.<520//a> if (/a href="+code=addr" class="sref">addr//a>).<521//a> /a href="+code=tx_key" class="sref">tx_key//a> =false//a>;.<522> a6.<523//a> if (/a href="+code=cfg80211_validate_key_settings" class="sref">cfg80211_validate_key_settings//a>(/a href="+code=rdev" class="sref">rdev//a>,params//a>,idx//a>, /a href="+code=pairwise" class="sref">pairwise//a>, /a href="+code=addr" class="sref">addr//a>)).<524//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<525> a6.<526//a> /a href="+code=err" class="sref">err//a> =<0;.<527//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>).<528//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=add_key" class="sref">add_key//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>,idx//a>,.<529//a> /a href="+code=pairwise" class="sref">pairwise//a>, /a href="+code=addr" class="sref">addr//a>,params//a>);.<530//a> if (/a href="+code=err" class="sref">err//a>).<531//a> return /a href="+code=err" class="sref">err//a>;.<532> a6.<533//a> if (!/a href="+code=addr" class="sref">addr//a>) {.<534//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>] =<*/a href="+code=params" class="sref">params//a>;.<535//a> /a href="+code=memcpy" class="sref">memcpy//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=data" class="sref">data//a>[/a href="+code=idx" class="sref">idx//a>],.<536//a> /a href="+code=params" class="sref">params//a>->/a href="+code=key" class="sref">key//a>,params//a>->/a href="+code=key_len" class="sref">key_len//a>);.<537//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=key" class="sref">key//a> =.<538//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=data" class="sref">data//a>[/a href="+code=idx" class="sref">idx//a>];.<539//a> }.<540//a>.<541//a> if ((/a href="+code=params" class="sref">params//a>->/a href="+code=cipher" class="sref">cipher//a> ==WLAN_CIPHER_SUITE_WEP40//a> ||.<542//a> /a href="+code=params" class="sref">params//a>->/a href="+code=cipher" class="sref">cipher//a> ==WLAN_CIPHER_SUITE_WEP104//a>) &&.<543//a> (/a href="+code=tx_key" class="sref">tx_key//a> || (!/a href="+code=addr" class="sref">addr//a> && /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> == -1))) {.<544//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>) {.<545//a> /spa. class="comment">/*//spa.6.<546> a6/spa. class="comment"> * If we are getting a new TX key from not having//spa.6.<547//a>/spa. class="comment"> * had one before we need to join a new IBSS with//spa.6.<548//a>/spa. class="comment"> * the privacy bit set.//spa.6.<549//a>/spa. class="comment"> *///spa.6.<550//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> ==NL80211_IFTYPE_ADHOC//a> &&.<551//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> == -1) {.<552//a> /a href="+code=__cfg80211_leave_ibss" class="sref">__cfg80211_leave_ibss//a>(/a href="+code=rdev" class="sref">rdev//a>,wdev//a>->/a href="+code=netdev" class="sref">netdev//a>,true//a>);.<553//a> /a href="+code=rejoin" class="sref">rejoin//a> =true//a>;.<554//a> }.<555//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_key" class="sref">set_default_key//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>,.<556//a> /a href="+code=idx" class="sref">idx//a>, /a href="+code=true" class="sref">true//a>,true//a>);.<557//a> }.<558//a> if (!/a href="+code=err" class="sref">err//a>) {.<559//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> = /a href="+code=idx" class="sref">idx//a>;.<560//a> if (/a href="+code=rejoin" class="sref">rejoin//a>).<561//a> /a href="+code=err" class="sref">err//a> =cfg80211_ibss_wext_join//a>(/a href="+code=rdev" class="sref">rdev//a>,wdev//a>);.<562//a> }.<563//a> return /a href="+code=err" class="sref">err//a>;.<564//a> }.<565> a6.<566//a> if (/a href="+code=params" class="sref">params//a>->/a href="+code=cipher" class="sref">cipher//a> ==WLAN_CIPHER_SUITE_AES_CMAC//a> &&.<567//a> (/a href="+code=tx_key" class="sref">tx_key//a> || (!/a href="+code=addr" class="sref">addr//a> && /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_mgmt_key" class="sref">default_mgmt_key//a> == -1))) {.<568//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>).<569//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_mgmt_key" class="sref">set_default_mgmt_key//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,.<570//a> /a href="+code=dev" class="sref">dev//a>, /a href="+code=idx" class="sref">idx//a>);.<571//a> if (!/a href="+code=err" class="sref">err//a>).<572//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_mgmt_key" class="sref">default_mgmt_key//a> = /a href="+code=idx" class="sref">idx//a>;.<573//a> return /a href="+code=err" class="sref">err//a>;.<574//a> }.<575> a6.<576//a> return 0;.<577//a>}.<578//a>.<579//a>static intcfg80211_set_encryption//a>(structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a>,.<580//a> structnet_device//a> */a href="+code=dev" class="sref">dev//a>,bool//a> /a href="+code=pairwise" class="sref">pairwise//a>,.<581//a> constu8//a> */a href="+code=addr" class="sref">addr//a>,bool//a> /a href="+code=remove" class="sref">remove//a>,bool//a> /a href="+code=tx_key" class="sref">tx_key//a>,.<582//a> intidx//a>,key_params//a> */a href="+code=params" class="sref">params//a>).<583//a>{.<584//a> interr//a>;.<585> a6.<586//a> /spa. class="comment">/* devlist mutex needed for possible IBSS re-join *///spa.6.<587//a> /a href="+code=mutex_lock" class="sref">mutex_lock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<588//a> /a href="+code=wdev_lock" class="sref">wdev_lock//a>(/a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>);.<589//a> /a href="+code=err" class="sref">err//a> =__cfg80211_set_encryption//a>(/a href="+code=rdev" class="sref">rdev//a>,dev//a>,pairwise//a>, /a href="+code=addr" class="sref">addr//a>,.<590//a> /a href="+code=remove" class="sref">remove//a>,tx_key//a>,idx//a>, /a href="+code=params" class="sref">params//a>);.<591//a> /a href="+code=wdev_unlock" class="sref">wdev_unlock//a>(/a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>);.<592//a> /a href="+code=mutex_unlock" class="sref">mutex_unlock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<593> a6.<594//a> return /a href="+code=err" class="sref">err//a>;.<595//a>}.<596> a6.<597//a>static intcfg80211_wext_siwencode//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<598//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<599//a> structiw_point//a> */a href="+code=erq" class="sref">erq//a>, char */a href="+code=keybuf" class="sref">keybuf//a>).<600//a>{.<601//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<602//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<603//a> intidx//a>,err//a>;.<604//a> /a href="+code=bool" class="sref">bool//a> /a href="+code=remove" class="sref">remove//a> =false//a>;.<605//a> structkey_params//a> /a href="+code=params" class="sref">params//a>;.<606> a6.<607//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a> &&.<608//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_ADHOC//a>).<609//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<610//a>.<611//a> /spa. class="comment">/* no use -- only MFP (set_default_mgmt_key) is optional *///spa.6.<612//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=del_key" class="sref">del_key//a> ||.<613//a> !/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=add_key" class="sref">add_key//a> ||.<614//a> !/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_key" class="sref">set_default_key//a>).<615//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<616> a6.<617//a> /a href="+code=idx" class="sref">idx//a> =erq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_ENCODE_INDEX" class="sref">IW_ENCODE_INDEX//a>;.<618//a> if (/a href="+code=idx" class="sref">idx//a> ==<0) {.<619//a> /a href="+code=idx" class="sref">idx//a> =wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a>;.<620//a> if (/a href="+code=idx" class="sref">idx//a> <<0).<621//a> /a href="+code=idx" class="sref">idx//a> =<0;.<622//a> } else if (/a href="+code=idx" class="sref">idx//a> <<1 || /a href="+code=idx" class="sref">idx//a> > 4).<623//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<624//a> else.<625//a> /a href="+code=idx" class="sref">idx//a>--;.<626> a6.<627//a> if (/a href="+code=erq" class="sref">erq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_ENCODE_DISABLED" class="sref">IW_ENCODE_DISABLED//a>).<628//a> /a href="+code=remove" class="sref">remove//a> =true//a>;.<629//a> else if (/a href="+code=erq" class="sref">erq//a>->/a href="+code=length" class="sref">length//a> ==<0) {.<630//a> /spa. class="comment">/* No key data - just set the default TX key index *///spa.6.<631//a> /a href="+code=err" class="sref">err//a> =<0;.<632//a> /a href="+code=wdev_lock" class="sref">wdev_lock//a>(/a href="+code=wdev" class="sref">wdev//a>);.<633//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>).<634//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_key" class="sref">set_default_key//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>,.<635//a> /a href="+code=idx" class="sref">idx//a>,true//a>,true//a>);.<636//a> if (!/a href="+code=err" class="sref">err//a>).<637//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> = /a href="+code=idx" class="sref">idx//a>;.<638//a> /a href="+code=wdev_unlock" class="sref">wdev_unlock//a>(/a href="+code=wdev" class="sref">wdev//a>);.<639//a> return /a href="+code=err" class="sref">err//a>;.<640//a> }.<641//a>.<642//a> /a href="+code=memset" class="sref">memset//a>(&/a href="+code=params" class="sref">params//a>,<0, sizeof(/a href="+code=params" class="sref">params//a>));.<643//a> /a href="+code=params" class="sref">params//a>./a href="+code=key" class="sref">key//a> =keybuf//a>;.<644//a> /a href="+code=params" class="sref">params//a>./a href="+code=key_len" class="sref">key_len//a> =erq//a>->/a href="+code=length" class="sref">length//a>;.<645//a> if (/a href="+code=erq" class="sref">erq//a>->/a href="+code=length" class="sref">length//a> ==<5).<646//a> /a href="+code=params" class="sref">params//a>./a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_WEP40//a>;.<647//a> else if (/a href="+code=erq" class="sref">erq//a>->/a href="+code=length" class="sref">length//a> ==<13).<648//a> /a href="+code=params" class="sref">params//a>./a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_WEP104//a>;.<649//a> else if (!/a href="+code=remove" class="sref">remove//a>).<650//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<651//a>.<652//a> return /a href="+code=cfg80211_set_encryption" class="sref">cfg80211_set_encryption//a>(/a href="+code=rdev" class="sref">rdev//a>,dev//a>,false//a>,NULL//a>,remove//a>,.<653//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a> == -1,.<654//a> /a href="+code=idx" class="sref">idx//a>,<&/a href="+code=params" class="sref">params//a>);.<655//a>}.<656> a6.<657//a>static intcfg80211_wext_siwencodeext//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<658//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<659//a> structiw_point//a> */a href="+code=erq" class="sref">erq//a>, char */a href="+code=extra" class="sref">extra//a>).<660//a>{.<661//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<662//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<663//a> structiw_encode_ext//a> */a href="+code=ext" class="sref">ext//a> = (structiw_encode_ext//a> *)extra//a>;.<664//a> constu8//a> */a href="+code=addr" class="sref">addr//a>;.<665//a> intidx//a>;.<666//a> /a href="+code=bool" class="sref">bool//a> /a href="+code=remove" class="sref">remove//a> =false//a>;.<667//a> structkey_params//a> /a href="+code=params" class="sref">params//a>;.<668//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=cipher" class="sref">cipher//a>;.<669> a6.<670//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a> &&.<671//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_ADHOC//a>).<672//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<673> a6.<674//a> /spa. class="comment">/* no use -- only MFP (set_default_mgmt_key) is optional *///spa.6.<675//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=del_key" class="sref">del_key//a> ||.<676//a> !/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=add_key" class="sref">add_key//a> ||.<677//a> !/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_default_key" class="sref">set_default_key//a>).<678//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<679> a6.<680//a> switch (/a href="+code=ext" class="sref">ext//a>->/a href="+code=alg" class="sref">alg//a>) {.<681//a> case /a href="+code=IW_ENCODE_ALG_NONE" class="sref">IW_ENCODE_ALG_NONE//a>:.<682//a> /a href="+code=remove" class="sref">remove//a> =true//a>;.<683//a> /a href="+code=cipher" class="sref">cipher//a> =<0;.<684//a> break;.<685//a> case /a href="+code=IW_ENCODE_ALG_WEP" class="sref">IW_ENCODE_ALG_WEP//a>:.<686//a> if (/a href="+code=ext" class="sref">ext//a>->/a href="+code=key_len" class="sref">key_len//a> ==<5).<687//a> /a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_WEP40//a>;.<688//a> else if (/a href="+code=ext" class="sref">ext//a>->/a href="+code=key_len" class="sref">key_len//a> ==<13).<689//a> /a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_WEP104//a>;.<690//a> else.<691//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<692//a> break;.<693//a> case /a href="+code=IW_ENCODE_ALG_TKIP" class="sref">IW_ENCODE_ALG_TKIP//a>:.<694//a> /a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_TKIP//a>;.<695//a> break;.<696//a> case /a href="+code=IW_ENCODE_ALG_CCMP" class="sref">IW_ENCODE_ALG_CCMP//a>:.<697//a> /a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_CCMP//a>;.<698//a> break;.<699//a> case /a href="+code=IW_ENCODE_ALG_AES_CMAC" class="sref">IW_ENCODE_ALG_AES_CMAC//a>:.<700//a> /a href="+code=cipher" class="sref">cipher//a> =WLAN_CIPHER_SUITE_AES_CMAC//a>;.<701//a> break;.<702//a> default:.<703//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<704//a> }.<705> a6.<706//a> if (/a href="+code=erq" class="sref">erq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_ENCODE_DISABLED" class="sref">IW_ENCODE_DISABLED//a>).<707//a> /a href="+code=remove" class="sref">remove//a> =true//a>;.<708//a>.<709//a> /a href="+code=idx" class="sref">idx//a> =erq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_ENCODE_INDEX" class="sref">IW_ENCODE_INDEX//a>;.<710//a> if (/a href="+code=cipher" class="sref">cipher//a> ==WLAN_CIPHER_SUITE_AES_CMAC//a>) {.<711//a> if (/a href="+code=idx" class="sref">idx//a> <<4 || /a href="+code=idx" class="sref">idx//a> > 5) {.<712//a> /a href="+code=idx" class="sref">idx//a> =wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_mgmt_key" class="sref">default_mgmt_key//a>;.<713//a> if (/a href="+code=idx" class="sref">idx//a> <<0).<714//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<715//a> } else.<716//a> /a href="+code=idx" class="sref">idx//a>--;.<717//a> } else {.<718//a> if (/a href="+code=idx" class="sref">idx//a> <<1 || /a href="+code=idx" class="sref">idx//a> > 4) {.<719//a> /a href="+code=idx" class="sref">idx//a> =wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a>;.<720//a> if (/a href="+code=idx" class="sref">idx//a> <<0).<721//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<722//a> } else.<723//a> /a href="+code=idx" class="sref">idx//a>--;.<724//a> }.<725> a6.<726//a> /a href="+code=addr" class="sref">addr//a> =ext//a>->/a href="+code=addr" class="sref">addr//a>./a href="+code=sa_data" class="sref">sa_data//a>;.<727//a> if (/a href="+code=is_broadcast_ether_addr" class="sref">is_broadcast_ether_addr//a>(/a href="+code=addr" class="sref">addr//a>)).<728//a> /a href="+code=addr" class="sref">addr//a> =NULL//a>;.<729> a6.<730//a> /a href="+code=memset" class="sref">memset//a>(&/a href="+code=params" class="sref">params//a>,<0, sizeof(/a href="+code=params" class="sref">params//a>));.<731//a> /a href="+code=params" class="sref">params//a>./a href="+code=key" class="sref">key//a> =ext//a>->/a href="+code=key" class="sref">key//a>;.<732//a> /a href="+code=params" class="sref">params//a>./a href="+code=key_len" class="sref">key_len//a> =ext//a>->/a href="+code=key_len" class="sref">key_len//a>;.<733//a> /a href="+code=params" class="sref">params//a>./a href="+code=cipher" class="sref">cipher//a> =cipher//a>;.<734//a>.<735//a> if (/a href="+code=ext" class="sref">ext//a>->/a href="+code=ext_flags" class="sref">ext_flags//a> & /a href="+code=IW_ENCODE_EXT_RX_SEQ_VALID" class="sref">IW_ENCODE_EXT_RX_SEQ_VALID//a>) {.<736//a> /a href="+code=params" class="sref">params//a>./a href="+code=seq" class="sref">seq//a> =ext//a>->/a href="+code=rx_seq" class="sref">rx_seq//a>;.<737//a> /a href="+code=params" class="sref">params//a>./a href="+code=seq_len" class="sref">seq_len//a> =<6;.<738//a> }.<739> a6.<740//a> return /a href="+code=cfg80211_set_encryption" class="sref">cfg80211_set_encryption//a>(.<741//a> /a href="+code=rdev" class="sref">rdev//a>,dev//a>,.<742//a> !(/a href="+code=ext" class="sref">ext//a>->/a href="+code=ext_flags" class="sref">ext_flags//a> & /a href="+code=IW_ENCODE_EXT_GROUP_KEY" class="sref">IW_ENCODE_EXT_GROUP_KEY//a>),.<743//a> /a href="+code=addr" class="sref">addr//a>,remove//a>,.<744//a> /a href="+code=ext" class="sref">ext//a>->/a href="+code=ext_flags" class="sref">ext_flags//a> & /a href="+code=IW_ENCODE_EXT_SET_TX_KEY" class="sref">IW_ENCODE_EXT_SET_TX_KEY//a>,.<745//a> /a href="+code=idx" class="sref">idx//a>,<&/a href="+code=params" class="sref">params//a>);.<746//a>}.<747//a>.<748//a>static intcfg80211_wext_giwencode//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<749//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<750//a> structiw_point//a> */a href="+code=erq" class="sref">erq//a>, char */a href="+code=keybuf" class="sref">keybuf//a>).<751//a>{.<752//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<753//a> intidx//a>;.<754//a>.<755//a> if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a> &&.<756//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_ADHOC//a>).<757//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<758//a>.<759//a> /a href="+code=idx" class="sref">idx//a> =erq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_ENCODE_INDEX" class="sref">IW_ENCODE_INDEX//a>;.<760//a> if (/a href="+code=idx" class="sref">idx//a> ==<0) {.<761//a> /a href="+code=idx" class="sref">idx//a> =wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=default_key" class="sref">default_key//a>;.<762//a> if (/a href="+code=idx" class="sref">idx//a> <<0).<763//a> /a href="+code=idx" class="sref">idx//a> =<0;.<764//a> } else if (/a href="+code=idx" class="sref">idx//a> <<1 || /a href="+code=idx" class="sref">idx//a> > 4).<765//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<766//a> else.<767//a> /a href="+code=idx" class="sref">idx//a>--;.<768//a>.<769//a> /a href="+code=erq" class="sref">erq//a>->/a href="+code=flags" class="sref">flags//a> = /a href="+code=idx" class="sref">idx//a> + 1;.<770//a>.<771//a> if (!/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a> || !/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=cipher" class="sref">cipher//a>) {.<772//a> /a href="+code=erq" class="sref">erq//a>->/a href="+code=flags" class="sref">flags//a> |= /a href="+code=IW_ENCODE_DISABLED" class="sref">IW_ENCODE_DISABLED//a>;.<773//a> /a href="+code=erq" class="sref">erq//a>->/a href="+code=length" class="sref">length//a> =<0;.<774//a> return 0;.<775//a> }.<776> a6.<777//a> /a href="+code=erq" class="sref">erq//a>->/a href="+code=length" class="sref">length//a> =min_t//a>(/a href="+code=size_t" class="sref">size_t//a>,erq//a>->/a href="+code=length" class="sref">length//a>,.<778//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=key_len" class="sref">key_len//a>);.<779//a> /a href="+code=memcpy" class="sref">memcpy//a>(/a href="+code=keybuf" class="sref">keybuf//a>,wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=keys" class="sref">keys//a>->/a href="+code=params" class="sref">params//a>[/a href="+code=idx" class="sref">idx//a>]./a href="+code=key" class="sref">key//a>,erq//a>->/a href="+code=length" class="sref">length//a>);.<780//a> /a href="+code=erq" class="sref">erq//a>->/a href="+code=flags" class="sref">flags//a> |= /a href="+code=IW_ENCODE_ENABLED" class="sref">IW_ENCODE_ENABLED//a>;.<781//a>.<782//a> return 0;.<783//a>}.<784//a>.<785//a>static intcfg80211_wext_siwfreq//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<786//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<787//a> structiw_freq//a> */a href="+code=wextfreq" class="sref">wextfreq//a>, char */a href="+code=extra" class="sref">extra//a>).<788//a>{.<789//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<790//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<791//a> intfreq//a>, /a href="+code=err" class="sref">err//a>;.<792//a>.<793//a> switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.<794//a> case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.<795//a> return /a href="+code=cfg80211_mgd_wext_siwfreq" class="sref">cfg80211_mgd_wext_siwfreq//a>(/a href="+code=dev" class="sref">dev//a>,info//a>,wextfreq//a>, /a href="+code=extra" class="sref">extra//a>);.<796//a> case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.<797//a> return /a href="+code=cfg80211_ibss_wext_siwfreq" class="sref">cfg80211_ibss_wext_siwfreq//a>(/a href="+code=dev" class="sref">dev//a>,info//a>,wextfreq//a>, /a href="+code=extra" class="sref">extra//a>);.<798//a> case /a href="+code=NL80211_IFTYPE_MONITOR" class="sref">NL80211_IFTYPE_MONITOR//a>:.<799//a> /a href="+code=freq" class="sref">freq//a> =cfg80211_wext_freq//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,wextfreq//a>);.<800//a> if (/a href="+code=freq" class="sref">freq//a> <<0).<801//a> return /a href="+code=freq" class="sref">freq//a>;.<802//a> if (/a href="+code=freq" class="sref">freq//a> ==<0).<803//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<804//a> /a href="+code=mutex_lock" class="sref">mutex_lock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<805//a> /a href="+code=err" class="sref">err//a> =cfg80211_set_monitor_channel//a>(/a href="+code=rdev" class="sref">rdev//a>,freq//a>, /a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT//a>);.<806//a> /a href="+code=mutex_unlock" class="sref">mutex_unlock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<807//a> return /a href="+code=err" class="sref">err//a>;.<808//a> case /a href="+code=NL80211_IFTYPE_MESH_POINT" class="sref">NL80211_IFTYPE_MESH_POINT//a>:.<809//a> /a href="+code=freq" class="sref">freq//a> =cfg80211_wext_freq//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,wextfreq//a>);.<810//a> if (/a href="+code=freq" class="sref">freq//a> <<0).<811//a> return /a href="+code=freq" class="sref">freq//a>;.<812//a> if (/a href="+code=freq" class="sref">freq//a> ==<0).<813//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<814//a> /a href="+code=mutex_lock" class="sref">mutex_lock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<815//a> /a href="+code=err" class="sref">err//a> =cfg80211_set_mesh_freq//a>(/a href="+code=rdev" class="sref">rdev//a>,wdev//a>,freq//a>,.<816//a> /a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT//a>);.<817//a> /a href="+code=mutex_unlock" class="sref">mutex_unlock//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=devlist_mtx" class="sref">devlist_mtx//a>);.<818//a> return /a href="+code=err" class="sref">err//a>;.<819//a> default:.<820//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<821//a> }.<822//a>}.<823> a6.<824//a>static intcfg80211_wext_giwfreq//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<825//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<826//a> structiw_freq//a> */a href="+code=freq" class="sref">freq//a>, char */a href="+code=extra" class="sref">extra//a>).<827//a>{.<828//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<829//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<830//a> structieee80211_channel//a> */a href="+code=chan" class="sref">chan//a>;.<831//a> enumnl80211_channel_type//a> /a href="+code=channel_type" class="sref">channel_type//a>;.<832//a>.<833//a> switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.<834//a> case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.<835//a> return /a href="+code=cfg80211_mgd_wext_giwfreq" class="sref">cfg80211_mgd_wext_giwfreq//a>(/a href="+code=dev" class="sref">dev//a>,info//a>,freq//a>, /a href="+code=extra" class="sref">extra//a>);.<836//a> case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.<837//a> return /a href="+code=cfg80211_ibss_wext_giwfreq" class="sref">cfg80211_ibss_wext_giwfreq//a>(/a href="+code=dev" class="sref">dev//a>,info//a>,freq//a>, /a href="+code=extra" class="sref">extra//a>);.<838//a> case /a href="+code=NL80211_IFTYPE_MONITOR" class="sref">NL80211_IFTYPE_MONITOR//a>:.<839//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_channel" class="sref">get_channel//a>).<840//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<841//a>.<842//a> /a href="+code=chan" class="sref">chan//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_channel" class="sref">get_channel//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,wdev//a>,<&/a href="+code=channel_type" class="sref">channel_type//a>);.<843//a> if (!/a href="+code=chan" class="sref">chan//a>).<844//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<845//a> /a href="+code=freq" class="sref">freq//a>->/a href="+code=m" class="sref">m//a> =chan//a>->/a href="+code=center_freq" class="sref">center_freq//a>;.<846//a> /a href="+code=freq" class="sref">freq//a>->/a href="+code=e" class="sref">e//a> =<6;.<847//a> return 0;.<848//a> default:.<849//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<850//a> }.<851//a>}.<852//a>.<853//a>static intcfg80211_wext_siwtxpower//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<854//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<855//a> union /a href="+code=iwreq_data" class="sref">iwreq_data//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).<856//a>{.<857//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<858//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<859//a> enumnl80211_tx_power_setting//a> /a href="+code=type" class="sref">type//a>;.<860//a> intdbm//a> =<0;.<861//a>.<862//a> if ((/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_TXPOW_TYPE" class="sref">IW_TXPOW_TYPE//a>) !=IW_TXPOW_DBM//a>).<863//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<864//a> if (/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_TXPOW_RANGE" class="sref">IW_TXPOW_RANGE//a>).<865//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<866> a6.<867//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_tx_power" class="sref">set_tx_power//a>).<868//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<869> a6.<870//a> /span class="comment">/* only change when not disabling */<871//a> if (!/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=disabled" class="sref">disabled//a>) {.<872//a> /a href="+code=rfkill_set_sw_state" class="sref">rfkill_set_sw_state//a>(/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=rfkill" class="sref">rfkill//a>,false//a>);.<873> a6.<874//a> if (/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=fixed" class="sref">fixed//a>) {.<875//a> /span class="comment">/*<876> a6/span class="comment"> * wext doesn't support negative values, see<877//a>/span class="comment"> * below where it's for automatic<878//a>/span class="comment"> */<879//a> if (/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=value" class="sref">value//a> <<0).<880//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<881//a> /a href="+code=dbm" class="sref">dbm//a> =data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=value" class="sref">value//a>;.<882//a> /a href="+code=type" class="sref">type//a> =NL80211_TX_POWER_FIXED//a>;.<883//a> /span class="comment">/* TODO: do regulatory check! */<884//a> } else {.<885//a> /span class="comment">/*<886> a6/span class="comment"> * Automatic power level setting, max being the value<887//a>/span class="comment"> * passed in from userland.<888//a>/span class="comment"> */<889//a> if (/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=value" class="sref">value//a> <<0) {.<890//a> /a href="+code=type" class="sref">type//a> =NL80211_TX_POWER_AUTOMATIC//a>;.<891//a> } else {.<892//a> /a href="+code=dbm" class="sref">dbm//a> =data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=value" class="sref">value//a>;.<893//a> /a href="+code=type" class="sref">type//a> =NL80211_TX_POWER_LIMITED//a>;.<894//a> }.<895//a> }.<896//a> } else {.<897//a> /a href="+code=rfkill_set_sw_state" class="sref">rfkill_set_sw_state//a>(/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=rfkill" class="sref">rfkill//a>,true//a>);.<898//a> /a href="+code=schedule_work" class="sref">schedule_work//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=rfkill_sync" class="sref">rfkill_sync//a>);.<899//a> return 0;.<900//a> }.<901//a>.<902//a> return /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_tx_power" class="sref">set_tx_power//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,type//a>,DBM_TO_MBM//a>(/a href="+code=dbm" class="sref">dbm//a>));.<903//a>}.<904//a>.<905//a>static intcfg80211_wext_giwtxpower//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.<906//a> structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.<907//a> union /a href="+code=iwreq_data" class="sref">iwreq_data//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).<908//a>{.<909//a> structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> =dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.<910//a> structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> =wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.<911//a> interr//a>,val//a>;.<912//a>.<913//a> if ((/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_TXPOW_TYPE" class="sref">IW_TXPOW_TYPE//a>) !=IW_TXPOW_DBM//a>).<914//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<915//a> if (/a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_TXPOW_RANGE" class="sref">IW_TXPOW_RANGE//a>).<916//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<917//a>.<918//a> if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_tx_power" class="sref">get_tx_power//a>).<919//a> return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.<920//a>.<921//a> /a href="+code=err" class="sref">err//a> =rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_tx_power" class="sref">get_tx_power//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,<&/a href="+code=val" class="sref">val//a>);.<922//a> if (/a href="+code=err" class="sref">err//a>).<923//a> return /a href="+code=err" class="sref">err//a>;.<924//a>.<925//a> /span class="comment">/* well... oh well */<926//a> /a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=fixed" class="sref">fixed//a> =<1;.<927//a> /a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=disabled" class="sref">disabled//a> =rfkill_blocked//a>(/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=rfkill" class="sref">rfkill//a>);.<928//a> /a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=value" class="sref">value//a> =val//a>;.<929//a> /a href="+code=data" class="sref">data//a>->/a href="+code=txpower" class="sref">txpower//a>./a href="+code=flags" class="sref">flags//a> =IW_TXPOW_DBM//a>;.<930//a>.<931//a> return 0;.<932//a>}.<933> a6.<934//a>static intcfg80211_set_auth_alg//a>(structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a>,.<935//a> /a href="+code=s32" class="sref">s32//a> /a href="+code=auth_alg" class="sref">auth_alg//a>).<936//a>{.<937//a> intnr_alg//a> =<0;.<938//a>.<939//a> if (!/a href="+code=auth_alg" class="sref">auth_alg//a>).<940//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<941//a>.<942//a> if (/a href="+code=auth_alg" class="sref">auth_alg//a> & ~(/a href="+code=IW_AUTH_ALG_OPEN_SYSTEM" class="sref">IW_AUTH_ALG_OPEN_SYSTEM//a> |.<943//a> /a href="+code=IW_AUTH_ALG_SHARED_KEY" class="sref">IW_AUTH_ALG_SHARED_KEY//a> |.<944//a> /a href="+code=IW_AUTH_ALG_LEAP" class="sref">IW_AUTH_ALG_LEAP//a>)).<945//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<946> a6.<947//a> if (/a href="+code=auth_alg" class="sref">auth_alg//a> & /a href="+code=IW_AUTH_ALG_OPEN_SYSTEM" class="sref">IW_AUTH_ALG_OPEN_SYSTEM//a>) {.<948//a> /a href="+code=nr_alg" class="sref">nr_alg//a>++;.<949//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=auth_type" class="sref">auth_type//a> =NL80211_AUTHTYPE_OPEN_SYSTEM//a>;.<950//a> }.<951//a>.<952//a> if (/a href="+code=auth_alg" class="sref">auth_alg//a> & /a href="+code=IW_AUTH_ALG_SHARED_KEY" class="sref">IW_AUTH_ALG_SHARED_KEY//a>) {.<953//a> /a href="+code=nr_alg" class="sref">nr_alg//a>++;.<954//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=auth_type" class="sref">auth_type//a> =NL80211_AUTHTYPE_SHARED_KEY//a>;.<955//a> }.<956> a6.<957//a> if (/a href="+code=auth_alg" class="sref">auth_alg//a> & /a href="+code=IW_AUTH_ALG_LEAP" class="sref">IW_AUTH_ALG_LEAP//a>) {.<958//a> /a href="+code=nr_alg" class="sref">nr_alg//a>++;.<959//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=auth_type" class="sref">auth_type//a> =NL80211_AUTHTYPE_NETWORK_EAP//a>;.<960//a> }.<961//a>.<962//a> if (/a href="+code=nr_alg" class="sref">nr_alg//a> > 1).<963//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=auth_type" class="sref">auth_type//a> =NL80211_AUTHTYPE_AUTOMATIC//a>;.<964//a>.<965//a> return 0;.<966> a6}.<967//a>.<968//a>static intcfg80211_set_wpa_version//a>(structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a>,u32//a> /a href="+code=wpa_versions" class="sref">wpa_versions//a>).<969> a6{.<970//a> if (/a href="+code=wpa_versions" class="sref">wpa_versions//a> & ~(/a href="+code=IW_AUTH_WPA_VERSION_WPA" class="sref">IW_AUTH_WPA_VERSION_WPA//a> |.<971//a> /a href="+code=IW_AUTH_WPA_VERSION_WPA2" class="sref">IW_AUTH_WPA_VERSION_WPA2//a>|.<972//a> /a href="+code=IW_AUTH_WPA_VERSION_DISABLED" class="sref">IW_AUTH_WPA_VERSION_DISABLED//a>)).<973//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<974//a>.<975//a> if ((/a href="+code=wpa_versions" class="sref">wpa_versions//a> & /a href="+code=IW_AUTH_WPA_VERSION_DISABLED" class="sref">IW_AUTH_WPA_VERSION_DISABLED//a>) &&.<976//a> (/a href="+code=wpa_versions" class="sref">wpa_versions//a> & (/a href="+code=IW_AUTH_WPA_VERSION_WPA" class="sref">IW_AUTH_WPA_VERSION_WPA//a>|.<977//a> /a href="+code=IW_AUTH_WPA_VERSION_WPA2" class="sref">IW_AUTH_WPA_VERSION_WPA2//a>))).<978//a> return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.<979> a6.<980//a> if (/a href="+code=wpa_versions" class="sref">wpa_versions//a> & /a href="+code=IW_AUTH_WPA_VERSION_DISABLED" class="sref">IW_AUTH_WPA_VERSION_DISABLED//a>).<981//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=wpa_versions" class="sref">wpa_versions//a> &=.<982//a> ~(/a href="+code=NL80211_WPA_VERSION_1" class="sref">NL80211_WPA_VERSION_1//a>|/a href="+code=NL80211_WPA_VERSION_2" class="sref">NL80211_WPA_VERSION_2//a>);.<983> a6.<984//a> if (/a href="+code=wpa_versions" class="sref">wpa_versions//a> & /a href="+code=IW_AUTH_WPA_VERSION_WPA" class="sref">IW_AUTH_WPA_VERSION_WPA//a>).<985//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=wpa_versions" class="sref">wpa_versions//a> |=.<986//a> /a href="+code=NL80211_WPA_VERSION_1" class="sref">NL80211_WPA_VERSION_1//a>;.<987//a>.<988//a> if (/a href="+code=wpa_versions" class="sref">wpa_versions//a> & /a href="+code=IW_AUTH_WPA_VERSION_WPA2" class="sref">IW_AUTH_WPA_VERSION_WPA2//a>).<989//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=wpa_versions" class="sref">wpa_versions//a> |=.<990//a> /a href="+code=NL80211_WPA_VERSION_2" class="sref">NL80211_WPA_VERSION_2//a>;.<991//a>.<992//a> return 0;.<993//a>}.<994//a>.<995//a>static intcfg80211_set_cipher_group//a>(structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a>,u32//a> /a href="+code=cipher" class="sref">cipher//a>).<996//a>{.<997//a> if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_WEP40" class="sref">IW_AUTH_CIPHER_WEP40//a>).<998//a> /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> =.<999//a> /a href="+code=WLAN_CIPHER_SUITE_WEP40" class="sref">WLAN_CIPHER_SUITE_WEP40//a>;.1000//a> else if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_WEP104" class="sref">IW_AUTH_CIPHER_WEP104//a>).
1001//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> =.1002//a>                        /a href="+code=WLAN_CIPHER_SUITE_WEP104" class="sref">WLAN_CIPHER_SUITE_WEP104//a>;.1003//a>        else if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_TKIP" class="sref">IW_AUTH_CIPHER_TKIP//a>).1004//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> =.1005//a>                        /a href="+code=WLAN_CIPHER_SUITE_TKIP" class="sref">WLAN_CIPHER_SUITE_TKIP//a>;.1006//a>        else if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_CCMP" class="sref">IW_AUTH_CIPHER_CCMP//a>).1007//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> =.1008//a>                        /a href="+code=WLAN_CIPHER_SUITE_CCMP" class="sref">WLAN_CIPHER_SUITE_CCMP//a>;.1009//a>        else if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_AES_CMAC" class="sref">IW_AUTH_CIPHER_AES_CMAC//a>).1010//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> =.1011//a>                        /a href="+code=WLAN_CIPHER_SUITE_AES_CMAC" class="sref">WLAN_CIPHER_SUITE_AES_CMAC//a>;.1012//a>        else if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_NONE" class="sref">IW_AUTH_CIPHER_NONE//a>).1013//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=cipher_group" class="sref">cipher_group//a> = 0;.1014//a>        else.1015//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1016>
a6.1017//a>        return 0;.1018//a>}.1019>
a6.1020//a>static intcfg80211_set_cipher_pairwise//a>(structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a>,u32//a> /a href="+code=cipher" class="sref">cipher//a>).1021//a>{.1022//a>        intnr_ciphers//a> = 0;.1023//a>        /a href="+code=u32" class="sref">u32//a> */a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a> = /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>;.1024//a>.1025//a>        if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_WEP40" class="sref">IW_AUTH_CIPHER_WEP40//a>) {.1026//a>                /a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>[/a href="+code=nr_ciphers" class="sref">nr_ciphers//a>] = /a href="+code=WLAN_CIPHER_SUITE_WEP40" class="sref">WLAN_CIPHER_SUITE_WEP40//a>;.1027//a>                /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>++;.1028//a>        }.1029>
a6.1030//a>        if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_WEP104" class="sref">IW_AUTH_CIPHER_WEP104//a>) {.1031//a>                /a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>[/a href="+code=nr_ciphers" class="sref">nr_ciphers//a>] = /a href="+code=WLAN_CIPHER_SUITE_WEP104" class="sref">WLAN_CIPHER_SUITE_WEP104//a>;.1032//a>                /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>++;.1033//a>        }.1034//a>.1035//a>        if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_TKIP" class="sref">IW_AUTH_CIPHER_TKIP//a>) {.1036//a>                /a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>[/a href="+code=nr_ciphers" class="sref">nr_ciphers//a>] = /a href="+code=WLAN_CIPHER_SUITE_TKIP" class="sref">WLAN_CIPHER_SUITE_TKIP//a>;.1037//a>                /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>++;.1038//a>        }.1039>
a6.1040//a>        if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_CCMP" class="sref">IW_AUTH_CIPHER_CCMP//a>) {.1041//a>                /a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>[/a href="+code=nr_ciphers" class="sref">nr_ciphers//a>] = /a href="+code=WLAN_CIPHER_SUITE_CCMP" class="sref">WLAN_CIPHER_SUITE_CCMP//a>;.1042//a>                /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>++;.1043//a>        }.1044//a>.1045//a>        if (/a href="+code=cipher" class="sref">cipher//a> & /a href="+code=IW_AUTH_CIPHER_AES_CMAC" class="sref">IW_AUTH_CIPHER_AES_CMAC//a>) {.1046//a>                /a href="+code=ciphers_pairwise" class="sref">ciphers_pairwise//a>[/a href="+code=nr_ciphers" class="sref">nr_ciphers//a>] = /a href="+code=WLAN_CIPHER_SUITE_AES_CMAC" class="sref">WLAN_CIPHER_SUITE_AES_CMAC//a>;.1047//a>                /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>++;.1048//a>        }.1049>
a6.1050//a>        /a href="+code=BUILD_BUG_ON" class="sref">BUILD_BUG_ON//a>(/a href="+code=NL80211_MAX_NR_CIPHER_SUITES" class="sref">NL80211_MAX_NR_CIPHER_SUITES//a> <<5);.1051//a>.1052//a>        /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=n_ciphers_pairwise" class="sref">n_ciphers_pairwise//a> = /a href="+code=nr_ciphers" class="sref">nr_ciphers//a>;.1053>
a6.1054//a>        return 0;.1055//a>}.1056>
a6.1057//a>.1058//a>static intcfg80211_set_key_mgt//a>(structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a>,u32//a> /a href="+code=key_mgt" class="sref">key_mgt//a>).1059>
a6{.1060//a>        intnr_akm_suites//a> = 0;.1061//a>.1062//a>        if (/a href="+code=key_mgt" class="sref">key_mgt//a> & ~(/a href="+code=IW_AUTH_KEY_MGMT_802_1X" class="sref">IW_AUTH_KEY_MGMT_802_1X//a> |.1063//a>                        /a href="+code=IW_AUTH_KEY_MGMT_PSK" class="sref">IW_AUTH_KEY_MGMT_PSK//a>)).1064//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1065//a>.1066//a>        if (/a href="+code=key_mgt" class="sref">key_mgt//a> & /a href="+code=IW_AUTH_KEY_MGMT_802_1X" class="sref">IW_AUTH_KEY_MGMT_802_1X//a>) {.1067//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=akm_suites" class="sref">akm_suites//a>[/a href="+code=nr_akm_suites" class="sref">nr_akm_suites//a>] =.1068//a>                        /a href="+code=WLAN_AKM_SUITE_8021X" class="sref">WLAN_AKM_SUITE_8021X//a>;.1069//a>                /a href="+code=nr_akm_suites" class="sref">nr_akm_suites//a>++;.1070//a>        }.1071//a>.1072//a>        if (/a href="+code=key_mgt" class="sref">key_mgt//a> & /a href="+code=IW_AUTH_KEY_MGMT_PSK" class="sref">IW_AUTH_KEY_MGMT_PSK//a>) {.1073//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=akm_suites" class="sref">akm_suites//a>[/a href="+code=nr_akm_suites" class="sref">nr_akm_suites//a>] =.1074//a>                        /a href="+code=WLAN_AKM_SUITE_PSK" class="sref">WLAN_AKM_SUITE_PSK//a>;.1075//a>                /a href="+code=nr_akm_suites" class="sref">nr_akm_suites//a>++;.1076//a>        }.1077//a>.1078//a>        /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=crypto" class="sref">crypto//a>./a href="+code=n_akm_suites" class="sref">n_akm_suites//a> = /a href="+code=nr_akm_suites" class="sref">nr_akm_suites//a>;.1079>
a6.1080//a>        return 0;.1081//a>}.1082//a>.1083//a>static intcfg80211_wext_siwauth//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1084//a>                                 structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1085//a>                                 structiw_param//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).1086//a>{.1087//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1088//a>.1089//a>        if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).1090//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1091//a>.1092//a>        switch (/a href="+code=data" class="sref">data//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_AUTH_INDEX" class="sref">IW_AUTH_INDEX//a>) {.1093//a>        case /a href="+code=IW_AUTH_PRIVACY_INVOKED" class="sref">IW_AUTH_PRIVACY_INVOKED//a>:.1094//a>                /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=connect" class="sref">connect//a>./a href="+code=privacy" class="sref">privacy//a> = /a href="+code=data" class="sref">data//a>->/a href="+code=value" class="sref">value//a>;.1095//a>                return 0;.1096//a>        case /a href="+code=IW_AUTH_WPA_VERSION" class="sref">IW_AUTH_WPA_VERSION//a>:.1097//a>                return /a href="+code=cfg80211_set_wpa_version" class="sref">cfg80211_set_wpa_version//a>(/a href="+code=wdev" class="sref">wdev//a>,data//a>->/a href="+code=value" class="sref">value//a>);.1098//a>        case /a href="+code=IW_AUTH_CIPHER_GROUP" class="sref">IW_AUTH_CIPHER_GROUP//a>:.1099//a>                return /a href="+code=cfg80211_set_cipher_group" class="sref">cfg80211_set_cipher_group//a>(/a href="+code=wdev" class="sref">wdev//a>,data//a>->/a href="+code=value" class="sref">value//a>);.1100//a>        case /a href="+code=IW_AUTH_KEY_MGMT" class="sref">IW_AUTH_KEY_MGMT//a>:.1101//a>                return /a href="+code=cfg80211_set_key_mgt" class="sref">cfg80211_set_key_mgt//a>(/a href="+code=wdev" class="sref">wdev//a>,data//a>->/a href="+code=value" class="sref">value//a>);.1102//a>        case /a href="+code=IW_AUTH_CIPHER_PAIRWISE" class="sref">IW_AUTH_CIPHER_PAIRWISE//a>:.1103//a>                return /a href="+code=cfg80211_set_cipher_pairwise" class="sref">cfg80211_set_cipher_pairwise//a>(/a href="+code=wdev" class="sref">wdev//a>,data//a>->/a href="+code=value" class="sref">value//a>);.1104//a>        case /a href="+code=IW_AUTH_80211_AUTH_ALG" class="sref">IW_AUTH_80211_AUTH_ALG//a>:.1105//a>                return /a href="+code=cfg80211_set_auth_alg" class="sref">cfg80211_set_auth_alg//a>(/a href="+code=wdev" class="sref">wdev//a>,data//a>->/a href="+code=value" class="sref">value//a>);.1106//a>        case /a href="+code=IW_AUTH_WPA_ENABLED" class="sref">IW_AUTH_WPA_ENABLED//a>:.1107//a>        case /a href="+code=IW_AUTH_RX_UNENCRYPTED_EAPOL" class="sref">IW_AUTH_RX_UNENCRYPTED_EAPOL//a>:.1108//a>        case /a href="+code=IW_AUTH_DROP_UNENCRYPTED" class="sref">IW_AUTH_DROP_UNENCRYPTED//a>:.1109//a>        case /a href="+code=IW_AUTH_MFP" class="sref">IW_AUTH_MFP//a>:.1110//a>                return 0;.1111//a>        default:.1112//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1113//a>        }.1114//a>}.1115//a>.1116>
a6static intcfg80211_wext_giwauth//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1117//a>                                 structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1118//a>                                 structiw_param//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).1119>
a6{.1120//a>        /span class="comment">/* XXX: what do we need? */.1121//a>.1122//a>        return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1123//a>}.1124//a>.1125//a>static intcfg80211_wext_siwpower//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1126//a>                                  structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1127//a>                                  structiw_param//a> */a href="+code=wrq" class="sref">wrq//a>, char */a href="+code=extra" class="sref">extra//a>).1128//a>{.1129//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1130//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1131//a>        /a href="+code=bool" class="sref">bool//a> /a href="+code=ps" class="sref">ps//a> = /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=ps" class="sref">ps//a>;.1132//a>        inttimeout//a> = /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=ps_timeout" class="sref">ps_timeout//a>;.1133//a>        interr//a>;.1134//a>.1135//a>        if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).1136//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1137//a>.1138//a>        if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_power_mgmt" class="sref">set_power_mgmt//a>).1139//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1140//a>.1141//a>        if (/a href="+code=wrq" class="sref">wrq//a>->/a href="+code=disabled" class="sref">disabled//a>) {.1142//a>                /a href="+code=ps" class="sref">ps//a> = /a href="+code=false" class="sref">false//a>;.1143//a>        } else {.1144//a>                switch (/a href="+code=wrq" class="sref">wrq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_POWER_MODE" class="sref">IW_POWER_MODE//a>) {.1145//a>                case /a href="+code=IW_POWER_ON" class="sref">IW_POWER_ON//a>:       /span class="comment">/* If not specified */.1146//a>                case /a href="+code=IW_POWER_MODE" class="sref">IW_POWER_MODE//a>:     /span class="comment">/* If set all mask */.1147//a>                case /a href="+code=IW_POWER_ALL_R" class="sref">IW_POWER_ALL_R//a>:    /span class="comment">/* If explicitely state all */.1148//a>                        /a href="+code=ps" class="sref">ps//a> = /a href="+code=true" class="sref">true//a>;.1149//a>                        break;.1150//a>                default:                /span class="comment">/* Otherwise we ignore */.1151//a>                        return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1152//a>                }.1153>
a6.1154//a>                if (/a href="+code=wrq" class="sref">wrq//a>->/a href="+code=flags" class="sref">flags//a> & ~(/a href="+code=IW_POWER_MODE" class="sref">IW_POWER_MODE//a> | /a href="+code=IW_POWER_TIMEOUT" class="sref">IW_POWER_TIMEOUT//a>)).1155//a>                        return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1156>
a6.1157//a>                if (/a href="+code=wrq" class="sref">wrq//a>->/a href="+code=flags" class="sref">flags//a> & /a href="+code=IW_POWER_TIMEOUT" class="sref">IW_POWER_TIMEOUT//a>).1158//a>                        /a href="+code=timeout" class="sref">timeout//a> = /a href="+code=wrq" class="sref">wrq//a>->/a href="+code=value" class="sref">value//a> / 1000;.1159//a>        }.1160//a>.1161//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_power_mgmt" class="sref">set_power_mgmt//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, /a href="+code=ps" class="sref">ps//a>, /a href="+code=timeout" class="sref">timeout//a>);.1162//a>        if (/a href="+code=err" class="sref">err//a>).1163//a>                return /a href="+code=err" class="sref">err//a>;.1164//a>.1165//a>        /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=ps" class="sref">ps//a> = /a href="+code=ps" class="sref">ps//a>;.1166//a>        /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=ps_timeout" class="sref">ps_timeout//a> = /a href="+code=timeout" class="sref">timeout//a>;.1167//a>.1168//a>        return 0;.1169>
a6.1170//a>}.1171//a>.1172//a>static intcfg80211_wext_giwpower//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1173//a>                                  structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1174//a>                                  structiw_param//a> */a href="+code=wrq" class="sref">wrq//a>, char */a href="+code=extra" class="sref">extra//a>).1175//a>{.1176//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1177//a>.1178//a>        /a href="+code=wrq" class="sref">wrq//a>->/a href="+code=disabled" class="sref">disabled//a> = !/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=ps" class="sref">ps//a>;.1179>
a6.1180//a>        return 0;.1181//a>}.1182//a>.1183//a>static intcfg80211_wds_wext_siwap//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1184//a>                                   structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1185//a>                                   structsockaddr//a> */a href="+code=addr" class="sref">addr//a>, char */a href="+code=extra" class="sref">extra//a>).1186//a>{.1187//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1188//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1189//a>        interr//a>;.1190//a>.1191//a>        if (/a href="+code=WARN_ON" class="sref">WARN_ON//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_WDS//a>)).1192//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1193>
a6.1194//a>        if (/a href="+code=addr" class="sref">addr//a>->/a href="+code=sa_family" class="sref">sa_family//a> !=ARPHRD_ETHER//a>).1195//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1196>
a6.1197//a>        if (/a href="+code=netif_running" class="sref">netif_running//a>(/a href="+code=dev" class="sref">dev//a>)).1198//a>                return -/a href="+code=EBUSY" class="sref">EBUSY//a>;.1199>
a6.1200//a>        if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_wds_peer" class="sref">set_wds_peer//a>).1201//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1202//a>.1203//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_wds_peer" class="sref">set_wds_peer//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, (/a href="+code=u8" class="sref">u8//a> *) &/a href="+code=addr" class="sref">addr//a>->/a href="+code=sa_data" class="sref">sa_data//a>);.1204//a>        if (/a href="+code=err" class="sref">err//a>).1205//a>                return /a href="+code=err" class="sref">err//a>;.1206>
a6.1207//a>        /a href="+code=memcpy" class="sref">memcpy//a>(&/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=bssid" class="sref">bssid//a>, (/a href="+code=u8" class="sref">u8//a> *) &/a href="+code=addr" class="sref">addr//a>->/a href="+code=sa_data" class="sref">sa_data//a>,ETH_ALEN//a>);.1208//a>.1209//a>        return 0;.1210//a>}.1211//a>.1212//a>static intcfg80211_wds_wext_giwap//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1213//a>                                   structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1214//a>                                   structsockaddr//a> */a href="+code=addr" class="sref">addr//a>, char */a href="+code=extra" class="sref">extra//a>).1215//a>{.1216//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1217//a>.1218//a>        if (/a href="+code=WARN_ON" class="sref">WARN_ON//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_WDS//a>)).1219//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1220//a>.1221//a>        /a href="+code=addr" class="sref">addr//a>->/a href="+code=sa_family" class="sref">sa_family//a> =ARPHRD_ETHER//a>;.1222//a>        /a href="+code=memcpy" class="sref">memcpy//a>(&/a href="+code=addr" class="sref">addr//a>->/a href="+code=sa_data" class="sref">sa_data//a>,wdev//a>->/a href="+code=wext" class="sref">wext//a>./a href="+code=bssid" class="sref">bssid//a>, /a href="+code=ETH_ALEN" class="sref">ETH_ALEN//a>);.1223>
a6.1224//a>        return 0;.1225//a>}.1226>
a6.1227//a>static intcfg80211_wext_siwrate//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1228//a>                                 structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1229//a>                                 structiw_param//a> */a href="+code=rate" class="sref">rate//a>, char */a href="+code=extra" class="sref">extra//a>).1230//a>{.1231//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1232//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1233//a>        structcfg80211_bitrate_mask//a> /a href="+code=mask" class="sref">mask//a>;.1234//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=fixed" class="sref">fixed//a>, /a href="+code=maxrate" class="sref">maxrate//a>;.1235//a>        structieee80211_supported_band//a> */a href="+code=sband" class="sref">sband//a>;.1236//a>        intband//a>, /a href="+code=ridx" class="sref">ridx//a>;.1237//a>        /a href="+code=bool" class="sref">bool//a> /a href="+code=match" class="sref">match//a> = /a href="+code=false" class="sref">false//a>;.1238//a>.1239//a>        if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_bitrate_mask" class="sref">set_bitrate_mask//a>).1240//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1241//a>.1242//a>        /a href="+code=memset" class="sref">memset//a>(&/a href="+code=mask" class="sref">mask//a>, 0, sizeof(/a href="+code=mask" class="sref">mask//a>));.1243//a>        /a href="+code=fixed" class="sref">fixed//a> = 0;.1244//a>        /a href="+code=maxrate" class="sref">maxrate//a> = (/a href="+code=u32" class="sref">u32//a>)-1;.1245//a>.1246//a>        if (/a href="+code=rate" class="sref">rate//a>->/a href="+code=value" class="sref">value//a> < 0) {.1247//a>                /span class="comment">/* nothing */.1248//a>        } else if (/a href="+code=rate" class="sref">rate//a>->/a href="+code=fixed" class="sref">fixed//a>) {.1249//a>                /a href="+code=fixed" class="sref">fixed//a> = /a href="+code=rate" class="sref">rate//a>->/a href="+code=value" class="sref">value//a> / 100000;.1250//a>        } else {.1251//a>                /a href="+code=maxrate" class="sref">maxrate//a> = /a href="+code=rate" class="sref">rate//a>->/a href="+code=value" class="sref">value//a> / 100000;.1252//a>        }.1253>
a6.1254//a>        for (/a href="+code=band" class="sref">band//a> = 0;band//a> < /a href="+code=IEEE80211_NUM_BANDS" class="sref">IEEE80211_NUM_BANDS//a>;band//a>++) {.1255//a>                /a href="+code=sband" class="sref">sband//a> = /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>->/a href="+code=bands" class="sref">bands//a>[/a href="+code=band" class="sref">band//a>];.1256//a>                if (/a href="+code=sband" class="sref">sband//a> ==NULL//a>).1257//a>                        continue;.1258//a>                for (/a href="+code=ridx" class="sref">ridx//a> = 0;ridx//a> < /a href="+code=sband" class="sref">sband//a>->/a href="+code=n_bitrates" class="sref">n_bitrates//a>;ridx//a>++) {.1259//a>                        structieee80211_rate//a> */a href="+code=srate" class="sref">srate//a> = &/a href="+code=sband" class="sref">sband//a>->/a href="+code=bitrates" class="sref">bitrates//a>[/a href="+code=ridx" class="sref">ridx//a>];.1260//a>                        if (/a href="+code=fixed" class="sref">fixed//a> ==srate//a>->/a href="+code=bitrate" class="sref">bitrate//a>) {.1261//a>                                /a href="+code=mask" class="sref">mask//a>./a href="+code=control" class="sref">control//a>[/a href="+code=band" class="sref">band//a>]./a href="+code=legacy" class="sref">legacy//a> = 1 << /a href="+code=ridx" class="sref">ridx//a>;.1262//a>                                /a href="+code=match" class="sref">match//a> = /a href="+code=true" class="sref">true//a>;.1263//a>                                break;.1264//a>                        }.1265//a>                        if (/a href="+code=srate" class="sref">srate//a>->/a href="+code=bitrate" class="sref">bitrate//a> <= /a href="+code=maxrate" class="sref">maxrate//a>) {.1266//a>                                /a href="+code=mask" class="sref">mask//a>./a href="+code=control" class="sref">control//a>[/a href="+code=band" class="sref">band//a>]./a href="+code=legacy" class="sref">legacy//a> |= 1 << /a href="+code=ridx" class="sref">ridx//a>;.1267//a>                                /a href="+code=match" class="sref">match//a> = /a href="+code=true" class="sref">true//a>;.1268//a>                        }.1269//a>                }.1270//a>        }.1271//a>.1272//a>        if (!/a href="+code=match" class="sref">match//a>).1273//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1274//a>.1275//a>        return /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_bitrate_mask" class="sref">set_bitrate_mask//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, /a href="+code=NULL" class="sref">NULL//a>, &/a href="+code=mask" class="sref">mask//a>);.1276//a>}.1277//a>.1278//a>static intcfg80211_wext_giwrate//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1279//a>                                 structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1280//a>                                 structiw_param//a> */a href="+code=rate" class="sref">rate//a>, char */a href="+code=extra" class="sref">extra//a>).1281//a>{.1282//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1283//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1284//a>        /span class="comment">/* we are under RTNL - globally locked - so can use a static struct<*/.1285//a>        static structstation_info//a> /a href="+code=sinfo" class="sref">sinfo//a>;.1286//a>        /a href="+code=u8" class="sref">u8//a> /a href="+code=addr" class="sref">addr//a>[/a href="+code=ETH_ALEN" class="sref">ETH_ALEN//a>];.1287//a>        interr//a>;.1288//a>.1289//a>        if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).1290//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1291//a>.1292//a>        if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_station" class="sref">get_station//a>).1293//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1294//a>.1295//a>        /a href="+code=err" class="sref">err//a> = 0;.1296//a>        /a href="+code=wdev_lock" class="sref">wdev_lock//a>(/a href="+code=wdev" class="sref">wdev//a>);.1297//a>        if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>).1298//a>                /a href="+code=memcpy" class="sref">memcpy//a>(/a href="+code=addr" class="sref">addr//a>,wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>->/a href="+code=pub" class="sref">pub//a>./a href="+code=bssid" class="sref">bssid//a>, /a href="+code=ETH_ALEN" class="sref">ETH_ALEN//a>);.1299//a>        else.1300//a>                /a href="+code=err" class="sref">err//a> = -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1301//a>        /a href="+code=wdev_unlock" class="sref">wdev_unlock//a>(/a href="+code=wdev" class="sref">wdev//a>);.1302//a>        if (/a href="+code=err" class="sref">err//a>).1303//a>                return /a href="+code=err" class="sref">err//a>;.1304//a>.1305//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_station" class="sref">get_station//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, /a href="+code=addr" class="sref">addr//a>,<&/a href="+code=sinfo" class="sref">sinfo//a>);.1306//a>        if (/a href="+code=err" class="sref">err//a>).1307//a>                return /a href="+code=err" class="sref">err//a>;.1308//a>.1309//a>        if (!(/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=filled" class="sref">filled//a> & /a href="+code=STATION_INFO_TX_BITRATE" class="sref">STATION_INFO_TX_BITRATE//a>)).1310//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1311//a>.1312//a>        /a href="+code=rate" class="sref">rate//a>->/a href="+code=value" class="sref">value//a> = 100000 *cfg80211_calculate_bitrate//a>(&/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=txrate" class="sref">txrate//a>);.1313>
a6.1314//a>        return 0;.1315//a>}.1316>
a6.1317//a>/span class="comment">/* Get wireless statistics.  Called by /proc/net/wireless and by SIOCGIWSTATS<*/.1318//a>static structiw_statistics//a> */a href="+code=cfg80211_wireless_stats" class="sref">cfg80211_wireless_stats//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>).1319//a>{.1320//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1321//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1322//a>        /span class="comment">/* we are under RTNL - globally locked - so can use static structs<*/.1323//a>        static structiw_statistics//a> /a href="+code=wstats" class="sref">wstats//a>;.1324//a>        static structstation_info//a> /a href="+code=sinfo" class="sref">sinfo//a>;.1325//a>        /a href="+code=u8" class="sref">u8//a> /a href="+code=bssid" class="sref">bssid//a>[/a href="+code=ETH_ALEN" class="sref">ETH_ALEN//a>];.1326>
a6.1327//a>        if (/a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).1328//a>                return /a href="+code=NULL" class="sref">NULL//a>;.1329>
a6.1330//a>        if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_station" class="sref">get_station//a>).1331//a>                return /a href="+code=NULL" class="sref">NULL//a>;.1332//a>.1333//a>        /span class="comment">/* Grab BSSID of current BSS, if any<*/.1334//a>        /a href="+code=wdev_lock" class="sref">wdev_lock//a>(/a href="+code=wdev" class="sref">wdev//a>);.1335//a>        if (!/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>) {.1336//a>                /a href="+code=wdev_unlock" class="sref">wdev_unlock//a>(/a href="+code=wdev" class="sref">wdev//a>);.1337//a>                return /a href="+code=NULL" class="sref">NULL//a>;.1338//a>        }.1339//a>        /a href="+code=memcpy" class="sref">memcpy//a>(/a href="+code=bssid" class="sref">bssid//a>, /a href="+code=wdev" class="sref">wdev//a>->/a href="+code=current_bss" class="sref">current_bss//a>->/a href="+code=pub" class="sref">pub//a>./a href="+code=bssid" class="sref">bssid//a>, /a href="+code=ETH_ALEN" class="sref">ETH_ALEN//a>);.1340//a>        /a href="+code=wdev_unlock" class="sref">wdev_unlock//a>(/a href="+code=wdev" class="sref">wdev//a>);.1341//a>.1342//a>        if (/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=get_station" class="sref">get_station//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, /a href="+code=bssid" class="sref">bssid//a>, &/a href="+code=sinfo" class="sref">sinfo//a>)).1343//a>                return /a href="+code=NULL" class="sref">NULL//a>;.1344//a>.1345//a>        /a href="+code=memset" class="sref">memset//a>(&/a href="+code=wstats" class="sref">wstats//a>, 0, sizeof(/a href="+code=wstats" class="sref">wstats//a>));.1346>
a6.1347//a>        switch (/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>./a href="+code=signal_type" class="sref">signal_type//a>) {.1348//a>        case /a href="+code=CFG80211_SIGNAL_TYPE_MBM" class="sref">CFG80211_SIGNAL_TYPE_MBM//a>:.1349//a>                if (/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=filled" class="sref">filled//a> & /a href="+code=STATION_INFO_SIGNAL" class="sref">STATION_INFO_SIGNAL//a>) {.1350//a>                        intsig//a> = /a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=signal" class="sref">signal//a>;.1351//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_LEVEL_UPDATED" class="sref">IW_QUAL_LEVEL_UPDATED//a>;.1352//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_QUAL_UPDATED" class="sref">IW_QUAL_QUAL_UPDATED//a>;.1353//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_DBM" class="sref">IW_QUAL_DBM//a>;.1354//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=level" class="sref">level//a> = /a href="+code=sig" class="sref">sig//a>;.1355//a>                        if (/a href="+code=sig" class="sref">sig//a> < -110).1356//a>                                /a href="+code=sig" class="sref">sig//a> = -110;.1357//a>                        else if (/a href="+code=sig" class="sref">sig//a> > -40).1358//a>                                /a href="+code=sig" class="sref">sig//a> = -40;.1359//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=qual" class="sref">qual//a> = /a href="+code=sig" class="sref">sig//a> + 110;.1360//a>                        break;.1361//a>                }.1362//a>        case /a href="+code=CFG80211_SIGNAL_TYPE_UNSPEC" class="sref">CFG80211_SIGNAL_TYPE_UNSPEC//a>:.1363//a>                if (/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=filled" class="sref">filled//a> & /a href="+code=STATION_INFO_SIGNAL" class="sref">STATION_INFO_SIGNAL//a>) {.1364//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_LEVEL_UPDATED" class="sref">IW_QUAL_LEVEL_UPDATED//a>;.1365//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_QUAL_UPDATED" class="sref">IW_QUAL_QUAL_UPDATED//a>;.1366//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=level" class="sref">level//a> = /a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=signal" class="sref">signal//a>;.1367//a>                        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=qual" class="sref">qual//a> = /a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=signal" class="sref">signal//a>;.1368//a>                        break;.1369//a>                }.1370//a>        default:.1371//a>                /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_LEVEL_INVALID" class="sref">IW_QUAL_LEVEL_INVALID//a>;.1372//a>                /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_QUAL_INVALID" class="sref">IW_QUAL_QUAL_INVALID//a>;.1373//a>        }.1374//a>.1375//a>        /a href="+code=wstats" class="sref">wstats//a>./a href="+code=qual" class="sref">qual//a>./a href="+code=updated" class="sref">updated//a> |= /a href="+code=IW_QUAL_NOISE_INVALID" class="sref">IW_QUAL_NOISE_INVALID//a>;.1376//a>        if (/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=filled" class="sref">filled//a> & /a href="+code=STATION_INFO_RX_DROP_MISC" class="sref">STATION_INFO_RX_DROP_MISC//a>).1377//a>                /a href="+code=wstats" class="sref">wstats//a>./a href="+code=discard" class="sref">discard//a>./a href="+code=misc" class="sref">misc//a> = /a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=rx_dropped_misc" class="sref">rx_dropped_misc//a>;.1378//a>        if (/a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=filled" class="sref">filled//a> & /a href="+code=STATION_INFO_TX_FAILED" class="sref">STATION_INFO_TX_FAILED//a>).1379//a>                /a href="+code=wstats" class="sref">wstats//a>./a href="+code=discard" class="sref">discard//a>./a href="+code=retries" class="sref">retries//a> = /a href="+code=sinfo" class="sref">sinfo//a>./a href="+code=tx_failed" class="sref">tx_failed//a>;.1380//a>.1381//a>        return &/a href="+code=wstats" class="sref">wstats//a>;.1382//a>}.1383>
a6.1384//a>static intcfg80211_wext_siwap//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1385//a>                               structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1386//a>                               structsockaddr//a> */a href="+code=ap_addr" class="sref">ap_addr//a>, char */a href="+code=extra" class="sref">extra//a>).1387//a>{.1388//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1389>
a6.1390//a>        switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.1391//a>        case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.1392//a>                return /a href="+code=cfg80211_ibss_wext_siwap" class="sref">cfg80211_ibss_wext_siwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1393//a>        case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.1394//a>                return /a href="+code=cfg80211_mgd_wext_siwap" class="sref">cfg80211_mgd_wext_siwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1395//a>        case /a href="+code=NL80211_IFTYPE_WDS" class="sref">NL80211_IFTYPE_WDS//a>:.1396//a>                return /a href="+code=cfg80211_wds_wext_siwap" class="sref">cfg80211_wds_wext_siwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1397//a>        default:.1398//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1399//a>        }.1400//a>}.1401//a>.1402//a>static intcfg80211_wext_giwap//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1403//a>                               structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1404//a>                               structsockaddr//a> */a href="+code=ap_addr" class="sref">ap_addr//a>, char */a href="+code=extra" class="sref">extra//a>).1405//a>{.1406//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1407//a>.1408//a>        switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.1409//a>        case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.1410//a>                return /a href="+code=cfg80211_ibss_wext_giwap" class="sref">cfg80211_ibss_wext_giwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1411//a>        case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.1412//a>                return /a href="+code=cfg80211_mgd_wext_giwap" class="sref">cfg80211_mgd_wext_giwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1413//a>        case /a href="+code=NL80211_IFTYPE_WDS" class="sref">NL80211_IFTYPE_WDS//a>:.1414//a>                return /a href="+code=cfg80211_wds_wext_giwap" class="sref">cfg80211_wds_wext_giwap//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=ap_addr" class="sref">ap_addr//a>, /a href="+code=extra" class="sref">extra//a>);.1415//a>        default:.1416//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1417//a>        }.1418//a>}.1419>
a6.1420//a>static intcfg80211_wext_siwessid//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1421//a>                                  structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1422//a>                                  structiw_point//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=ssid" class="sref">ssid//a>).1423//a>{.1424//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1425//a>.1426//a>        switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.1427//a>        case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.1428//a>                return /a href="+code=cfg80211_ibss_wext_siwessid" class="sref">cfg80211_ibss_wext_siwessid//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=data" class="sref">data//a>, /a href="+code=ssid" class="sref">ssid//a>);.1429//a>        case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.1430//a>                return /a href="+code=cfg80211_mgd_wext_siwessid" class="sref">cfg80211_mgd_wext_siwessid//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=data" class="sref">data//a>, /a href="+code=ssid" class="sref">ssid//a>);.1431//a>        default:.1432//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1433//a>        }.1434//a>}.1435//a>.1436//a>static intcfg80211_wext_giwessid//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1437//a>                                  structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1438//a>                                  structiw_point//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=ssid" class="sref">ssid//a>).1439//a>{.1440//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1441//a>.1442//a>        /a href="+code=data" class="sref">data//a>->/a href="+code=flags" class="sref">flags//a> = 0;.1443//a>        /a href="+code=data" class="sref">data//a>->/a href="+code=length" class="sref">length//a> = 0;.1444//a>.1445//a>        switch (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a>) {.1446//a>        case /a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC//a>:.1447//a>                return /a href="+code=cfg80211_ibss_wext_giwessid" class="sref">cfg80211_ibss_wext_giwessid//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=data" class="sref">data//a>, /a href="+code=ssid" class="sref">ssid//a>);.1448//a>        case /a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION//a>:.1449//a>                return /a href="+code=cfg80211_mgd_wext_giwessid" class="sref">cfg80211_mgd_wext_giwessid//a>(/a href="+code=dev" class="sref">dev//a>,info//a>, /a href="+code=data" class="sref">data//a>, /a href="+code=ssid" class="sref">ssid//a>);.1450//a>        default:.1451//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1452//a>        }.1453//a>}.1454//a>.1455//a>static intcfg80211_wext_siwpmksa//a>(structnet_device//a> */a href="+code=dev" class="sref">dev//a>,.1456//a>                                  structiw_request_info//a> */a href="+code=info" class="sref">info//a>,.1457//a>                                  structiw_point//a> */a href="+code=data" class="sref">data//a>, char */a href="+code=extra" class="sref">extra//a>).1458//a>{.1459//a>        structwireless_dev//a> */a href="+code=wdev" class="sref">wdev//a> = /a href="+code=dev" class="sref">dev//a>->/a href="+code=ieee80211_ptr" class="sref">ieee80211_ptr//a>;.1460//a>        structcfg80211_registered_device//a> */a href="+code=rdev" class="sref">rdev//a> = /a href="+code=wiphy_to_dev" class="sref">wiphy_to_dev//a>(/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>);.1461//a>        structcfg80211_pmksa//a>cfg_pmksa//a>;.1462//a>        structiw_pmksa//a> */a href="+code=pmksa" class="sref">pmksa//a> = (structiw_pmksa//a> *)/a href="+code=extra" class="sref">extra//a>;.1463>
a6.1464//a>        /a href="+code=memset" class="sref">memset//a>(&/a href="+code=cfg_pmksa" class="sref">cfg_pmksa//a>, 0, sizeof(structcfg80211_pmksa//a>));.1465//a>.1466//a>        if (/a href="+code=wdev" class="sref">wdev//a>->/a href="+code=iftype" class="sref">iftype//a> !=NL80211_IFTYPE_STATION//a>).1467//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>;.1468//a>.1469//a>        /a href="+code=cfg_pmksa" class="sref">cfg_pmksa//a>./a href="+code=bssid" class="sref">bssid//a> = /a href="+code=pmksa" class="sref">pmksa//a>->/a href="+code=bssid" class="sref">bssid//a>./a href="+code=sa_data" class="sref">sa_data//a>;.1470//a>        /a href="+code=cfg_pmksa" class="sref">cfg_pmksa//a>./a href="+code=pmkid" class="sref">pmkid//a> = /a href="+code=pmksa" class="sref">pmksa//a>->/a href="+code=pmkid" class="sref">pmkid//a>;.1471//a>.1472//a>        switch (/a href="+code=pmksa" class="sref">pmksa//a>->/a href="+code=cmd" class="sref">cmd//a>) {.1473//a>        case /a href="+code=IW_PMKSA_ADD" class="sref">IW_PMKSA_ADD//a>:.1474//a>                if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_pmksa" class="sref">set_pmksa//a>).1475//a>                        return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1476>
a6.1477//a>                return /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=set_pmksa" class="sref">set_pmksa//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, &/a href="+code=cfg_pmksa" class="sref">cfg_pmksa//a>);.1478//a>.1479//a>        case /a href="+code=IW_PMKSA_REMOVE" class="sref">IW_PMKSA_REMOVE//a>:.1480//a>                if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=del_pmksa" class="sref">del_pmksa//a>).1481//a>                        return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1482//a>.1483//a>                return /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=del_pmksa" class="sref">del_pmksa//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>, &/a href="+code=cfg_pmksa" class="sref">cfg_pmksa//a>);.1484//a>.1485//a>        case /a href="+code=IW_PMKSA_FLUSH" class="sref">IW_PMKSA_FLUSH//a>:.1486//a>                if (!/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=flush_pmksa" class="sref">flush_pmksa//a>).1487//a>                        return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1488//a>.1489//a>                return /a href="+code=rdev" class="sref">rdev//a>->/a href="+code=ops" class="sref">ops//a>->/a href="+code=flush_pmksa" class="sref">flush_pmksa//a>(&/a href="+code=rdev" class="sref">rdev//a>->/a href="+code=wiphy" class="sref">wiphy//a>,dev//a>);.1490//a>.1491//a>        default:.1492//a>                return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>;.1493//a>        }.1494//a>}.1495//a>.1496//a>static constiw_handler//a>cfg80211_handlers//a>[] = {.1497//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWNAME" class="sref">SIOCGIWNAME//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwnam //a>,.1498//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWFREQ" class="sref">SIOCSIWFREQ//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwfreq//a>,.1499//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWFREQ" class="sref">SIOCGIWFREQ//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwfreq//a>,.1500//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWMODE" class="sref">SIOCSIWMODE//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwmode//a>,.1501//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWMODE" class="sref">SIOCGIWMODE//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwmode//a>,.1502//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWRANGE" class="sref">SIOCGIWRANGE//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwrange//a>,.1503//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWAP" class="sref">SIOCSIWAP//a>)]       = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwap//a>,.1504//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWAP" class="sref">SIOCGIWAP//a>)]       = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwap//a>,.1505//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWMLME" class="sref">SIOCSIWMLME//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwmlm //a>,.1506//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWSCAN" class="sref">SIOCSIWSCAN//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwscan//a>,.1507//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWSCAN" class="sref">SIOCGIWSCAN//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwscan//a>,.1508//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWESSID" class="sref">SIOCSIWESSID//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwessid//a>,.1509//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWESSID" class="sref">SIOCGIWESSID//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwessid//a>,.1510//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWRATE" class="sref">SIOCSIWRATE//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwrat //a>,.1511//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWRATE" class="sref">SIOCGIWRATE//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwrat //a>,.1512//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWRTS" class="sref">SIOCSIWRTS//a>)]      = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwrts//a>,.1513//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWRTS" class="sref">SIOCGIWRTS//a>)]      = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwrts//a>,.1514//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWFRAG" class="sref">SIOCSIWFRAG//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwfrag//a>,.1515//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWFRAG" class="sref">SIOCGIWFRAG//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwfrag//a>,.1516//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWTXPOW" class="sref">SIOCSIWTXPOW//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwtxpower//a>,.1517//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWTXPOW" class="sref">SIOCGIWTXPOW//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwtxpower//a>,.1518//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWRETRY" class="sref">SIOCSIWRETRY//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwretry//a>,.1519//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWRETRY" class="sref">SIOCGIWRETRY//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwretry//a>,.1520//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWENCODE" class="sref">SIOCSIWENCODE//a>)]   = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwencode//a>,.1521//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWENCODE" class="sref">SIOCGIWENCODE//a>)]   = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwencode//a>,.1522//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWPOWER" class="sref">SIOCSIWPOWER//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwpower//a>,.1523//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWPOWER" class="sref">SIOCGIWPOWER//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwpower//a>,.1524//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWGENIE" class="sref">SIOCSIWGENIE//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwgenie//a>,.1525//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWAUTH" class="sref">SIOCSIWAUTH//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwauth//a>,.1526//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCGIWAUTH" class="sref">SIOCGIWAUTH//a>)]     = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_giwauth//a>,.1527//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWENCODEEXT" class="sref">SIOCSIWENCODEEXT//a>)]= (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwencodeext//a>,.1528//a>        [/a href="+code=IW_IOCTL_IDX" class="sref">IW_IOCTL_IDX//a>(/a href="+code=SIOCSIWPMKSA" class="sref">SIOCSIWPMKSA//a>)]    = (/a href="+code=iw_handler" class="sref">iw_handler//a>)cfg80211_wext_siwpmksa//a>,.1529//a>};.1530//a>.1531//a>constiw_handler_def//a> /a href="+code=cfg80211_wext_handler" class="sref">cfg80211_wext_handler//a> = {.1532//a>        ./a href="+code=num_standard" class="sref">num_standard//a>           = /a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE//a>(/a href="+code=cfg80211_handlers" class="sref">cfg80211_handlers//a>),.1533//a>        ./a href="+code=standard" class="sref">standard//a>               = /a href="+code=cfg80211_handlers" class="sref">cfg80211_handlers//a>,.1534//a>        ./a href="+code=get_wireless_stats" class="sref">get_wireless_stats//a> = /a href="+code=cfg80211_wireless_stats" class="sref">cfg80211_wireless_stats//a>,.1535//a>};.1536//a>
lxr.linux.no kindly hosted by /a href="http://www.redpill-linpro.no">Redpill Linpro AS//a>,