From owner-svn-src-head@freebsd.org Sat Jan 7 05:46:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E21CA2721; Sat, 7 Jan 2017 05:46:23 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CEAD61DF6; Sat, 7 Jan 2017 05:46:22 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id Pjpbc2WJMBSTMPjpccI7YG; Fri, 06 Jan 2017 22:46:20 -0700 X-Authority-Analysis: v=2.2 cv=MKYQoIRl c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=IgFoBzBjUZAA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=YuQMQudxoms_l3NowE4A:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 218E218B2; Fri, 6 Jan 2017 21:46:19 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v075kIGD052277; Fri, 6 Jan 2017 21:46:18 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201701070546.v075kIGD052277@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r311578 - head/sys/net80211 In-Reply-To: Message from Adrian Chadd of "Sat, 07 Jan 2017 01:59:39 +0000." <201701070159.v071xd46009060@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 06 Jan 2017 21:46:18 -0800 X-CMAE-Envelope: MS4wfPq1JLOFe+xS9oGnz1lhs1cVU6Ne1pL+Fhft+jeFSNKJ/xfrvg+T103KDjAzS850OnKzuwuCDud6PfuVDGsEqIAogUjXeIToQx/f6d65vFcXbFGhgdcN Mj6F4iKoFw9PBomzo5BDGzkEONqu/s6LtmxdFkv/TXc8Aipus8fEzXsh8eMCgCzVdUhxlaa1bT9SOelSW3+Xj5vP1RI1C4t8WL6dM8I6oklKtnSYeStqu3NS m7l7MC0J9kUanJBNMCPhTOTygleGUkgKl8wM7A5vzprkmmoVcDTL3d3L1WmGf3sj X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2017 05:46:23 -0000 In message <201701070159.v071xd46009060@repo.freebsd.org>, Adrian Chadd writes: > Author: adrian > Date: Sat Jan 7 01:59:39 2017 > New Revision: 311578 > URL: https://svnweb.freebsd.org/changeset/base/311578 > > Log: > [net80211] add VHT ioctl parameters and driver capabilities > > * Add the VHT capability element to the driver capabilities so ifconfig > can see if VHT is available > * Add ioctl plumbing for enabling/disabling VHT and each of the VHT > widths. > > Note: this DOES change the ABI (the driver caps ioctl struct size, sigh) > so this will require a recompile of at least ifconfig. > > Modified: > head/sys/net80211/ieee80211_ioctl.c > head/sys/net80211/ieee80211_ioctl.h > > Modified: head/sys/net80211/ieee80211_ioctl.c > ============================================================================= > = > --- head/sys/net80211/ieee80211_ioctl.c Sat Jan 7 01:56:10 2017 > (r311577) > +++ head/sys/net80211/ieee80211_ioctl.c Sat Jan 7 01:59:39 2017 > (r311578) > @@ -710,6 +710,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80 > dc->dc_drivercaps = ic->ic_caps; > dc->dc_cryptocaps = ic->ic_cryptocaps; > dc->dc_htcaps = ic->ic_htcaps; > + dc->dc_vhtcaps = ic->ic_vhtcaps; > ci = &dc->dc_chaninfo; > ic->ic_getradiocaps(ic, maxchans, &ci->ic_nchans, ci->ic_chans); > KASSERT(ci->ic_nchans <= maxchans, > @@ -1135,6 +1136,22 @@ ieee80211_ioctl_get80211(struct ieee8021 > if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) > ireq->i_val |= 2; > break; > + > + /* 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; > + break; > + > default: > error = ieee80211_ioctl_getdefault(vap, ireq); > break; > @@ -1869,6 +1886,8 @@ findchannel(struct ieee80211com *ic, int > /* NB: handled specially below */ > [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, > [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, > + [IEEE80211_MODE_VHT_5GHZ] = IEEE80211_CHAN_A, > + [IEEE80211_MODE_VHT_2GHZ] = IEEE80211_CHAN_G, > }; > u_int modeflags; > int i; > @@ -1893,11 +1912,27 @@ findchannel(struct ieee80211com *ic, int > !find11gchannel(ic, i, c->ic_freq)) > return c; > } else { > - /* must check HT specially */ > + /* must check VHT specifically */ > + if ((mode == IEEE80211_MODE_VHT_5GHZ || > + mode == IEEE80211_MODE_VHT_2GHZ) && > + !IEEE80211_IS_CHAN_VHT(c)) > + continue; > + > + /* > + * Must check HT specially - only match on HT, > + * not HT+VHT channels > + */ > if ((mode == IEEE80211_MODE_11NA || > mode == IEEE80211_MODE_11NG) && > !IEEE80211_IS_CHAN_HT(c)) > continue; > + > + if ((mode == IEEE80211_MODE_11NA || > + mode == IEEE80211_MODE_11NG) && > + IEEE80211_IS_CHAN_VHT(c)) > + continue; > + > + /* Check that the modeflags above match */ > if ((c->ic_flags & modeflags) == modeflags) > return c; > } > @@ -2021,6 +2056,7 @@ ieee80211_ioctl_setchannel(struct ieee80 > if (c == NULL) > return EINVAL; > } > + > /* > * Fine tune channel selection based on desired mode: > * if 11b is requested, find the 11b version of any > @@ -2031,6 +2067,9 @@ ieee80211_ioctl_setchannel(struct ieee80 > * 11a channel returned, > * if 11ng is requested, find the ht version of any > * 11g channel returned, > + * if 11ac is requested, find the 11ac version > + * of any 11a/11na channel returned, > + * (TBD) 11acg (2GHz VHT) > * otherwise we should be ok with what we've got. > */ > switch (vap->iv_des_mode) { > @@ -2067,6 +2106,17 @@ ieee80211_ioctl_setchannel(struct ieee80 > c = c2; > } > break; > + case IEEE80211_MODE_VHT_2GHZ: > + printf("%s: TBD\n", __func__); > + break; > + case IEEE80211_MODE_VHT_5GHZ: > + if (IEEE80211_IS_CHAN_A(c)) { > + c2 = findchannel(ic, ireq->i_val, > + IEEE80211_MODE_VHT_5GHZ); > + if (c2 != NULL) > + c = c2; > + } > + break; > default: /* NB: no static turboG */ > break; > } > @@ -2092,6 +2142,7 @@ ieee80211_ioctl_setcurchan(struct ieee80 > error = copyin(ireq->i_data, &chan, sizeof(chan)); > if (error != 0) > return error; > + > /* XXX 0xffff overflows 16-bit signed */ > if (chan.ic_freq == 0 || chan.ic_freq == IEEE80211_CHAN_ANY) { > c = IEEE80211_CHAN_ANYC; > @@ -3321,6 +3372,37 @@ ieee80211_ioctl_set80211(struct ieee8021 > if (isvapht(vap)) > error = ERESTART; > break; > + > + /* VHT */ > + case IEEE80211_IOC_VHTCONF: > + if (ireq->i_val & 1) > + ieee80211_syncflag_vht(vap, IEEE80211_FVHT_VHT); > + else > + ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_VHT); > + > + if (ireq->i_val & 2) > + ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT40); > + else > + ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT40); > + > + if (ireq->i_val & 4) > + 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) > + ieee80211_syncflag_vht(vap, IEEE80211_FVHT_USEVHT160); > + else > + ieee80211_syncflag_vht(vap, -IEEE80211_FVHT_USEVHT160); Buildkernel is broken. Should these calls be to ieee80211_syncflag_ht instead or is there a missing new function? > + > + error = ENETRESET; > + break; > + > default: > error = ieee80211_ioctl_setdefault(vap, ireq); > break; > > Modified: head/sys/net80211/ieee80211_ioctl.h > ============================================================================= > = > --- head/sys/net80211/ieee80211_ioctl.h Sat Jan 7 01:56:10 2017 > (r311577) > +++ head/sys/net80211/ieee80211_ioctl.h Sat Jan 7 01:59:39 2017 > (r311578) > @@ -556,6 +556,7 @@ struct ieee80211_devcaps_req { > uint32_t dc_drivercaps; /* general driver caps */ > uint32_t dc_cryptocaps; /* hardware crypto support */ > uint32_t dc_htcaps; /* HT/802.11n support */ > + uint32_t dc_vhtcaps; /* VHT/802.11ac capabilities */ > struct ieee80211req_chaninfo dc_chaninfo; > }; > #define IEEE80211_DEVCAPS_SIZE(_nchan) \ > @@ -704,6 +705,9 @@ struct ieee80211req { > #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) > */ > #define IEEE80211_IOC_LDPC 114 /* LDPC Tx/RX (on, off) > */ > > +/* VHT */ > +#define IEEE80211_IOC_VHTCONF 130 /* VHT config (off, on; > widths) */ > + > #define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */ > #define IEEE80211_IOC_MESH_AP 171 /* accepting peerings * > / > #define IEEE80211_IOC_MESH_FWRD 172 /* forward frames */ > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.