Deleted Added
sdiff udiff text old ( 160690 ) new ( 164645 )
full compact
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.c 160690 2006-07-26 03:15:16Z sam $");
35
36/*
37 * IEEE 802.11 generic handler
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

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

56 "11a", /* IEEE80211_MODE_11A */
57 "11b", /* IEEE80211_MODE_11B */
58 "11g", /* IEEE80211_MODE_11G */
59 "FH", /* IEEE80211_MODE_FH */
60 "turboA", /* IEEE80211_MODE_TURBO_A */
61 "turboG", /* IEEE80211_MODE_TURBO_G */
62};
63
64/* list of all instances */
65SLIST_HEAD(ieee80211_list, ieee80211com);
66static struct ieee80211_list ieee80211_list =
67 SLIST_HEAD_INITIALIZER(ieee80211_list);
68static u_int8_t ieee80211_vapmap[32]; /* enough for 256 */
69static struct mtx ieee80211_vap_mtx;
70MTX_SYSINIT(ieee80211, &ieee80211_vap_mtx, "net80211 instances", MTX_DEF);
71

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

116ieee80211_default_reset(struct ifnet *ifp)
117{
118 return ENETRESET;
119}
120
121void
122ieee80211_ifattach(struct ieee80211com *ic)
123{
124 struct ifnet *ifp = ic->ic_ifp;
125 struct ieee80211_channel *c;
126 int i;
127
128 ether_ifattach(ifp, ic->ic_myaddr);
129 ifp->if_output = ieee80211_output;
130
131 bpfattach2(ifp, DLT_IEEE802_11,

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

174 ic->ic_curchan = &ic->ic_channels[i];
175 }
176 }
177 }
178 /* validate ic->ic_curmode */
179 if ((ic->ic_modecaps & (1<<ic->ic_curmode)) == 0)
180 ic->ic_curmode = IEEE80211_MODE_AUTO;
181 ic->ic_des_chan = IEEE80211_CHAN_ANYC; /* any channel is ok */
182#if 0
183 /*
184 * Enable WME by default if we're capable.
185 */
186 if (ic->ic_caps & IEEE80211_C_WME)
187 ic->ic_flags |= IEEE80211_F_WME;
188#endif
189 if (ic->ic_caps & IEEE80211_C_BURST)

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

209 * Install a default reset method for the ioctl support.
210 * The driver is expected to fill this in before calling us.
211 */
212 if (ic->ic_reset == NULL)
213 ic->ic_reset = ieee80211_default_reset;
214
215 KASSERT(ifp->if_spare2 == NULL, ("oops, hosed"));
216 ifp->if_spare2 = ic; /* XXX temp backpointer */
217}
218
219void
220ieee80211_ifdetach(struct ieee80211com *ic)
221{
222 struct ifnet *ifp = ic->ic_ifp;
223
224 ieee80211_remove_vap(ic);

--- 808 unchanged lines hidden ---