aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-10-07 22:29:26 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-10-07 22:29:26 +0000
commitfa8bc7ed925bbe7f25c159a7f61c4292ad3fd0af (patch)
tree7a702883bdd5200e61071964e190419df224ef42 /sbin/ifconfig
parent90707c4e44de03ea36be183ef2226601c66169cb (diff)
downloadsrc-fa8bc7ed925bbe7f25c159a7f61c4292ad3fd0af.tar.gz
src-fa8bc7ed925bbe7f25c159a7f61c4292ad3fd0af.zip
80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()
As we did in the kernel in r366112 replace the MS() macro with the version(s) added to the kernel: _IEEE80211_MASKSHIFT(). Also provide its counter part. This will later allow use to use other macros defined in net80211 headers here in ifconfig. MFC after: 1 week Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=366524
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifieee80211.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index e27623ecef5e..5d2f462147c1 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -138,6 +138,14 @@
#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */
#endif
+/* Helper macros unified. */
+#ifndef _IEEE80211_MASKSHIFT
+#define _IEEE80211_MASKSHIFT(_v, _f) (((_v) & _f) >> _f##_S)
+#endif
+#ifndef _IEEE80211_SHIFTMASK
+#define _IEEE80211_SHIFTMASK(_v, _f) (((_v) << _f##_S) & _f)
+#endif
+
#define MAXCHAN 1536 /* max 1.5K channels */
#define MAXCOL 78
@@ -2706,7 +2714,6 @@ printie(const char* tag, const uint8_t *ie, size_t ielen, int maxlen)
static void
printwmeparam(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
{
-#define MS(_v, _f) (((_v) & _f) >> _f##_S)
static const char *acnames[] = { "BE", "BK", "VO", "VI" };
const struct ieee80211_wme_param *wme =
(const struct ieee80211_wme_param *) ie;
@@ -2721,17 +2728,17 @@ printwmeparam(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
const struct ieee80211_wme_acparams *ac =
&wme->params_acParams[i];
- printf(" %s[%saifsn %u cwmin %u cwmax %u txop %u]"
- , acnames[i]
- , MS(ac->acp_aci_aifsn, WME_PARAM_ACM) ? "acm " : ""
- , MS(ac->acp_aci_aifsn, WME_PARAM_AIFSN)
- , MS(ac->acp_logcwminmax, WME_PARAM_LOGCWMIN)
- , MS(ac->acp_logcwminmax, WME_PARAM_LOGCWMAX)
- , LE_READ_2(&ac->acp_txop)
- );
+ printf(" %s[%saifsn %u cwmin %u cwmax %u txop %u]", acnames[i],
+ _IEEE80211_MASKSHIFT(ac->acp_aci_aifsn, WME_PARAM_ACM) ?
+ "acm " : "",
+ _IEEE80211_MASKSHIFT(ac->acp_aci_aifsn, WME_PARAM_AIFSN),
+ _IEEE80211_MASKSHIFT(ac->acp_logcwminmax,
+ WME_PARAM_LOGCWMIN),
+ _IEEE80211_MASKSHIFT(ac->acp_logcwminmax,
+ WME_PARAM_LOGCWMAX),
+ LE_READ_2(&ac->acp_txop));
}
printf(">");
-#undef MS
}
static void