Index: head/sbin/ifconfig/ifieee80211.c =================================================================== --- head/sbin/ifconfig/ifieee80211.c +++ head/sbin/ifconfig/ifieee80211.c @@ -129,6 +129,15 @@ #define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */ #endif +/* XXX should also figure out where to put these for k/u-space sharing. */ +#ifndef IEEE80211_FVHT_VHT +#define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ +#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ +#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#endif + #define MAXCHAN 1536 /* max 1.5K channels */ #define MAXCOL 78 @@ -5331,26 +5340,26 @@ if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(s); - if (vhtconf & 0x1) + if (vhtconf & IEEE80211_FVHT_VHT) LINE_CHECK("vht"); else LINE_CHECK("-vht"); - if (vhtconf & 0x2) + if (vhtconf & IEEE80211_FVHT_USEVHT40) LINE_CHECK("vht40"); else LINE_CHECK("-vht40"); - if (vhtconf & 0x4) + if (vhtconf & IEEE80211_FVHT_USEVHT80) LINE_CHECK("vht80"); else LINE_CHECK("-vht80"); - if (vhtconf & 0x8) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); - if (vhtconf & 0x10) + if (vhtconf & IEEE80211_FVHT_USEVHT160) LINE_CHECK("vht160"); else LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5951,16 +5960,16 @@ DEF_CMD("-ht40", 0, set80211htconf), DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), - DEF_CMD("vht", 1, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), - DEF_CMD("vht40", 2, set80211vhtconf), - DEF_CMD("-vht40", -2, set80211vhtconf), - DEF_CMD("vht80", 4, set80211vhtconf), - DEF_CMD("-vht80", -4, set80211vhtconf), - DEF_CMD("vht80p80", 8, set80211vhtconf), - DEF_CMD("-vht80p80", -8, set80211vhtconf), - DEF_CMD("vht160", 16, set80211vhtconf), - DEF_CMD("-vht160", -16, set80211vhtconf), + DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), + DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("-vht80", -IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("vht160", IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("-vht160", -IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("vht80p80", IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), + DEF_CMD("-vht80p80", -IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), DEF_CMD("rifs", 1, set80211rifs), DEF_CMD("-rifs", 0, set80211rifs), DEF_CMD("smps", IEEE80211_HTCAP_SMPS_ENA, set80211smps), Index: head/sys/net80211/ieee80211_ioctl.c =================================================================== --- head/sys/net80211/ieee80211_ioctl.c +++ head/sys/net80211/ieee80211_ioctl.c @@ -1162,17 +1162,7 @@ /* VHT */ case IEEE80211_IOC_VHTCONF: - ireq->i_val = 0; - if (vap->iv_flags_vht & IEEE80211_FVHT_VHT) - ireq->i_val |= 1; - if (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT40) - ireq->i_val |= 2; - if (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT80) - ireq->i_val |= 4; - if (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT80P80) - ireq->i_val |= 8; - if (vap->iv_flags_vht & IEEE80211_FVHT_USEVHT160) - ireq->i_val |= 16; + ireq->i_val = vap->iv_flags_vht & IEEE80211_FVHT_MASK; break; default: @@ -3493,30 +3483,30 @@ /* VHT */ case IEEE80211_IOC_VHTCONF: - if (ireq->i_val & 1) + if (ireq->i_val & IEEE80211_FVHT_VHT) ieee80211_syncflag_vht(vap, IEEE80211_FVHT_VHT); else ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_VHT); - if (ireq->i_val & 2) + if (ireq->i_val & IEEE80211_FVHT_USEVHT40) ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT40); else ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT40); - if (ireq->i_val & 4) + if (ireq->i_val & IEEE80211_FVHT_USEVHT80) ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT80); else ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT80); - if (ireq->i_val & 8) - ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT80P80); - else - ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT80P80); - - if (ireq->i_val & 16) + if (ireq->i_val & IEEE80211_FVHT_USEVHT160) ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT160); else ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT160); + + if (ireq->i_val & IEEE80211_FVHT_USEVHT80P80) + ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT80P80); + else + ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT80P80); error = ENETRESET; break; Index: head/sys/net80211/ieee80211_var.h =================================================================== --- head/sys/net80211/ieee80211_var.h +++ head/sys/net80211/ieee80211_var.h @@ -724,10 +724,14 @@ #define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ #define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ #define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ -#define IEEE80211_FVHT_USEVHT80P80 0x000000008 /* CONF: Use VHT 80+80 */ -#define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#define IEEE80211_FVHT_MASK \ + (IEEE80211_FVHT_VHT | IEEE80211_FVHT_USEVHT40 | \ + IEEE80211_FVHT_USEVHT80 | IEEE80211_FVHT_USEVHT160 | \ + IEEE80211_FVHT_USEVHT80P80) #define IEEE80211_VFHT_BITS \ - "\20\1VHT\2VHT40\3VHT80\4VHT80P80\5VHT160" + "\20\1VHT\2VHT40\3VHT80\4VHT160\5VHT80P80" #define IEEE80211_COM_DETACHED 0x00000001 /* ieee80211_ifdetach called */ #define IEEE80211_COM_REF_ADD 0x00000002 /* add / remove reference */ @@ -920,10 +924,10 @@ ieee80211_vhtchanflags(const struct ieee80211_channel *c) { - if (IEEE80211_IS_CHAN_VHT160(c)) - return IEEE80211_FVHT_USEVHT160; if (IEEE80211_IS_CHAN_VHT80_80(c)) return IEEE80211_FVHT_USEVHT80P80; + if (IEEE80211_IS_CHAN_VHT160(c)) + return IEEE80211_FVHT_USEVHT160; if (IEEE80211_IS_CHAN_VHT80(c)) return IEEE80211_FVHT_USEVHT80; if (IEEE80211_IS_CHAN_VHT40(c)) Index: head/sys/net80211/ieee80211_vht.c =================================================================== --- head/sys/net80211/ieee80211_vht.c +++ head/sys/net80211/ieee80211_vht.c @@ -161,7 +161,13 @@ IEEE80211_FVHT_VHT | IEEE80211_FVHT_USEVHT40 | IEEE80211_FVHT_USEVHT80; +#if 0 /* XXX TODO: enable VHT80+80, VHT160 capabilities */ + if (XXX TODO FIXME) + vap->iv_flags_vht |= IEEE80211_FVHT_USEVHT160; + if (XXX TODO FIXME) + vap->iv_flags_vht |= IEEE80211_FVHT_USEVHT80P80; +#endif memcpy(&vap->iv_vht_mcsinfo, &ic->ic_vht_mcsinfo, sizeof(struct ieee80211_vht_mcs_info));