ieee80211_node.c (184274) | ieee80211_node.c (184277) |
---|---|
1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 184274 2008-10-25 23:32:24Z sam $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 184277 2008-10-25 23:40:48Z sam $"); |
29 30#include "opt_wlan.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/mbuf.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> --- 93 unchanged lines hidden (view full) --- 130 /* NB: driver can override */ 131 vap->iv_max_aid = IEEE80211_AID_DEF; 132 133 /* default station inactivity timer setings */ 134 vap->iv_inact_init = IEEE80211_INACT_INIT; 135 vap->iv_inact_auth = IEEE80211_INACT_AUTH; 136 vap->iv_inact_run = IEEE80211_INACT_RUN; 137 vap->iv_inact_probe = IEEE80211_INACT_PROBE; | 29 30#include "opt_wlan.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/mbuf.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> --- 93 unchanged lines hidden (view full) --- 130 /* NB: driver can override */ 131 vap->iv_max_aid = IEEE80211_AID_DEF; 132 133 /* default station inactivity timer setings */ 134 vap->iv_inact_init = IEEE80211_INACT_INIT; 135 vap->iv_inact_auth = IEEE80211_INACT_AUTH; 136 vap->iv_inact_run = IEEE80211_INACT_RUN; 137 vap->iv_inact_probe = IEEE80211_INACT_PROBE; |
138 139 IEEE80211_DPRINTF(vap, IEEE80211_MSG_INACT, 140 "%s: init %u auth %u run %u probe %u\n", __func__, 141 vap->iv_inact_init, vap->iv_inact_auth, 142 vap->iv_inact_run, vap->iv_inact_probe); |
|
138} 139 140void 141ieee80211_node_latevattach(struct ieee80211vap *vap) 142{ 143 if (vap->iv_opmode == IEEE80211_M_HOSTAP) { 144 /* XXX should we allow max aid to be zero? */ 145 if (vap->iv_max_aid < IEEE80211_AID_MIN) { --- 36 unchanged lines hidden (view full) --- 182 183/* 184 * Port authorize/unauthorize interfaces for use by an authenticator. 185 */ 186 187void 188ieee80211_node_authorize(struct ieee80211_node *ni) 189{ | 143} 144 145void 146ieee80211_node_latevattach(struct ieee80211vap *vap) 147{ 148 if (vap->iv_opmode == IEEE80211_M_HOSTAP) { 149 /* XXX should we allow max aid to be zero? */ 150 if (vap->iv_max_aid < IEEE80211_AID_MIN) { --- 36 unchanged lines hidden (view full) --- 187 188/* 189 * Port authorize/unauthorize interfaces for use by an authenticator. 190 */ 191 192void 193ieee80211_node_authorize(struct ieee80211_node *ni) 194{ |
195 struct ieee80211vap *vap = ni->ni_vap; 196 |
|
190 ni->ni_flags |= IEEE80211_NODE_AUTH; | 197 ni->ni_flags |= IEEE80211_NODE_AUTH; |
191 ni->ni_inact_reload = ni->ni_vap->iv_inact_run; | 198 ni->ni_inact_reload = vap->iv_inact_run; |
192 ni->ni_inact = ni->ni_inact_reload; | 199 ni->ni_inact = ni->ni_inact_reload; |
200 201 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, 202 "%s: inact_reload %u", __func__, ni->ni_inact_reload); |
|
193} 194 195void 196ieee80211_node_unauthorize(struct ieee80211_node *ni) 197{ | 203} 204 205void 206ieee80211_node_unauthorize(struct ieee80211_node *ni) 207{ |
208 struct ieee80211vap *vap = ni->ni_vap; 209 |
|
198 ni->ni_flags &= ~IEEE80211_NODE_AUTH; | 210 ni->ni_flags &= ~IEEE80211_NODE_AUTH; |
199 ni->ni_inact_reload = ni->ni_vap->iv_inact_auth; | 211 ni->ni_inact_reload = vap->iv_inact_auth; |
200 if (ni->ni_inact > ni->ni_inact_reload) 201 ni->ni_inact = ni->ni_inact_reload; | 212 if (ni->ni_inact > ni->ni_inact_reload) 213 ni->ni_inact = ni->ni_inact_reload; |
214 215 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, 216 "%s: inact_reload %u inact %u", __func__, 217 ni->ni_inact_reload, ni->ni_inact); |
|
202} 203 204/* 205 * Fix tx parameters for a node according to ``association state''. 206 */ 207static void 208node_setuptxparms(struct ieee80211_node *ni) 209{ --- 808 unchanged lines hidden (view full) --- 1018 IEEE80211_NODE_LOCK(nt); 1019 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); 1020 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash); 1021 ni->ni_table = nt; 1022 ni->ni_vap = vap; 1023 ni->ni_ic = ic; 1024 IEEE80211_NODE_UNLOCK(nt); 1025 | 218} 219 220/* 221 * Fix tx parameters for a node according to ``association state''. 222 */ 223static void 224node_setuptxparms(struct ieee80211_node *ni) 225{ --- 808 unchanged lines hidden (view full) --- 1034 IEEE80211_NODE_LOCK(nt); 1035 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); 1036 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash); 1037 ni->ni_table = nt; 1038 ni->ni_vap = vap; 1039 ni->ni_ic = ic; 1040 IEEE80211_NODE_UNLOCK(nt); 1041 |
1042 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, 1043 "%s: inact_reload %u", __func__, ni->ni_inact_reload); 1044 |
|
1026 return ni; 1027} 1028 1029/* 1030 * Craft a temporary node suitable for sending a management frame 1031 * to the specified station. We craft only as much state as we 1032 * need to do the work since the node will be immediately reclaimed 1033 * once the send completes. --- 864 unchanged lines hidden (view full) --- 1898 * (last fragment older than 1s). 1899 * XXX doesn't belong here, move to node_age 1900 */ 1901 if (ni->ni_rxfrag[0] != NULL && 1902 ticks > ni->ni_rxfragstamp + hz) { 1903 m_freem(ni->ni_rxfrag[0]); 1904 ni->ni_rxfrag[0] = NULL; 1905 } | 1045 return ni; 1046} 1047 1048/* 1049 * Craft a temporary node suitable for sending a management frame 1050 * to the specified station. We craft only as much state as we 1051 * need to do the work since the node will be immediately reclaimed 1052 * once the send completes. --- 864 unchanged lines hidden (view full) --- 1917 * (last fragment older than 1s). 1918 * XXX doesn't belong here, move to node_age 1919 */ 1920 if (ni->ni_rxfrag[0] != NULL && 1921 ticks > ni->ni_rxfragstamp + hz) { 1922 m_freem(ni->ni_rxfrag[0]); 1923 ni->ni_rxfrag[0] = NULL; 1924 } |
1906 if (ni->ni_inact > 0) | 1925 if (ni->ni_inact > 0) { |
1907 ni->ni_inact--; | 1926 ni->ni_inact--; |
1927 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, 1928 "%s: inact %u inact_reload %u nrates %u", 1929 __func__, ni->ni_inact, ni->ni_inact_reload, 1930 ni->ni_rates.rs_nrates); 1931 } |
|
1908 /* 1909 * Special case ourself; we may be idle for extended periods 1910 * of time and regardless reclaiming our state is wrong. 1911 * XXX run ic_node_age 1912 */ 1913 if (ni == vap->iv_bss) 1914 continue; 1915 if (ni->ni_associd != 0 || --- 198 unchanged lines hidden (view full) --- 2114 ni->ni_rxfragstamp); 2115 printf("\trstamp %u rssi %d noise %d intval %u capinfo 0x%x\n", 2116 ni->ni_rstamp, node_getrssi(ni), ni->ni_noise, 2117 ni->ni_intval, ni->ni_capinfo); 2118 printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", 2119 ether_sprintf(ni->ni_bssid), 2120 ni->ni_esslen, ni->ni_essid, 2121 ni->ni_chan->ic_freq, ni->ni_chan->ic_flags); | 1932 /* 1933 * Special case ourself; we may be idle for extended periods 1934 * of time and regardless reclaiming our state is wrong. 1935 * XXX run ic_node_age 1936 */ 1937 if (ni == vap->iv_bss) 1938 continue; 1939 if (ni->ni_associd != 0 || --- 198 unchanged lines hidden (view full) --- 2138 ni->ni_rxfragstamp); 2139 printf("\trstamp %u rssi %d noise %d intval %u capinfo 0x%x\n", 2140 ni->ni_rstamp, node_getrssi(ni), ni->ni_noise, 2141 ni->ni_intval, ni->ni_capinfo); 2142 printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", 2143 ether_sprintf(ni->ni_bssid), 2144 ni->ni_esslen, ni->ni_essid, 2145 ni->ni_chan->ic_freq, ni->ni_chan->ic_flags); |
2122 printf("\tinact %u txrate %u\n", 2123 ni->ni_inact, ni->ni_txrate); | 2146 printf("\tinact %u inact_reload %u txrate %u\n", 2147 ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); |
2124 printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", 2125 ni->ni_htcap, ni->ni_htparam, 2126 ni->ni_htctlchan, ni->ni_ht2ndchan); 2127 printf("\thtopmode %x htstbc %x chw %u\n", 2128 ni->ni_htopmode, ni->ni_htstbc, ni->ni_chw); 2129} 2130 2131void --- 421 unchanged lines hidden --- | 2148 printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", 2149 ni->ni_htcap, ni->ni_htparam, 2150 ni->ni_htctlchan, ni->ni_ht2ndchan); 2151 printf("\thtopmode %x htstbc %x chw %u\n", 2152 ni->ni_htopmode, ni->ni_htstbc, ni->ni_chw); 2153} 2154 2155void --- 421 unchanged lines hidden --- |