Deleted Added
full compact
ieee80211_node.c (140498) ieee80211_node.c (140499)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 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>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 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 140498 2005-01-20 02:54:18Z sam $");
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 140499 2005-01-20 02:59:21Z 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>

--- 1665 unchanged lines hidden (view full) ---

1708
1709/*
1710 * Handle bookkeeping for station deauthentication/disassociation
1711 * when operating as an ap.
1712 */
1713void
1714ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
1715{
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>

--- 1665 unchanged lines hidden (view full) ---

1708
1709/*
1710 * Handle bookkeeping for station deauthentication/disassociation
1711 * when operating as an ap.
1712 */
1713void
1714ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
1715{
1716 struct ieee80211_node_table *nt = ni->ni_table;
1716
1717 IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG,
1718 "[%s] station with aid %d leaves\n",
1719 ether_sprintf(ni->ni_macaddr), IEEE80211_NODE_AID(ni));
1720
1721 KASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP ||
1722 ic->ic_opmode == IEEE80211_M_IBSS ||
1723 ic->ic_opmode == IEEE80211_M_AHDEMO,

--- 23 unchanged lines hidden (view full) ---

1747 /*
1748 * Cleanup station state. In particular clear various
1749 * state that might otherwise be reused if the node
1750 * is reused before the reference count goes to zero
1751 * (and memory is reclaimed).
1752 */
1753 ieee80211_sta_leave(ic, ni);
1754done:
1717
1718 IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG,
1719 "[%s] station with aid %d leaves\n",
1720 ether_sprintf(ni->ni_macaddr), IEEE80211_NODE_AID(ni));
1721
1722 KASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP ||
1723 ic->ic_opmode == IEEE80211_M_IBSS ||
1724 ic->ic_opmode == IEEE80211_M_AHDEMO,

--- 23 unchanged lines hidden (view full) ---

1748 /*
1749 * Cleanup station state. In particular clear various
1750 * state that might otherwise be reused if the node
1751 * is reused before the reference count goes to zero
1752 * (and memory is reclaimed).
1753 */
1754 ieee80211_sta_leave(ic, ni);
1755done:
1755 ni->ni_inact_reload = ic->ic_inact_init; /* just in case */
1756 ieee80211_free_node(ni);
1756 /*
1757 * Remove the node from any table it's recorded in and
1758 * drop the caller's reference. Removal from the table
1759 * is important to insure the node is not reprocessed
1760 * for inactivity.
1761 */
1762 if (nt != NULL) {
1763 IEEE80211_NODE_LOCK(nt);
1764 node_reclaim(nt, ni);
1765 IEEE80211_NODE_UNLOCK(nt);
1766 } else
1767 ieee80211_free_node(ni);
1757}
1758
1759u_int8_t
1760ieee80211_getrssi(struct ieee80211com *ic)
1761{
1762#define NZ(x) ((x) == 0 ? 1 : (x))
1763 struct ieee80211_node_table *nt = ic->ic_sta;
1764 u_int32_t rssi_samples, rssi_total;

--- 162 unchanged lines hidden ---
1768}
1769
1770u_int8_t
1771ieee80211_getrssi(struct ieee80211com *ic)
1772{
1773#define NZ(x) ((x) == 0 ? 1 : (x))
1774 struct ieee80211_node_table *nt = ic->ic_sta;
1775 u_int32_t rssi_samples, rssi_total;

--- 162 unchanged lines hidden ---