Deleted Added
full compact
ifieee80211.c (183261) ifieee80211.c (186101)
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 183261 2008-09-22 00:30:26Z sam $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 186101 2008-12-15 01:06:49Z sam $
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

1765 uint32_t flags = nb->flags | b->flags;
1766
1767 /* check if device can operate on this frequency */
1768 if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, chanFlags) == NULL) {
1769 if (verbose)
1770 printf("%u: skip, flags 0x%x not available\n", freq, chanFlags);
1771 continue;
1772 }
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

1765 uint32_t flags = nb->flags | b->flags;
1766
1767 /* check if device can operate on this frequency */
1768 if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, chanFlags) == NULL) {
1769 if (verbose)
1770 printf("%u: skip, flags 0x%x not available\n", freq, chanFlags);
1771 continue;
1772 }
1773 /*
1774 * NB: don't enforce 1/2 and 1/4 rate channels being
1775 * specified in the device's calibration list for
1776 * 900MHz cards because most are not self-identifying.
1777 */
1773 if ((flags & IEEE80211_CHAN_HALF) &&
1778 if ((flags & IEEE80211_CHAN_HALF) &&
1774 (chanFlags & IEEE80211_CHAN_HALF) == 0) {
1779 ((chanFlags & IEEE80211_CHAN_HALF) == 0 &&
1780 (flags & IEEE80211_CHAN_GSM) == 0)) {
1775 if (verbose)
1776 printf("%u: skip, device does not support half-rate channels\n", freq);
1777 continue;
1778 }
1779 if ((flags & IEEE80211_CHAN_QUARTER) &&
1781 if (verbose)
1782 printf("%u: skip, device does not support half-rate channels\n", freq);
1783 continue;
1784 }
1785 if ((flags & IEEE80211_CHAN_QUARTER) &&
1780 (chanFlags & IEEE80211_CHAN_QUARTER) == 0) {
1786 ((chanFlags & IEEE80211_CHAN_HALF) == 0 &&
1787 (flags & IEEE80211_CHAN_GSM) == 0)) {
1781 if (verbose)
1782 printf("%u: skip, device does not support quarter-rate channels\n", freq);
1783 continue;
1784 }
1785 if ((flags & IEEE80211_CHAN_HT20) &&
1786 (chanFlags & IEEE80211_CHAN_HT20) == 0) {
1787 if (verbose)
1788 printf("%u: skip, device does not support HT20 operation\n", freq);

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

3529get80211opmode(int s)
3530{
3531 struct ifmediareq ifmr;
3532
3533 (void) memset(&ifmr, 0, sizeof(ifmr));
3534 (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
3535
3536 if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) {
1788 if (verbose)
1789 printf("%u: skip, device does not support quarter-rate channels\n", freq);
1790 continue;
1791 }
1792 if ((flags & IEEE80211_CHAN_HT20) &&
1793 (chanFlags & IEEE80211_CHAN_HT20) == 0) {
1794 if (verbose)
1795 printf("%u: skip, device does not support HT20 operation\n", freq);

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

3536get80211opmode(int s)
3537{
3538 struct ifmediareq ifmr;
3539
3540 (void) memset(&ifmr, 0, sizeof(ifmr));
3541 (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
3542
3543 if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) {
3537 if (ifmr.ifm_current & IFM_IEEE80211_ADHOC)
3538 return IEEE80211_M_IBSS; /* XXX ahdemo */
3544 if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) {
3545 if (ifmr.ifm_current & IFM_FLAG0)
3546 return IEEE80211_M_AHDEMO;
3547 else
3548 return IEEE80211_M_IBSS;
3549 }
3539 if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP)
3540 return IEEE80211_M_HOSTAP;
3541 if (ifmr.ifm_current & IFM_IEEE80211_MONITOR)
3542 return IEEE80211_M_MONITOR;
3543 }
3544 return IEEE80211_M_STA;
3545}
3546

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

4239 default:
4240 LINE_CHECK("roaming UNKNOWN (0x%x)",
4241 val);
4242 break;
4243 }
4244 }
4245 }
4246 }
3550 if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP)
3551 return IEEE80211_M_HOSTAP;
3552 if (ifmr.ifm_current & IFM_IEEE80211_MONITOR)
3553 return IEEE80211_M_MONITOR;
3554 }
3555 return IEEE80211_M_STA;
3556}
3557

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

4250 default:
4251 LINE_CHECK("roaming UNKNOWN (0x%x)",
4252 val);
4253 break;
4254 }
4255 }
4256 }
4257 }
4258
4247 if (get80211val(s, IEEE80211_IOC_BEACON_INTERVAL, &val) != -1) {
4248 /* XXX default define not visible */
4249 if (val != 100 || verbose)
4250 LINE_CHECK("bintval %u", val);
4251 }
4252
4253 if (wme && verbose) {
4254 LINE_BREAK();

--- 420 unchanged lines hidden ---
4259 if (get80211val(s, IEEE80211_IOC_BEACON_INTERVAL, &val) != -1) {
4260 /* XXX default define not visible */
4261 if (val != 100 || verbose)
4262 LINE_CHECK("bintval %u", val);
4263 }
4264
4265 if (wme && verbose) {
4266 LINE_BREAK();

--- 420 unchanged lines hidden ---