linux/net/mac80211/chan.c
<<
ion 2.6/spa > 2.6/form> 2.6a ion 2. href="../linux+v3.7.4/net/mac80211/chan.c">ion 2.6img src="../.static/gfx/right.png" alt=">>">io6/spa > io6spa class="lxr_search">ion ion 2.6input typionhidden" namionnavtarget" /option">ion 2.6input typiontext" namionsearch" idonsearch">ion 2.6butt12Search 2.6/form> 6/spa > io6spa class="lxr_prefs"> 2.6a href="+prefs?return=net/mac80211/chan.c"ion 2. onclick="return ajax_prefs();">ion 2.Prefs 2.6/a>io6/spa > n 2. .6/div> n 2. .6form ac ="ajax+*" method="post" onsubmit="return false;">io6input typionhidden" namionajax_lookup" idonajax_lookup" /option">in 2. .6/form> in 2. .6div class="headingbott1m">
n 2.
n 2. 2. .6div idonsearch_results" class="search_results" 2> n 2. .6/div> 6div idoncontent"> 6div idonfile_contents">
. .16/a>6spa  class="comment">/*6/spa >
. .26/a>6spa  class="comment"> * mac80211 - channel management6/spa >
. .36/a>6spa  class="comment"> */6/spa >
. .46/a>i. .56/a>#include <linux/nl80211.h6/a>>i. .66/a>#include <net/cfg80211.h6/a>>i. .76/a>#include "ieee80211_i.h6/a>"i. .86/a>i. .96/a>static enum.6a href="+code=ieee80211_chan_mode" class="sref">ieee80211_chan_mode6/a>i. 27.1a>6a href="+code=__ieee80211_get_channel_mode" class="sref">__ieee80211_get_channel_mode.1a>(struct.6a href="+code=ieee80211_local" class="sref">ieee80211_local.1a> *6a href="+code=local" class="sref">local.1a>,i. 116/a>                             struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=ignore" class="sref">ignore.1a>)i. 126/a>{i. 136/a>        struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=sdata" class="sref">sdata.1a>;i. 146/a>i. 156/a>        6a href="+code=lockdep_assert_held" class="sref">lockdep_assert_held.1a>(&6a href="+code=local" class="sref">local.1a>->6a href="+code=iflist_mtx" class="sref">iflist_mtx.1a>);i. 166/a>i. 176/a>        6a href="+code=list_for_each_entry" class="sref">list_for_each_entry.1a>(6a href="+code=sdata" class="sref">sdata.1a>, &6a href="+code=local" class="sref">local.1a>->6a href="+code=interfaces" class="sref">interfaces.1a>, 6a href="+code=list" class="sref">list.1a>) {i. 186/a>                if (6a href="+code=sdata" class="sref">sdata.1a> ==.6a href="+code=ignore" class="sref">ignore.1a>)i. 196/a>                        continue;i. 206/a>i. 216/a>                if (!6a href="+code=ieee80211_sdata_running" class="sref">ieee80211_sdata_running.1a>(6a href="+code=sdata" class="sref">sdata.1a>))i. 226/a>                        continue;i. 236/a>i. 246/a>                switch (6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=vif" class="sref">vif.1a>.6a href="+code=typi" class="sref">typi.1a>) {i. 256/a>                case.6a href="+code=NL80211_IFTYPE_MONITOR" class="sref">NL80211_IFTYPE_MONITOR6/a>:i. 266/a>                        continue;i. 276/a>                case.6a href="+code=NL80211_IFTYPE_STATION" class="sref">NL80211_IFTYPE_STATION6/a>:i. 286/a>                        if (!6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=u" class="sref">u.1a>.6a href="+code=mgd" class="sref">mgd.1a>.6a href="+code=associated" class="sref">associated.1a>)i. 296/a>                                continue;i. 306/a>                        break;i. 316/a>                case.6a href="+code=NL80211_IFTYPE_ADHOC" class="sref">NL80211_IFTYPE_ADHOC6/a>:i. 326/a>                        if (!6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=u" class="sref">u.1a>.6a href="+code=ibss" class="sref">ibss.1a>.6a href="+code=ssid_len" class="sref">ssid_len.1a>)i. 336/a>                                continue;i. 346/a>                        if (!6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=u" class="sref">u.1a>.6a href="+code=ibss" class="sref">ibss.1a>.6a href="+code=fixed_channel" class="sref">fixed_channel.1a>)i. 356/a>                                return 6a href="+code=CHAN_MODE_HOPPING" class="sref">CHAN_MODE_HOPPING.1a>;i. 366/a>                        break;i. 376/a>                case.6a href="+code=NL80211_IFTYPE_AP_VLAN" class="sref">NL80211_IFTYPE_AP_VLAN6/a>:i. 386/a>                        6spa  class="comment">/* will also have _AP interface */6/spa >
. 396/a>                        continue;i. 406/a>                case.6a href="+code=NL80211_IFTYPE_AP" class="sref">NL80211_IFTYPE_AP6/a>:i. 416/a>                        if (!6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=u" class="sref">u.1a>.6a href="+code=ap" class="sref">ap.1a>.6a href="+code=beacon" class="sref">beacon.1a>)i. 426/a>                                continue;i. 436/a>                        break;i. 446/a>                case.6a href="+code=NL80211_IFTYPE_MESH_POINT" class="sref">NL80211_IFTYPE_MESH_POINT6/a>:i. 456/a>                        if (!6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=wdev" class="sref">wdev.1a>.6a href="+code=mesh_id_len" class="sref">mesh_id_len.1a>)i. 466/a>                                continue;i. 476/a>                        break;i. 486/a>                default:i. 496/a>                        break;i. 506/a>                }i. 516/a>i. 526/a>                return 6a href="+code=CHAN_MODE_FIXED" class="sref">CHAN_MODE_FIXED.1a>;i. 536/a>        }i. 546/a>i. 556/a>        return 6a href="+code=CHAN_MODE_UNDEFINED" class="sref">CHAN_MODE_UNDEFINED.1a>;i. 566/a>}i. 576/a>i. 586/a>enum.6a href="+code=ieee80211_chan_mode" class="sref">ieee80211_chan_mode6/a>i. 59.1a>6a href="+code=ieee80211_get_channel_mode" class="sref">ieee80211_get_channel_mode.1a>(struct.6a href="+code=ieee80211_local" class="sref">ieee80211_local.1a> *6a href="+code=local" class="sref">local.1a>,i. 606/a>                           struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=ignore" class="sref">ignore.1a>)i. 616/a>{i. 626/a>        enum.6a href="+code=ieee80211_chan_mode" class="sref">ieee80211_chan_mode6/a>.6a href="+code=mode" class="sref">mode6/a>;i. 636/a>i. 646/a>        6a href="+code=mutex_lock" class="sref">mutex_lock.1a>(&6a href="+code=local" class="sref">local.1a>->6a href="+code=iflist_mtx" class="sref">iflist_mtx.1a>);i. 656/a>        6a href="+code=mode" class="sref">mode6/a> =.6a href="+code=__ieee80211_get_channel_mode" class="sref">__ieee80211_get_channel_mode.1a>(6a href="+code=local" class="sref">local.1a>,.6a href="+code=ignore" class="sref">ignore.1a>);i. 666/a>        6a href="+code=mutex_unlock" class="sref">mutex_unlock.1a>(&6a href="+code=local" class="sref">local.1a>->6a href="+code=iflist_mtx" class="sref">iflist_mtx.1a>);i. 676/a>i. 686/a>        return 6a href="+code=mode" class="sref">mode6/a>;i. 696/a>}i. 706/a>i. 716/a>static enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>i. 72.1a>6a href="+code=ieee80211_get_superchan" class="sref">ieee80211_get_superchan.1a>(struct.6a href="+code=ieee80211_local" class="sref">ieee80211_local.1a> *6a href="+code=local" class="sref">local.1a>,i. 736/a>                        struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=sdata" class="sref">sdata.1a>)i. 746/a>{i. 756/a>        enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=superchan" class="sref">superchan.1a> =.6a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT6/a>;i. 766/a>        struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=tmp" class="sref">tmp6/a>;i. 776/a>i. 786/a>        6a href="+code=mutex_lock" class="sref">mutex_lock.1a>(&6a href="+code=local" class="sref">local.1a>->6a href="+code=iflist_mtx" class="sref">iflist_mtx.1a>);i. 796/a>        6a href="+code=list_for_each_entry" class="sref">list_for_each_entry.1a>(6a href="+code=tmp" class="sref">tmp6/a>, &6a href="+code=local" class="sref">local.1a>->6a href="+code=interfaces" class="sref">interfaces.1a>, 6a href="+code=list" class="sref">list.1a>) {i. 806/a>                if (6a href="+code=tmp" class="sref">tmp6/a> ==.6a href="+code=sdata" class="sref">sdata.1a>)i. 816/a>                        continue;i. 826/a>i. 836/a>                if (!6a href="+code=ieee80211_sdata_running" class="sref">ieee80211_sdata_running.1a>(6a href="+code=tmp" class="sref">tmp6/a>))i. 846/a>                        continue;i. 856/a>i. 866/a>                switch (6a href="+code=tmp" class="sref">tmp6/a>->6a href="+code=vif" class="sref">vif.1a>.6a href="+code=bss_conf" class="sref">bss_conf.1a>.6a href="+code=channel_typi" class="sref">channel_typi6/a>) {i. 876/a>                case.6a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT6/a>:i. 886/a>                case.6a href="+code=NL80211_CHAN_HT20" class="sref">NL80211_CHAN_HT206/a>:i. 896/a>                        if (6a href="+code=superchan" class="sref">superchan.1a> >.6a href="+code=tmp" class="sref">tmp6/a>->6a href="+code=vif" class="sref">vif.1a>.6a href="+code=bss_conf" class="sref">bss_conf.1a>.6a href="+code=channel_typi" class="sref">channel_typi6/a>)i. 906/a>                                break;i. 916/a>i. 926/a>                        6a href="+code=superchan" class="sref">superchan.1a> =.6a href="+code=tmp" class="sref">tmp6/a>->6a href="+code=vif" class="sref">vif.1a>.6a href="+code=bss_conf" class="sref">bss_conf.1a>.6a href="+code=channel_typi" class="sref">channel_typi6/a>;i. 936/a>                        break;i. 946/a>                case.6a href="+code=NL80211_CHAN_HT40PLUS" class="sref">NL80211_CHAN_HT40PLUS6/a>:i. 956/a>                        6a href="+code=WARN_ON" class="sref">WARN_ON.1a>(6a href="+code=superchan" class="sref">superchan.1a> ==.6a href="+code=NL80211_CHAN_HT40MINUS" class="sref">NL80211_CHAN_HT40MINUS.1a>);i. 966/a>                        6a href="+code=superchan" class="sref">superchan.1a> =.6a href="+code=NL80211_CHAN_HT40PLUS" class="sref">NL80211_CHAN_HT40PLUS6/a>;i. 976/a>                        break;i. 986/a>                case.6a href="+code=NL80211_CHAN_HT40MINUS" class="sref">NL80211_CHAN_HT40MINUS.1a>:i. 996/a>                        6a href="+code=WARN_ON" class="sref">WARN_ON.1a>(6a href="+code=superchan" class="sref">superchan.1a> ==.6a href="+code=NL80211_CHAN_HT40PLUS" class="sref">NL80211_CHAN_HT40PLUS6/a>);i.1006/a>                        6a href="+code=superchan" class="sref">superchan.1a> =.6a href="+code=NL80211_CHAN_HT40MINUS" class="sref">NL80211_CHAN_HT40MINUS.1a>;i.1016/a>                        break;i.1026/a>                }i.1036/a>        }i.1046/a>        6a href="+code=mutex_unlock" class="sref">mutex_unlock.1a>(&6a href="+code=local" class="sref">local.1a>->6a href="+code=iflist_mtx" class="sref">iflist_mtx.1a>);i.1056/a>i.1066/a>        return 6a href="+code=superchan" class="sref">superchan.1a>;i.1076/a>}i.1086/a>i.1096/a>static 6a href="+code=bool" class="sref">bool6/a>i.127.1a>6a href="+code=ieee80211_channel_typis_are_compatible" class="sref">ieee80211_channel_typis_are_compatible.1a>(enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=chantypi1" class="sref">chantypi1.1a>,i.1116/a>                                       enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=chantypi2" class="sref">chantypi2.1a>,i.1126/a>                                       enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.*6a href="+code=compat" class="sref">compat6/a>)i.1136/a>{i.1146/a>        6spa  class="comment">/*6/spa >
.1156/a>6spa  class="comment">         * start out with chantypi1 being the result,6/spa >
.1166/a>6spa  class="comment">         * overwriting later if needed.1spa >
.1176/a>6spa  class="comment">         */6/spa >
.1186/a>        if (6a href="+code=compat" class="sref">compat6/a>)i.1196/a>                *6a href="+code=compat" class="sref">compat6/a> =.6a href="+code=chantypi1" class="sref">chantypi1.1a>;i.1206/a>i.1216/a>        switch (6a href="+code=chantypi1" class="sref">chantypi1.1a>) {i.1226/a>        case.6a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT6/a>:i.1236/a>                if (6a href="+code=compat" class="sref">compat6/a>)i.1246/a>                        *6a href="+code=compat" class="sref">compat6/a> =.6a href="+code=chantypi2" class="sref">chantypi2.1a>;i.1256/a>                break;i.1266/a>        case.6a href="+code=NL80211_CHAN_HT20" class="sref">NL80211_CHAN_HT206/a>:i.1276/a>                6spa  class="comment">/*6/spa >
.1286/a>6spa  class="comment">                 * allow any change that doesn't go to no-HT6/spa >
.1296/a>6spa  class="comment">                 * (if it already is no-HT no change is needed)6/spa >
.1306/a>6spa  class="comment">                 */6/spa >
.1316/a>                if (6a href="+code=chantypi2" class="sref">chantypi2.1a> ==.6a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT6/a>)i.1326/a>                        break;i.1336/a>                if (6a href="+code=compat" class="sref">compat6/a>)i.1346/a>                        *6a href="+code=compat" class="sref">compat6/a> =.6a href="+code=chantypi2" class="sref">chantypi2.1a>;i.1356/a>                break;i.1366/a>        case.6a href="+code=NL80211_CHAN_HT40PLUS" class="sref">NL80211_CHAN_HT40PLUS6/a>:i.1376/a>        case.6a href="+code=NL80211_CHAN_HT40MINUS" class="sref">NL80211_CHAN_HT40MINUS.1a>:i.1386/a>                6spa  class="comment">/* allow smaller bandwidth and sami */6/spa >
.1396/a>                if (6a href="+code=chantypi2" class="sref">chantypi2.1a> ==.6a href="+code=NL80211_CHAN_NO_HT" class="sref">NL80211_CHAN_NO_HT6/a>)i.1406/a>                        break;i.1416/a>                if (6a href="+code=chantypi2" class="sref">chantypi2.1a> ==.6a href="+code=NL80211_CHAN_HT20" class="sref">NL80211_CHAN_HT206/a>)i.1426/a>                        break;i.1436/a>                if (6a href="+code=chantypi2" class="sref">chantypi2.1a> ==.6a href="+code=chantypi1" class="sref">chantypi1.1a>)i.1446/a>                        break;i.1456/a>                return 6a href="+code=false" class="sref">false.1a>;i.1466/a>        }i.1476/a>i.1486/a>        return 6a href="+code=true" class="sref">true.1a>;i.1496/a>}i.1506/a>i.1516/a>6a href="+code=bool" class="sref">bool6/a>.6a href="+code=ieee80211_set_channel_typi" class="sref">ieee80211_set_channel_typi.1a>(struct.6a href="+code=ieee80211_local" class="sref">ieee80211_local.1a> *6a href="+code=local" class="sref">local.1a>,i.1526/a>                                struct.6a href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data.1a> *6a href="+code=sdata" class="sref">sdata.1a>,i.1536/a>                                enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=chantypi" class="sref">chantypi.1a>)i.1546/a>{i.1556/a>        enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=superchan" class="sref">superchan.1a>;i.1566/a>        enum.6a href="+code=nl80211_channel_typi" class="sref">nl80211_channel_typi6/a>.6a href="+code=compatchan" class="sref">compatchan.1a>;i.1576/a>i.1586/a>        6a href="+code=superchan" class="sref">superchan.1a> =.6a href="+code=ieee80211_get_superchan" class="sref">ieee80211_get_superchan.1a>(6a href="+code=local" class="sref">local.1a>,.6a href="+code=sdata" class="sref">sdata.1a>);i.1596/a>        if (!6a href="+code=ieee80211_channel_typis_are_compatible" class="sref">ieee80211_channel_typis_are_compatible.1a>(6a href="+code=superchan" class="sref">superchan.1a>,.6a href="+code=chantypi" class="sref">chantypi.1a>,i.1606/a>                                                    &6a href="+code=compatchan" class="sref">compatchan.1a>))i.1616/a>                return 6a href="+code=false" class="sref">false.1a>;i.1626/a>i.1636/a>        6a href="+code=local" class="sref">local.1a>->6a href="+code=_oper_channel_typi" class="sref">_oper_channel_typi6/a> =.6a href="+code=compatchan" class="sref">compatchan.1a>;i.1646/a>i.1656/a>        if (6a href="+code=sdata" class="sref">sdata.1a>)i.1666/a>                6a href="+code=sdata" class="sref">sdata.1a>->6a href="+code=vif" class="sref">vif.1a>.6a href="+code=bss_conf" class="sref">bss_conf.1a>.6a href="+code=channel_typi" class="sref">channel_typi6/a> =.6a href="+code=chantypi" class="sref">chantypi.1a>;i.1676/a>i.1686/a>        return 6a href="+code=true" class="sref">true.1a>;i.1696/a>i.1706/a>}i.1716/a>
6/div> 6div class="footer"> The original LXR software by the LXR community.1a>,.this experimental vers.12lxr@linux.no.1a>. 6/div> 6div class="subfooter"> lxr.linux.no kindly hostedRedpill Linpro AS.1a>,.provider of Linux consulting and opera s services since 1995. 6/div> 6/body> 6/html>