All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] cfg80211: add wext-compatible client
Date: Thu, 08 Feb 2007 14:13:06 +0100	[thread overview]
Message-ID: <1170940386.4385.49.camel@johannes.berg> (raw)
In-Reply-To: <20070207075420.GB14703@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 4754 bytes --]

On Wed, 2007-02-07 at 07:54 +0000, Christoph Hellwig wrote:

> Do we really have to add this directly to struct net_device and bloat it
> for all users?  I'd put this behind  ieee80211_ptr instead unless there's
> a good reason against that.

Well, the reason currently is that cfg80211 treats ieee80211_ptr as an
opaque cookie, it doesn't need to know what it points to.

Of course, I intend to change that too...

> > +config CFG80211_WEXTNL_COMPAT
> > +	bool "cfg80211 WE-netlink compatibility"
> > +	depends CFG80211 && CFG80211_WEXT_COMPAT
> > +	---help---
> > +	This option allows using devices whose drivers have been
> > +	converted to use the new cfg80211 with wireless extensions
> > +	over rtnetlink, providing WE-20 compatibility. Note that
> > +	cfg80211's "native" interface is nl80211 using generic netlink.
> > +	The wireless extensions are being deprecated and the netlink
> > +	based API for WE was never configured by default, nor do any
> > +	userspace tools use this feature.
> > +
> > +	This option exists only to make Jean happy. Say N.
> 
> Should we really put this code in?  It seems like unessecary bloat to me.

Yeah. Jean disappeared anyway, I'll kill it.

> > @@ -2798,6 +2799,39 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
> >  					ret = -EFAULT;
> >  				return ret;
> >  			}
> > +#ifdef CONFIG_CFG80211_WEXT_COMPAT
> > +			/* Take care of cfg80211 WE compatibility */
> > +			if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
> > +				/* If command is `set a parameter', or
> > +				 * `get the encoding parameters', check if
> > +				 * the user has the right to do it */
> > +				if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE
> > +				    || cmd == SIOCGIWENCODEEXT) {
> > +					if (!capable(CAP_NET_ADMIN))
> > +						return -EPERM;
> > +				}
> > +				dev_load(ifr.ifr_name);
> > +				rtnl_lock();
> > +				/* Follow me in net/wireless/wext-compat.c */
> > +				ret = cfg80211_wext_ioctl(&ifr, cmd);
> > +				rtnl_unlock();
> > +				if (ret == 0 && IW_IS_GET(cmd) &&
> > +				    copy_to_user(arg, &ifr,
> > +						 sizeof(struct ifreq)))
> > +					ret = -EFAULT;
> > +				/* haha, I cheat here by allowing a driver or
> > +				 * stack to have both WE or CFG80211-WE for
> > +				 * a little while during conversion... hope that
> > +				 * ENOSYS is only used to indicate not implemented
> > +				 *
> > +				 * if wireless extensions are not configured
> > +				 * then this is the last thing here so that
> > +				 * if we fall through we return -EINVAL
> > +				 */
> > +				if (ret != -ENOSYS)
> > +					return ret;
> > +			}
> 
> Can we split this into a nice little helper function in wext-compat.c
> or a dummy macro if it's not configured?

I guess I can do that. Maybe I'll do the same with wext too.

> > --- a/net/core/rtnetlink.c
> > +++ b/net/core/rtnetlink.c
> > @@ -56,6 +56,9 @@
> >  #include <linux/wireless.h>
> >  #include <net/iw_handler.h>
> >  #endif	/* CONFIG_NET_WIRELESS_RTNETLINK */
> > +#ifdef CONFIG_CFG80211_WEXTNL_COMPAT
> > +#include <net/cfg80211.h>
> > +#endif
> 
> There's not point in including headers conditionally.

It helps ccache when you change that header, but yeah, let's just
include it.

> This looks odd. Kbuild filters out duplicate objects, so something like
> the snipplet below should work aswell:
> 
> obj-$(CONFIG_WIRELESS_EXT)		+= wext-common.o wext-old.o
> obj-$(CONFIG_CFG80211_WEXT_COMPAT)	+= wext-common.o wext-compat.o	

Hah, good point, I never even thought of something that would just
duplicate it.

> > +#ifdef CONFIG_CFG80211_WEXT_COMPAT
> > +/* wext compatibility must be compiled in...
> > + * this extern is in wext-compat.c */
> 
> Is there really a point in making cfg80211 a loadable module?
> This whle operation vector stuff looks like a lot of unnessecary
> complexity to me.

I think there is point in doing it as it allows us to replace it with an
out-of-tree newer version for getting it into the hands of users who
might not want to replace their whole kernel.

> > new file mode 100644
> > index 0000000..c1de1d7
> > --- /dev/null
> > +++ b/net/wireless/wext-common.c
> > @@ -0,0 +1,610 @@
> > +/* common wext support routines, proc interface and events */
> 
> This is mostly Jean's old code, right?  Probably wants at least some
> attribution.

Yeah, good point, it's mostly code that moved from that file to here.

> Btw, if we submit cfg80211 for inclusion there should be at least one patch
> in the series actually converts a driver to use it.  Both to make this
> code not dead and give people and example on how to use the cfg80211
> infrastructure.

I guess I could make softmac use it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2007-02-08 13:16 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31  1:37 [RFC] cfg80211 merge John W. Linville
2007-01-31  1:38 ` [RFC PATCH 1/3] cfg80211 and nl80211 John W. Linville
2007-01-31  1:39   ` [RFC PATCH 2/3] wireless: move wext to net/wireless/ John W. Linville
2007-01-31  1:41     ` [RFC PATCH 3/3] cfg80211: add wext-compatible client John W. Linville
2007-01-31 14:40     ` [RFC PATCH 2/3] wireless: move wext to net/wireless/ Christoph Hellwig
2007-01-31 19:00       ` Johannes Berg
2007-01-31  2:46   ` [RFC PATCH 1/3] cfg80211 and nl80211 Michael Wu
2007-01-31 17:37     ` Jiri Benc
2007-01-31 20:24       ` Michael Buesch
2007-02-01 10:18     ` Johannes Berg
2007-02-05 17:45       ` Michael Wu
2007-02-05 17:49         ` Johannes Berg
2007-02-05 18:14           ` Michael Wu
2007-02-05 18:14             ` Johannes Berg
2007-02-05 18:29               ` Jiri Benc
2007-02-05 18:29                 ` Johannes Berg
2007-02-05 19:13                 ` Jouni Malinen
2007-02-05 19:23               ` Michael Wu
2007-02-05 19:24                 ` Johannes Berg
2007-02-05 19:55                   ` Michael Wu
2007-02-09 16:14                     ` Johannes Berg
2007-02-05 18:16           ` Jiri Benc
2007-01-31  2:48 ` [RFC] cfg80211 merge Jouni Malinen
2007-01-31 17:29   ` Jiri Benc
2007-01-31 18:32     ` John W. Linville
2007-01-31 19:25       ` Jiri Benc
2007-01-31 20:07         ` Christoph Hellwig
2007-01-31 20:44           ` John W. Linville
2007-01-31 21:06             ` Johannes Berg
2007-01-31 23:54               ` Tomas Winkler
2007-02-01 13:07                 ` Johannes Berg
2007-02-01 14:04                   ` Tomas Winkler
2007-02-01 14:11                     ` Johannes Berg
2007-02-02 18:18                       ` Tomas Winkler
2007-02-03 17:37                         ` Johannes Berg
2007-02-01 14:12                     ` Jiri Benc
2007-02-07  0:46 ` [RFC v2] " John W. Linville
2007-02-07  0:47   ` [RFC PATCH 1/3] wireless: add cfg80211 John W. Linville
     [not found]     ` <20070207004832.GC23096@tuxdriver.com>
2007-02-07  0:49       ` [RFC PATCH 3/3] cfg80211: add wext-compatible client John W. Linville
2007-02-07  7:54         ` Christoph Hellwig
2007-02-08 13:13           ` Johannes Berg [this message]
2007-02-08 18:38             ` Luis R. Rodriguez
2007-02-08 18:50               ` John W. Linville
2007-02-08 19:41                 ` Luis R. Rodriguez
2007-02-09 15:43                   ` Johannes Berg
2007-02-08 19:55               ` Christoph Hellwig
2007-02-08 21:56                 ` Luis R. Rodriguez
2007-02-09  2:09                 ` Dan Williams
2007-02-07  7:35     ` [RFC PATCH 1/3] wireless: add cfg80211 Christoph Hellwig
2007-02-08 13:12       ` Johannes Berg
2007-02-08 19:17         ` Christoph Hellwig
2007-02-07 14:39   ` [RFC v2] cfg80211 merge John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170940386.4385.49.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=hch@infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.