1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2004 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: --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 139528 2004-12-31 22:05:13Z sam $"); |
35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/mbuf.h> 39#include <sys/malloc.h> 40#include <sys/kernel.h> 41 42#include <sys/socket.h> --- 150 unchanged lines hidden (view full) --- 193/* 194 * Port authorize/unauthorize interfaces for use by an authenticator. 195 */ 196 197void 198ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni) 199{ 200 ni->ni_flags |= IEEE80211_NODE_AUTH; |
201 ni->ni_inact_reload = ic->ic_inact_run; |
202} 203 204void 205ieee80211_node_unauthorize(struct ieee80211com *ic, struct ieee80211_node *ni) 206{ 207 ni->ni_flags &= ~IEEE80211_NODE_AUTH; 208} 209 --- 697 unchanged lines hidden (view full) --- 907 908 IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr); 909 hash = IEEE80211_NODE_HASH(macaddr); 910 ieee80211_node_initref(ni); /* mark referenced */ 911 ni->ni_chan = IEEE80211_CHAN_ANYC; 912 ni->ni_authmode = IEEE80211_AUTH_OPEN; 913 ni->ni_txpower = ic->ic_txpowlimit; /* max power */ 914 ieee80211_crypto_resetkey(ic, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE); |
915 ni->ni_inact_reload = nt->nt_inact_init; 916 ni->ni_inact = ni->ni_inact_reload; |
917 IEEE80211_NODE_SAVEQ_INIT(ni, "unknown"); 918 919 IEEE80211_NODE_LOCK(nt); 920 TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); 921 LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash); 922 ni->ni_table = nt; 923 ni->ni_ic = ic; 924 IEEE80211_NODE_UNLOCK(nt); --- 483 unchanged lines hidden (view full) --- 1408 } 1409 } 1410 /* 1411 * Probe the station before time it out. We 1412 * send a null data frame which may not be 1413 * universally supported by drivers (need it 1414 * for ps-poll support so it should be...). 1415 */ |
1416 if (0 < ni->ni_inact && 1417 ni->ni_inact <= ic->ic_inact_probe) { |
1418 IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE, 1419 "[%s] probe station due to inactivity\n", 1420 ether_sprintf(ni->ni_macaddr)); 1421 IEEE80211_NODE_UNLOCK(nt); 1422 ieee80211_send_nulldata(ic, ni); 1423 /* XXX stat? */ 1424 goto restart; 1425 } --- 191 unchanged lines hidden (view full) --- 1617 ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long", 1618 ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "", 1619 ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : "" 1620 ); 1621 1622 /* give driver a chance to setup state like ni_txrate */ 1623 if (ic->ic_newassoc != NULL) 1624 ic->ic_newassoc(ic, ni, newassoc); |
1625 ni->ni_inact_reload = ic->ic_inact_auth; 1626 ni->ni_inact = ni->ni_inact_reload; |
1627 IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS); 1628 /* tell the authenticator about new station */ 1629 if (ic->ic_auth->ia_node_join != NULL) 1630 ic->ic_auth->ia_node_join(ic, ni); 1631 ieee80211_notify_node_join(ic, ni, newassoc); 1632} 1633 1634/* --- 278 unchanged lines hidden --- |