Deleted Added
full compact
ieee80211_node.c (186870) ieee80211_node.c (186904)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
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:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright

--- 8 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>
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:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright

--- 8 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 186870 2009-01-07 18:17:36Z sam $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 186904 2009-01-08 17:12:47Z 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>
37
38#include <sys/socket.h>
39
40#include <net/if.h>
41#include <net/if_media.h>
42#include <net/ethernet.h>
43
44#include <net80211/ieee80211_var.h>
45#include <net80211/ieee80211_input.h>
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>
37
38#include <sys/socket.h>
39
40#include <net/if.h>
41#include <net/if_media.h>
42#include <net/ethernet.h>
43
44#include <net80211/ieee80211_var.h>
45#include <net80211/ieee80211_input.h>
46#ifdef IEEE80211_SUPPORT_TDMA
47#include <net80211/ieee80211_tdma.h>
48#endif
46#include <net80211/ieee80211_wds.h>
47
48#include <net/bpf.h>
49
50/*
51 * Association id's are managed with a bit vector.
52 */
53#define IEEE80211_AID_SET(_vap, b) \

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

332 get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN);
333 /* clear group bit, add local bit */
334 ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02;
335 }
336 } else if (vap->iv_opmode == IEEE80211_M_AHDEMO) {
337 if (vap->iv_flags & IEEE80211_F_DESBSSID)
338 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);
339 else
49#include <net80211/ieee80211_wds.h>
50
51#include <net/bpf.h>
52
53/*
54 * Association id's are managed with a bit vector.
55 */
56#define IEEE80211_AID_SET(_vap, b) \

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

335 get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN);
336 /* clear group bit, add local bit */
337 ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02;
338 }
339 } else if (vap->iv_opmode == IEEE80211_M_AHDEMO) {
340 if (vap->iv_flags & IEEE80211_F_DESBSSID)
341 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);
342 else
343#ifdef IEEE80211_SUPPORT_TDMA
344 if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
345#endif
340 memset(ni->ni_bssid, 0, IEEE80211_ADDR_LEN);
341 }
342 /*
343 * Fix the channel and related attributes.
344 */
345 /* clear DFS CAC state on previous channel */
346 if (ic->ic_bsschan != IEEE80211_CHAN_ANYC &&
347 ic->ic_bsschan->ic_freq != chan->ic_freq &&

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

740 if (ieee80211_ies_init(&ni->ni_ies, se->se_ies.data, se->se_ies.len)) {
741 ieee80211_ies_expand(&ni->ni_ies);
742 if (ni->ni_ies.ath_ie != NULL)
743 ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
744 if (ni->ni_ies.htcap_ie != NULL)
745 ieee80211_parse_htcap(ni, ni->ni_ies.htcap_ie);
746 if (ni->ni_ies.htinfo_ie != NULL)
747 ieee80211_parse_htinfo(ni, ni->ni_ies.htinfo_ie);
346 memset(ni->ni_bssid, 0, IEEE80211_ADDR_LEN);
347 }
348 /*
349 * Fix the channel and related attributes.
350 */
351 /* clear DFS CAC state on previous channel */
352 if (ic->ic_bsschan != IEEE80211_CHAN_ANYC &&
353 ic->ic_bsschan->ic_freq != chan->ic_freq &&

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

746 if (ieee80211_ies_init(&ni->ni_ies, se->se_ies.data, se->se_ies.len)) {
747 ieee80211_ies_expand(&ni->ni_ies);
748 if (ni->ni_ies.ath_ie != NULL)
749 ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
750 if (ni->ni_ies.htcap_ie != NULL)
751 ieee80211_parse_htcap(ni, ni->ni_ies.htcap_ie);
752 if (ni->ni_ies.htinfo_ie != NULL)
753 ieee80211_parse_htinfo(ni, ni->ni_ies.htinfo_ie);
754#ifdef IEEE80211_SUPPORT_TDMA
755 if (ni->ni_ies.tdma_ie != NULL)
756 ieee80211_parse_tdma(ni, ni->ni_ies.tdma_ie);
757#endif
748 }
749
750 vap->iv_dtim_period = se->se_dtimperiod;
751 vap->iv_dtim_count = 0;
752
753 /* NB: must be after ni_chan is setup */
754 ieee80211_setup_rates(ni, se->se_rates, se->se_xrates,
755 IEEE80211_F_DOSORT);

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

853 switch (ie[0]) {
854 case IEEE80211_ELEMID_VENDOR:
855 if (iswpaoui(ie))
856 ies->wpa_ie = ie;
857 else if (iswmeoui(ie))
858 ies->wme_ie = ie;
859 else if (isatherosoui(ie))
860 ies->ath_ie = ie;
758 }
759
760 vap->iv_dtim_period = se->se_dtimperiod;
761 vap->iv_dtim_count = 0;
762
763 /* NB: must be after ni_chan is setup */
764 ieee80211_setup_rates(ni, se->se_rates, se->se_xrates,
765 IEEE80211_F_DOSORT);

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

863 switch (ie[0]) {
864 case IEEE80211_ELEMID_VENDOR:
865 if (iswpaoui(ie))
866 ies->wpa_ie = ie;
867 else if (iswmeoui(ie))
868 ies->wme_ie = ie;
869 else if (isatherosoui(ie))
870 ies->ath_ie = ie;
871#ifdef IEEE80211_SUPPORT_TDMA
872 else if (istdmaoui(ie))
873 ies->tdma_ie = ie;
874#endif
861 break;
862 case IEEE80211_ELEMID_RSN:
863 ies->rsn_ie = ie;
864 break;
865 case IEEE80211_ELEMID_HTCAP:
866 ies->htcap_ie = ie;
867 break;
868 }

--- 1709 unchanged lines hidden ---
875 break;
876 case IEEE80211_ELEMID_RSN:
877 ies->rsn_ie = ie;
878 break;
879 case IEEE80211_ELEMID_HTCAP:
880 ies->htcap_ie = ie;
881 break;
882 }

--- 1709 unchanged lines hidden ---