Deleted Added
full compact
ifieee80211.c (297010) ifieee80211.c (298252)
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 297010 2016-03-18 04:22:07Z adrian $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 298252 2016-04-19 05:17:43Z adrian $
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,

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

2568 vhtinfo->chan_width,
2569 vhtinfo->center_freq_seg1_idx,
2570 vhtinfo->center_freq_seg2_idx,
2571 LE_READ_2(&vhtinfo->basic_mcs_set));
2572 }
2573}
2574
2575static void
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,

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

2568 vhtinfo->chan_width,
2569 vhtinfo->center_freq_seg1_idx,
2570 vhtinfo->center_freq_seg2_idx,
2571 LE_READ_2(&vhtinfo->basic_mcs_set));
2572 }
2573}
2574
2575static void
2576printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2577{
2578 printf("%s", tag);
2579 static const char *txpwrmap[] = {
2580 "20",
2581 "40",
2582 "80",
2583 "160",
2584 };
2585 if (verbose) {
2586 const struct ieee80211_ie_vht_txpwrenv *vhtpwr =
2587 (const struct ieee80211_ie_vht_txpwrenv *) ie;
2588 int i, n;
2589 const char *sep = "";
2590
2591 /* Get count; trim at ielen */
2592 n = (vhtpwr->tx_info &
2593 IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK) + 1;
2594 /* Trim at ielen */
2595 if (n > ielen - 3)
2596 n = ielen - 3;
2597 printf("<tx_info 0x%02x pwr:[", vhtpwr->tx_info);
2598 for (i = 0; i < n; i++) {
2599 printf("%s%s:%.2f", sep, txpwrmap[i],
2600 ((float) ((int8_t) ie[i+3])) / 2.0);
2601 sep = " ";
2602 }
2603
2604 printf("]>");
2605 }
2606}
2607
2608static void
2576printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2577{
2578 printf("%s", tag);
2579 if (verbose) {
2580 const struct ieee80211_ie_htcap *htcap =
2581 (const struct ieee80211_ie_htcap *) ie;
2582 const char *sep;
2583 int i, j;

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

3146 case IEEE80211_ELEMID_SUPPCHAN: return " SUPPCHAN";
3147 case IEEE80211_ELEMID_CSA: return " CSA";
3148 case IEEE80211_ELEMID_MEASREQ: return " MEASREQ";
3149 case IEEE80211_ELEMID_MEASREP: return " MEASREP";
3150 case IEEE80211_ELEMID_QUIET: return " QUIET";
3151 case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS";
3152 case IEEE80211_ELEMID_TPC: return " TPC";
3153 case IEEE80211_ELEMID_CCKM: return " CCKM";
2609printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
2610{
2611 printf("%s", tag);
2612 if (verbose) {
2613 const struct ieee80211_ie_htcap *htcap =
2614 (const struct ieee80211_ie_htcap *) ie;
2615 const char *sep;
2616 int i, j;

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

3179 case IEEE80211_ELEMID_SUPPCHAN: return " SUPPCHAN";
3180 case IEEE80211_ELEMID_CSA: return " CSA";
3181 case IEEE80211_ELEMID_MEASREQ: return " MEASREQ";
3182 case IEEE80211_ELEMID_MEASREP: return " MEASREP";
3183 case IEEE80211_ELEMID_QUIET: return " QUIET";
3184 case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS";
3185 case IEEE80211_ELEMID_TPC: return " TPC";
3186 case IEEE80211_ELEMID_CCKM: return " CCKM";
3154 case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV";
3155 }
3156 return " ???";
3157}
3158
3159static void
3160printies(const u_int8_t *vp, int ielen, int maxcols)
3161{
3162 while (ielen > 0) {

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

3217 printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
3218 break;
3219 case IEEE80211_ELEMID_VHT_CAP:
3220 printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols);
3221 break;
3222 case IEEE80211_ELEMID_VHT_OPMODE:
3223 printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
3224 break;
3187 }
3188 return " ???";
3189}
3190
3191static void
3192printies(const u_int8_t *vp, int ielen, int maxcols)
3193{
3194 while (ielen > 0) {

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

3249 printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
3250 break;
3251 case IEEE80211_ELEMID_VHT_CAP:
3252 printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols);
3253 break;
3254 case IEEE80211_ELEMID_VHT_OPMODE:
3255 printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
3256 break;
3257 case IEEE80211_ELEMID_VHT_PWR_ENV:
3258 printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1], maxcols);
3259 break;
3225 case IEEE80211_ELEMID_BSSLOAD:
3226 printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
3227 break;
3228 case IEEE80211_ELEMID_APCHANREP:
3229 printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols);
3230 break;
3231 default:
3232 if (verbose)

--- 2147 unchanged lines hidden ---
3260 case IEEE80211_ELEMID_BSSLOAD:
3261 printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
3262 break;
3263 case IEEE80211_ELEMID_APCHANREP:
3264 printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols);
3265 break;
3266 default:
3267 if (verbose)

--- 2147 unchanged lines hidden ---