RIFS support; needs driver callback for dynamic state change
This commit is contained in:
parent
8c070d69c7
commit
44f7a6edcf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183256
@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
|
||||
"\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
|
||||
"\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN\24HT" \
|
||||
"\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN" \
|
||||
"\33SHORTGI20\34SHORTGI40\35HTCOMPAT"
|
||||
"\33SHORTGI20\34SHORTGI40\35HTCOMPAT\36RIFS"
|
||||
|
||||
#define IEEE80211_FVEN_BITS "\20"
|
||||
|
||||
@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define IEEE80211_C_HTCAP_BITS \
|
||||
"\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \
|
||||
"\21AMPDU\22AMSDU\23HT"
|
||||
"\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS"
|
||||
|
||||
/* NB: policy bits not included */
|
||||
#define IEEE80211_CHAN_BITS \
|
||||
@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define IEEE80211_NODE_BITS \
|
||||
"\20\1AUTH\2QOS\3ERP\5PWR_MGT\6AREF\7HT\10HTCOMPAT\11WPS\12TSN" \
|
||||
"\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS"
|
||||
"\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS"
|
||||
|
||||
#define IEEE80211_ERP_BITS \
|
||||
"\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE"
|
||||
|
@ -166,6 +166,10 @@ ieee80211_ht_vattach(struct ieee80211vap *vap)
|
||||
if (vap->iv_htcaps & IEEE80211_HTCAP_SHORTGI40)
|
||||
vap->iv_flags_ext |= IEEE80211_FEXT_SHORTGI40;
|
||||
}
|
||||
/* enable RIFS if capable */
|
||||
if (vap->iv_htcaps & IEEE80211_HTC_RIFS)
|
||||
vap->iv_flags_ext |= IEEE80211_FEXT_RIFS;
|
||||
|
||||
/* NB: A-MPDU and A-MSDU rx are mandated, these are tx only */
|
||||
vap->iv_flags_ext |= IEEE80211_FEXT_AMPDU_RX;
|
||||
if (vap->iv_htcaps & IEEE80211_HTC_AMPDU)
|
||||
@ -963,6 +967,9 @@ ieee80211_ht_wds_init(struct ieee80211_node *ni)
|
||||
ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_NONE;
|
||||
}
|
||||
ni->ni_htctlchan = ni->ni_chan->ic_ieee;
|
||||
if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS)
|
||||
ni->ni_flags |= IEEE80211_NODE_RIFS;
|
||||
/* XXX does it make sense to enable SMPS? */
|
||||
|
||||
ni->ni_htopmode = 0; /* XXX need protection state */
|
||||
ni->ni_htstbc = 0; /* XXX need info */
|
||||
@ -1294,6 +1301,12 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni,
|
||||
htflags = IEEE80211_CHAN_HT40D;
|
||||
}
|
||||
htinfo_update_chw(ni, htflags);
|
||||
|
||||
if ((htinfo->hi_byte1 & IEEE80211_HTINFO_RIFSMODE_PERM) &&
|
||||
(vap->iv_flags_ext & IEEE80211_FEXT_RIFS))
|
||||
ni->ni_flags |= IEEE80211_NODE_RIFS;
|
||||
else
|
||||
ni->ni_flags &= ~IEEE80211_NODE_RIFS;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2211,7 +2224,10 @@ ieee80211_ht_update_beacon(struct ieee80211vap *vap,
|
||||
|
||||
/* XXX only update on channel change */
|
||||
ht->hi_ctrlchannel = ieee80211_chan2ieee(ic, bsschan);
|
||||
ht->hi_byte1 = IEEE80211_HTINFO_RIFSMODE_PROH;
|
||||
if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS)
|
||||
ht->hi_byte1 = IEEE80211_HTINFO_RIFSMODE_PERM;
|
||||
else
|
||||
ht->hi_byte1 = IEEE80211_HTINFO_RIFSMODE_PROH;
|
||||
if (IEEE80211_IS_CHAN_HT40U(bsschan))
|
||||
ht->hi_byte1 |= IEEE80211_HTINFO_2NDCHAN_ABOVE;
|
||||
else if (IEEE80211_IS_CHAN_HT40D(bsschan))
|
||||
@ -2238,6 +2254,7 @@ ieee80211_ht_update_beacon(struct ieee80211vap *vap,
|
||||
static uint8_t *
|
||||
ieee80211_add_htinfo_body(uint8_t *frm, struct ieee80211_node *ni)
|
||||
{
|
||||
struct ieee80211vap *vap = ni->ni_vap;
|
||||
struct ieee80211com *ic = ni->ni_ic;
|
||||
|
||||
/* pre-zero remainder of ie */
|
||||
@ -2246,7 +2263,10 @@ ieee80211_add_htinfo_body(uint8_t *frm, struct ieee80211_node *ni)
|
||||
/* primary/control channel center */
|
||||
*frm++ = ieee80211_chan2ieee(ic, ni->ni_chan);
|
||||
|
||||
frm[0] = IEEE80211_HTINFO_RIFSMODE_PROH;
|
||||
if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS)
|
||||
frm[0] = IEEE80211_HTINFO_RIFSMODE_PERM;
|
||||
else
|
||||
frm[0] = IEEE80211_HTINFO_RIFSMODE_PROH;
|
||||
if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan))
|
||||
frm[0] |= IEEE80211_HTINFO_2NDCHAN_ABOVE;
|
||||
else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))
|
||||
|
@ -1080,6 +1080,15 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd,
|
||||
} else
|
||||
ireq->i_val = vap->iv_htcaps & IEEE80211_HTCAP_SMPS;
|
||||
break;
|
||||
case IEEE80211_IOC_RIFS:
|
||||
if (vap->iv_opmode == IEEE80211_M_STA &&
|
||||
vap->iv_state == IEEE80211_S_RUN)
|
||||
ireq->i_val =
|
||||
(vap->iv_bss->ni_flags & IEEE80211_NODE_RIFS) != 0;
|
||||
else
|
||||
ireq->i_val =
|
||||
(vap->iv_flags_ext & IEEE80211_FEXT_RIFS) != 0;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
@ -3093,6 +3102,17 @@ ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211r
|
||||
if (isvapht(vap))
|
||||
error = ERESTART;
|
||||
break;
|
||||
case IEEE80211_IOC_RIFS:
|
||||
if (ireq->i_val != 0) {
|
||||
if ((vap->iv_htcaps & IEEE80211_HTC_RIFS) == 0)
|
||||
return EOPNOTSUPP;
|
||||
vap->iv_flags_ext |= IEEE80211_FEXT_RIFS;
|
||||
} else
|
||||
vap->iv_flags_ext &= ~IEEE80211_FEXT_RIFS;
|
||||
/* NB: if not operating in 11n this can wait */
|
||||
if (isvapht(vap))
|
||||
error = ERESTART;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
|
@ -610,6 +610,7 @@ struct ieee80211req {
|
||||
#define IEEE80211_IOC_TXPARAMS 108 /* tx parameters */
|
||||
#define IEEE80211_IOC_STA_VLAN 109 /* per-station vlan tag */
|
||||
#define IEEE80211_IOC_SMPS 110 /* MIMO power save */
|
||||
#define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */
|
||||
|
||||
/*
|
||||
* Parameters for controlling a scan requested with
|
||||
|
@ -2264,7 +2264,7 @@ ieee80211_node_join(struct ieee80211_node *ni, int resp)
|
||||
newassoc = 0;
|
||||
|
||||
IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ni,
|
||||
"station associated at aid %d: %s preamble, %s slot time%s%s%s%s%s%s%s",
|
||||
"station associated at aid %d: %s preamble, %s slot time%s%s%s%s%s%s%s%s",
|
||||
IEEE80211_NODE_AID(ni),
|
||||
ic->ic_flags & IEEE80211_F_SHPREAMBLE ? "short" : "long",
|
||||
ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long",
|
||||
@ -2275,6 +2275,7 @@ ieee80211_node_join(struct ieee80211_node *ni, int resp)
|
||||
ni->ni_flags & IEEE80211_NODE_AMPDU ? " (+AMPDU)" : "",
|
||||
ni->ni_flags & IEEE80211_NODE_MIMO_RTS ? " (+SMPS-DYN)" :
|
||||
ni->ni_flags & IEEE80211_NODE_MIMO_PS ? " (+SMPS)" : "",
|
||||
ni->ni_flags & IEEE80211_NODE_RIFS ? " (+RIFS)" : "",
|
||||
IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) ?
|
||||
", fast-frames" : "",
|
||||
IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_TURBOP) ?
|
||||
|
@ -114,6 +114,7 @@ struct ieee80211_node {
|
||||
#define IEEE80211_NODE_AMPDU_TX 0x000800 /* AMPDU tx enabled */
|
||||
#define IEEE80211_NODE_MIMO_PS 0x001000 /* MIMO power save enabled */
|
||||
#define IEEE80211_NODE_MIMO_RTS 0x002000 /* send RTS in MIMO PS */
|
||||
#define IEEE80211_NODE_RIFS 0x004000 /* RIFS enabled */
|
||||
uint16_t ni_associd; /* association ID */
|
||||
uint16_t ni_vlan; /* vlan tag */
|
||||
uint16_t ni_txpower; /* current transmit power */
|
||||
@ -198,7 +199,7 @@ MALLOC_DECLARE(M_80211_NODE_IE);
|
||||
#define IEEE80211_NODE_HT_ALL \
|
||||
(IEEE80211_NODE_HT | IEEE80211_NODE_HTCOMPAT | \
|
||||
IEEE80211_NODE_AMPDU | IEEE80211_NODE_MIMO_PS | \
|
||||
IEEE80211_NODE_MIMO_RTS)
|
||||
IEEE80211_NODE_MIMO_RTS | IEEE80211_NODE_RIFS)
|
||||
|
||||
#define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd)
|
||||
|
||||
|
@ -1538,7 +1538,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
|
||||
ic->ic_flags &= ~IEEE80211_F_USEPROT;
|
||||
IEEE80211_NOTE_MAC(vap,
|
||||
IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, wh->i_addr2,
|
||||
"%sassoc success at aid %d: %s preamble, %s slot time%s%s%s%s%s%s%s",
|
||||
"%sassoc success at aid %d: %s preamble, %s slot time%s%s%s%s%s%s%s%s",
|
||||
ISREASSOC(subtype) ? "re" : "",
|
||||
IEEE80211_NODE_AID(ni),
|
||||
ic->ic_flags&IEEE80211_F_SHPREAMBLE ? "short" : "long",
|
||||
@ -1550,6 +1550,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
|
||||
ni->ni_flags & IEEE80211_NODE_AMPDU ? " (+AMPDU)" : "",
|
||||
ni->ni_flags & IEEE80211_NODE_MIMO_RTS ? " (+SMPS-DYN)" :
|
||||
ni->ni_flags & IEEE80211_NODE_MIMO_PS ? " (+SMPS)" : "",
|
||||
ni->ni_flags & IEEE80211_NODE_RIFS ? " (+RIFS)" : "",
|
||||
IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) ?
|
||||
", fast-frames" : "",
|
||||
IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_TURBOP) ?
|
||||
|
@ -492,6 +492,7 @@ MALLOC_DECLARE(M_80211_VAP);
|
||||
#define IEEE80211_FEXT_SHORTGI20 0x04000000 /* CONF: short GI in HT20 */
|
||||
#define IEEE80211_FEXT_SHORTGI40 0x08000000 /* CONF: short GI in HT40 */
|
||||
#define IEEE80211_FEXT_HTCOMPAT 0x10000000 /* CONF: HT vendor OUI's */
|
||||
#define IEEE80211_FEXT_RIFS 0x20000000 /* CONF: RIFS enabled */
|
||||
|
||||
/* ic_caps/iv_caps: device driver capabilities */
|
||||
/* 0x2f available */
|
||||
@ -535,6 +536,7 @@ MALLOC_DECLARE(M_80211_VAP);
|
||||
/* NB: HT40 is implied by IEEE80211_HTCAP_CHWIDTH40 */
|
||||
#define IEEE80211_HTC_HT 0x00040000 /* CAPABILITY: HT operation */
|
||||
#define IEEE80211_HTC_SMPS 0x00080000 /* CAPABILITY: MIMO power save*/
|
||||
#define IEEE80211_HTC_RIFS 0x00100000 /* CAPABILITY: RIFS support */
|
||||
|
||||
void ieee80211_ifattach(struct ieee80211com *);
|
||||
void ieee80211_ifdetach(struct ieee80211com *);
|
||||
|
Loading…
Reference in New Issue
Block a user