Deleted Added
full compact
ieee80211_node.c (239319) ieee80211_node.c (240574)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2009 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-2009 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 239319 2012-08-16 00:53:23Z adrian $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 240574 2012-09-16 22:45:00Z adrian $");
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>

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

2240void
2241ieee80211_iterate_nodes(struct ieee80211_node_table *nt,
2242 ieee80211_iter_func *f, void *arg)
2243{
2244 struct ieee80211_node **ni_arr;
2245 size_t size;
2246 int i;
2247 uint16_t max_aid;
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>

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

2240void
2241ieee80211_iterate_nodes(struct ieee80211_node_table *nt,
2242 ieee80211_iter_func *f, void *arg)
2243{
2244 struct ieee80211_node **ni_arr;
2245 size_t size;
2246 int i;
2247 uint16_t max_aid;
2248 struct ieee80211vap *vap;
2248
2249
2249 max_aid = TAILQ_FIRST(&nt->nt_ic->ic_vaps)->iv_max_aid;
2250 /* Overdoing it default */
2251 max_aid = IEEE80211_AID_MAX;
2252
2253 /* Handle the case of there being no vaps just yet */
2254 vap = TAILQ_FIRST(&nt->nt_ic->ic_vaps);
2255 if (vap != NULL)
2256 max_aid = vap->iv_max_aid;
2257
2250 size = max_aid * sizeof(struct ieee80211_node *);
2251 ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE,
2252 M_NOWAIT | M_ZERO);
2253 if (ni_arr == NULL)
2254 return;
2255
2256 /*
2257 * If this fails, the node table won't have any

--- 499 unchanged lines hidden ---
2258 size = max_aid * sizeof(struct ieee80211_node *);
2259 ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE,
2260 M_NOWAIT | M_ZERO);
2261 if (ni_arr == NULL)
2262 return;
2263
2264 /*
2265 * If this fails, the node table won't have any

--- 499 unchanged lines hidden ---