Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Mark Kettenis
> Date: Fri, 27 Oct 2017 20:08:43 +0200
> From: Stefan Sperling 
> 
> On Fri, Oct 27, 2017 at 04:47:20PM +0200, Mark Kettenis wrote:
> > I don't know, but with the ioctl removed, there is nothing that sets
> > the IEEE80211_F_QOS flag anymore.  That seems weird.
> 
> This flag is just unused for now.
> It is a left-over from unfinished 11n support code by damien.
> But I expect that it will be useful.
> 
> A-MPDU frames (sent with Tx aggregation) are QoS frames.
> So we're not sending QoS frames yet, we are just receiving them.
> The receiving code path can detect QoS by checking for QoS headers
> in received frames, which works without a flag.
> 
> But the flag is already wired up in some of the Tx logic, and I
> expect the F_QOS flag will eventually be used as part of a Tx agg
> implementation. It could be set by drivers in order to enable QoS
> and thus advertise A-MPDU Tx support to net80211 (there is no good
> reason for using QoS without 11n). The stack then knows that it
> needs to supply QoS frame headers, and can provide a Tx subframe
> re-ordering buffer for drivers for cases where firmware doesn't
> provide one.

Thanks for the explanation!



Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Stefan Sperling
On Fri, Oct 27, 2017 at 04:47:20PM +0200, Mark Kettenis wrote:
> I don't know, but with the ioctl removed, there is nothing that sets
> the IEEE80211_F_QOS flag anymore.  That seems weird.

This flag is just unused for now.
It is a left-over from unfinished 11n support code by damien.
But I expect that it will be useful.

A-MPDU frames (sent with Tx aggregation) are QoS frames.
So we're not sending QoS frames yet, we are just receiving them.
The receiving code path can detect QoS by checking for QoS headers
in received frames, which works without a flag.

But the flag is already wired up in some of the Tx logic, and I
expect the F_QOS flag will eventually be used as part of a Tx agg
implementation. It could be set by drivers in order to enable QoS
and thus advertise A-MPDU Tx support to net80211 (there is no good
reason for using QoS without 11n). The stack then knows that it
needs to supply QoS frame headers, and can provide a Tx subframe
re-ordering buffer for drivers for cases where firmware doesn't
provide one.



Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Mark Kettenis
> Date: Fri, 27 Oct 2017 23:57:35 +1100
> From: Jonathan Gray 
> 
> On Fri, Oct 27, 2017 at 02:34:32PM +0200, Mark Kettenis wrote:
> > > Date: Fri, 27 Oct 2017 12:33:15 +0200
> > > From: Stefan Sperling 
> > > 
> > > On Fri, Oct 27, 2017 at 09:08:07PM +1100, Jonathan Gray wrote:
> > > > use in ifconfig was removed in 2009
> > > 
> > > Yes, please remove this. Thanks.
> > 
> > How would one go about setting QoS mode without this ioctl?
> 
> Is it needed outside of when it is implied as described in the
> ifconfig commit?

I don't know, but with the ioctl removed, there is nothing that sets
the IEEE80211_F_QOS flag anymore.  That seems weird.

> 
> revision 1.213
> date: 2009/02/15 08:34:36;  author: damien;  state: Exp;  lines: +56 -35;
> make "ifconfig if0 chan" list the channels supported by the device.
> add "ifconfig if0 scan" to scan for access points or to list known
> stations in Host AP mode.
> remove the [-]wmm command while i'm here.  QoS is mandatory with
> 802.11n so there's not much point into making it an option.
> fix parsing of the "powersave" command too.
> 
> discussed with deraadt@
> man page hints from jmc@
> display hints from sobrado@
> "i like it" cnst@, grange@
> 
> 



Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Jonathan Gray
On Fri, Oct 27, 2017 at 02:34:32PM +0200, Mark Kettenis wrote:
> > Date: Fri, 27 Oct 2017 12:33:15 +0200
> > From: Stefan Sperling 
> > 
> > On Fri, Oct 27, 2017 at 09:08:07PM +1100, Jonathan Gray wrote:
> > > use in ifconfig was removed in 2009
> > 
> > Yes, please remove this. Thanks.
> 
> How would one go about setting QoS mode without this ioctl?

Is it needed outside of when it is implied as described in the
ifconfig commit?


revision 1.213
date: 2009/02/15 08:34:36;  author: damien;  state: Exp;  lines: +56 -35;
make "ifconfig if0 chan" list the channels supported by the device.
add "ifconfig if0 scan" to scan for access points or to list known
stations in Host AP mode.
remove the [-]wmm command while i'm here.  QoS is mandatory with
802.11n so there's not much point into making it an option.
fix parsing of the "powersave" command too.

discussed with deraadt@
man page hints from jmc@
display hints from sobrado@
"i like it" cnst@, grange@




Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Mark Kettenis
> Date: Fri, 27 Oct 2017 12:33:15 +0200
> From: Stefan Sperling 
> 
> On Fri, Oct 27, 2017 at 09:08:07PM +1100, Jonathan Gray wrote:
> > use in ifconfig was removed in 2009
> 
> Yes, please remove this. Thanks.

How would one go about setting QoS mode without this ioctl?

> > Index: ieee80211_ioctl.c
> > ===
> > RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.c,v
> > retrieving revision 1.54
> > diff -u -p -r1.54 ieee80211_ioctl.c
> > --- ieee80211_ioctl.c   26 Oct 2017 15:00:28 -  1.54
> > +++ ieee80211_ioctl.c   27 Oct 2017 10:03:44 -
> > @@ -407,7 +407,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
> > int i, error = 0;
> > struct ieee80211_nwid nwid;
> > struct ieee80211_wpapsk *psk;
> > -   struct ieee80211_wmmparams *wmm;
> > struct ieee80211_keyavail *ka;
> > struct ieee80211_keyrun *kr;
> > struct ieee80211_power *power;
> > @@ -464,24 +463,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
> > break;
> > case SIOCG80211NWKEY:
> > error = ieee80211_ioctl_getnwkeys(ic, (void *)data);
> > -   break;
> > -   case SIOCS80211WMMPARMS:
> > -   if ((error = suser(curproc, 0)) != 0)
> > -   break;
> > -   if (!(ic->ic_flags & IEEE80211_C_QOS)) {
> > -   error = ENODEV;
> > -   break;
> > -   }
> > -   wmm = (struct ieee80211_wmmparams *)data;
> > -   if (wmm->i_enabled)
> > -   ic->ic_flags |= IEEE80211_F_QOS;
> > -   else
> > -   ic->ic_flags &= ~IEEE80211_F_QOS;
> > -   error = ENETRESET;
> > -   break;
> > -   case SIOCG80211WMMPARMS:
> > -   wmm = (struct ieee80211_wmmparams *)data;
> > -   wmm->i_enabled = (ic->ic_flags & IEEE80211_F_QOS) ? 1 : 0;
> > break;
> > case SIOCS80211WPAPARMS:
> > if ((error = suser(curproc, 0)) != 0)
> > Index: ieee80211_ioctl.h
> > ===
> > RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.h,v
> > retrieving revision 1.30
> > diff -u -p -r1.30 ieee80211_ioctl.h
> > --- ieee80211_ioctl.h   24 Oct 2017 09:36:13 -  1.30
> > +++ ieee80211_ioctl.h   27 Oct 2017 10:03:44 -
> > @@ -255,15 +255,6 @@ struct ieee80211_wpaparams {
> >  #define SIOCS80211WPAPARMS  _IOW('i', 247, struct ieee80211_wpaparams)
> >  #define SIOCG80211WPAPARMS _IOWR('i', 248, struct ieee80211_wpaparams)
> >  
> > -struct ieee80211_wmmparams {
> > -   chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
> > -   int i_enabled;
> > -   /* XXX more */
> > -};
> > -
> > -#define SIOCS80211WMMPARMS  _IOW('i', 249, struct ieee80211_wmmparams)
> > -#define SIOCG80211WMMPARMS _IOWR('i', 250, struct ieee80211_wmmparams)
> > -
> >  struct ieee80211_keyavail {
> > chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
> > u_int8_ti_macaddr[IEEE80211_ADDR_LEN];
> > 
> 
> 



Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Kevin Lo
On Fri, Oct 27, 2017 at 09:08:07PM +1100, Jonathan Gray wrote:
> 
> use in ifconfig was removed in 2009

sure, ok kevlo@

> Index: ieee80211_ioctl.c
> ===
> RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.c,v
> retrieving revision 1.54
> diff -u -p -r1.54 ieee80211_ioctl.c
> --- ieee80211_ioctl.c 26 Oct 2017 15:00:28 -  1.54
> +++ ieee80211_ioctl.c 27 Oct 2017 10:03:44 -
> @@ -407,7 +407,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
>   int i, error = 0;
>   struct ieee80211_nwid nwid;
>   struct ieee80211_wpapsk *psk;
> - struct ieee80211_wmmparams *wmm;
>   struct ieee80211_keyavail *ka;
>   struct ieee80211_keyrun *kr;
>   struct ieee80211_power *power;
> @@ -464,24 +463,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
>   break;
>   case SIOCG80211NWKEY:
>   error = ieee80211_ioctl_getnwkeys(ic, (void *)data);
> - break;
> - case SIOCS80211WMMPARMS:
> - if ((error = suser(curproc, 0)) != 0)
> - break;
> - if (!(ic->ic_flags & IEEE80211_C_QOS)) {
> - error = ENODEV;
> - break;
> - }
> - wmm = (struct ieee80211_wmmparams *)data;
> - if (wmm->i_enabled)
> - ic->ic_flags |= IEEE80211_F_QOS;
> - else
> - ic->ic_flags &= ~IEEE80211_F_QOS;
> - error = ENETRESET;
> - break;
> - case SIOCG80211WMMPARMS:
> - wmm = (struct ieee80211_wmmparams *)data;
> - wmm->i_enabled = (ic->ic_flags & IEEE80211_F_QOS) ? 1 : 0;
>   break;
>   case SIOCS80211WPAPARMS:
>   if ((error = suser(curproc, 0)) != 0)
> Index: ieee80211_ioctl.h
> ===
> RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.h,v
> retrieving revision 1.30
> diff -u -p -r1.30 ieee80211_ioctl.h
> --- ieee80211_ioctl.h 24 Oct 2017 09:36:13 -  1.30
> +++ ieee80211_ioctl.h 27 Oct 2017 10:03:44 -
> @@ -255,15 +255,6 @@ struct ieee80211_wpaparams {
>  #define SIOCS80211WPAPARMS_IOW('i', 247, struct ieee80211_wpaparams)
>  #define SIOCG80211WPAPARMS   _IOWR('i', 248, struct ieee80211_wpaparams)
>  
> -struct ieee80211_wmmparams {
> - chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
> - int i_enabled;
> - /* XXX more */
> -};
> -
> -#define SIOCS80211WMMPARMS_IOW('i', 249, struct ieee80211_wmmparams)
> -#define SIOCG80211WMMPARMS   _IOWR('i', 250, struct ieee80211_wmmparams)
> -
>  struct ieee80211_keyavail {
>   chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
>   u_int8_ti_macaddr[IEEE80211_ADDR_LEN];
> 
> 



Re: remove 80211WMMPARMS ioctls

2017-10-27 Thread Stefan Sperling
On Fri, Oct 27, 2017 at 09:08:07PM +1100, Jonathan Gray wrote:
> use in ifconfig was removed in 2009

Yes, please remove this. Thanks.

> Index: ieee80211_ioctl.c
> ===
> RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.c,v
> retrieving revision 1.54
> diff -u -p -r1.54 ieee80211_ioctl.c
> --- ieee80211_ioctl.c 26 Oct 2017 15:00:28 -  1.54
> +++ ieee80211_ioctl.c 27 Oct 2017 10:03:44 -
> @@ -407,7 +407,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
>   int i, error = 0;
>   struct ieee80211_nwid nwid;
>   struct ieee80211_wpapsk *psk;
> - struct ieee80211_wmmparams *wmm;
>   struct ieee80211_keyavail *ka;
>   struct ieee80211_keyrun *kr;
>   struct ieee80211_power *power;
> @@ -464,24 +463,6 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
>   break;
>   case SIOCG80211NWKEY:
>   error = ieee80211_ioctl_getnwkeys(ic, (void *)data);
> - break;
> - case SIOCS80211WMMPARMS:
> - if ((error = suser(curproc, 0)) != 0)
> - break;
> - if (!(ic->ic_flags & IEEE80211_C_QOS)) {
> - error = ENODEV;
> - break;
> - }
> - wmm = (struct ieee80211_wmmparams *)data;
> - if (wmm->i_enabled)
> - ic->ic_flags |= IEEE80211_F_QOS;
> - else
> - ic->ic_flags &= ~IEEE80211_F_QOS;
> - error = ENETRESET;
> - break;
> - case SIOCG80211WMMPARMS:
> - wmm = (struct ieee80211_wmmparams *)data;
> - wmm->i_enabled = (ic->ic_flags & IEEE80211_F_QOS) ? 1 : 0;
>   break;
>   case SIOCS80211WPAPARMS:
>   if ((error = suser(curproc, 0)) != 0)
> Index: ieee80211_ioctl.h
> ===
> RCS file: /cvs/src/sys/net80211/ieee80211_ioctl.h,v
> retrieving revision 1.30
> diff -u -p -r1.30 ieee80211_ioctl.h
> --- ieee80211_ioctl.h 24 Oct 2017 09:36:13 -  1.30
> +++ ieee80211_ioctl.h 27 Oct 2017 10:03:44 -
> @@ -255,15 +255,6 @@ struct ieee80211_wpaparams {
>  #define SIOCS80211WPAPARMS_IOW('i', 247, struct ieee80211_wpaparams)
>  #define SIOCG80211WPAPARMS   _IOWR('i', 248, struct ieee80211_wpaparams)
>  
> -struct ieee80211_wmmparams {
> - chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
> - int i_enabled;
> - /* XXX more */
> -};
> -
> -#define SIOCS80211WMMPARMS_IOW('i', 249, struct ieee80211_wmmparams)
> -#define SIOCG80211WMMPARMS   _IOWR('i', 250, struct ieee80211_wmmparams)
> -
>  struct ieee80211_keyavail {
>   chari_name[IFNAMSIZ];   /* if_name, e.g. "wi0" */
>   u_int8_ti_macaddr[IEEE80211_ADDR_LEN];
>