Deleted Added
full compact
ieee80211.c (219599) ieee80211.c (228621)
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.c 219599 2011-03-13 11:47:43Z bschmidt $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 228621 2011-12-17 10:23:17Z bschmidt $");
29
30/*
31 * IEEE 802.11 generic handler
32 */
33#include "opt_wlan.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

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

379
380/*
381 * Prepare a vap for use. Drivers use this call to
382 * setup net80211 state in new vap's prior attaching
383 * them with ieee80211_vap_attach (below).
384 */
385int
386ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
29
30/*
31 * IEEE 802.11 generic handler
32 */
33#include "opt_wlan.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

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

379
380/*
381 * Prepare a vap for use. Drivers use this call to
382 * setup net80211 state in new vap's prior attaching
383 * them with ieee80211_vap_attach (below).
384 */
385int
386ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
387 const char name[IFNAMSIZ], int unit, int opmode, int flags,
388 const uint8_t bssid[IEEE80211_ADDR_LEN],
389 const uint8_t macaddr[IEEE80211_ADDR_LEN])
387 const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode,
388 int flags, const uint8_t bssid[IEEE80211_ADDR_LEN],
389 const uint8_t macaddr[IEEE80211_ADDR_LEN])
390{
391 struct ifnet *ifp;
392
393 ifp = if_alloc(IFT_ETHER);
394 if (ifp == NULL) {
395 if_printf(ic->ic_ifp, "%s: unable to allocate ifnet\n",
396 __func__);
397 return ENOMEM;

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

442 * Propagate TDMA capability to mark vap; this
443 * cannot be removed and is used to distinguish
444 * regular ahdemo operation from ahdemo+tdma.
445 */
446 vap->iv_caps |= IEEE80211_C_TDMA;
447 }
448 break;
449#endif
390{
391 struct ifnet *ifp;
392
393 ifp = if_alloc(IFT_ETHER);
394 if (ifp == NULL) {
395 if_printf(ic->ic_ifp, "%s: unable to allocate ifnet\n",
396 __func__);
397 return ENOMEM;

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

442 * Propagate TDMA capability to mark vap; this
443 * cannot be removed and is used to distinguish
444 * regular ahdemo operation from ahdemo+tdma.
445 */
446 vap->iv_caps |= IEEE80211_C_TDMA;
447 }
448 break;
449#endif
450 default:
451 break;
450 }
451 /* auto-enable s/w beacon miss support */
452 if (flags & IEEE80211_CLONE_NOBEACONS)
453 vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS;
454 /* auto-generated or user supplied MAC address */
455 if (flags & (IEEE80211_CLONE_BSSID|IEEE80211_CLONE_MACADDR))
456 vap->iv_flags_ext |= IEEE80211_FEXT_UNIQMAC;
457 /*

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

1003 * Setup the media data structures according to the channel and
1004 * rate tables.
1005 */
1006static int
1007ieee80211_media_setup(struct ieee80211com *ic,
1008 struct ifmedia *media, int caps, int addsta,
1009 ifm_change_cb_t media_change, ifm_stat_cb_t media_stat)
1010{
452 }
453 /* auto-enable s/w beacon miss support */
454 if (flags & IEEE80211_CLONE_NOBEACONS)
455 vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS;
456 /* auto-generated or user supplied MAC address */
457 if (flags & (IEEE80211_CLONE_BSSID|IEEE80211_CLONE_MACADDR))
458 vap->iv_flags_ext |= IEEE80211_FEXT_UNIQMAC;
459 /*

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

1005 * Setup the media data structures according to the channel and
1006 * rate tables.
1007 */
1008static int
1009ieee80211_media_setup(struct ieee80211com *ic,
1010 struct ifmedia *media, int caps, int addsta,
1011 ifm_change_cb_t media_change, ifm_stat_cb_t media_stat)
1012{
1011 int i, j, mode, rate, maxrate, mword, r;
1013 int i, j, rate, maxrate, mword, r;
1014 enum ieee80211_phymode mode;
1012 const struct ieee80211_rateset *rs;
1013 struct ieee80211_rateset allrates;
1014
1015 /*
1016 * Fill in media characteristics.
1017 */
1018 ifmedia_init(media, 0, media_change, media_stat);
1019 maxrate = 0;

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

1132 /* XXX does this work for 11ng basic rates? */
1133 return &ic->ic_sup_rates[ieee80211_chan2mode(c)];
1134}
1135
1136void
1137ieee80211_announce(struct ieee80211com *ic)
1138{
1139 struct ifnet *ifp = ic->ic_ifp;
1015 const struct ieee80211_rateset *rs;
1016 struct ieee80211_rateset allrates;
1017
1018 /*
1019 * Fill in media characteristics.
1020 */
1021 ifmedia_init(media, 0, media_change, media_stat);
1022 maxrate = 0;

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

1135 /* XXX does this work for 11ng basic rates? */
1136 return &ic->ic_sup_rates[ieee80211_chan2mode(c)];
1137}
1138
1139void
1140ieee80211_announce(struct ieee80211com *ic)
1141{
1142 struct ifnet *ifp = ic->ic_ifp;
1140 int i, mode, rate, mword;
1143 int i, rate, mword;
1144 enum ieee80211_phymode mode;
1141 const struct ieee80211_rateset *rs;
1142
1143 /* NB: skip AUTO since it has no rates */
1144 for (mode = IEEE80211_MODE_AUTO+1; mode < IEEE80211_MODE_11NA; mode++) {
1145 if (isclr(ic->ic_modecaps, mode))
1146 continue;
1147 if_printf(ifp, "%s rates: ", ieee80211_phymode_name[mode]);
1148 rs = &ic->ic_sup_rates[mode];

--- 567 unchanged lines hidden ---
1145 const struct ieee80211_rateset *rs;
1146
1147 /* NB: skip AUTO since it has no rates */
1148 for (mode = IEEE80211_MODE_AUTO+1; mode < IEEE80211_MODE_11NA; mode++) {
1149 if (isclr(ic->ic_modecaps, mode))
1150 continue;
1151 if_printf(ifp, "%s rates: ", ieee80211_phymode_name[mode]);
1152 rs = &ic->ic_sup_rates[mode];

--- 567 unchanged lines hidden ---