All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC] cfg80211: Android P2P-Device workaround
Date: Tue, 23 Apr 2013 18:42:20 +0200	[thread overview]
Message-ID: <1366735340.8385.20.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <EC4E16A7-2F9E-4E59-A561-88C85A459BCA@holtmann.org>

On Tue, 2013-04-23 at 07:50 -0700, Marcel Holtmann wrote:

> > +config CFG80211_ANDROID_P2P_HACK
> > +	bool "Android P2P netdevice hack"
> > +	depends on CFG80211
> > +	depends on !CFG80211_WEXT
> > +	help
> > +	  Enable this option for Android P2P w/ P2P Device.
> > +
> 
> do you really think this is a good idea? Wouldn't it be better if
> Android just gets its userspace fixed. This way, they never will and
> you carry this workaround forever.

Well, I'm about 50/50 on whether to merge this. On the one hand, it's a
very simple patch to carry out of tree, on the other hand more than one
person will need it.

> Has anybody actually looked into what it would take to just fix
> Android userspace to use nl80211 to bring up P2P. I just see tons of
> #ifdef added to the kernel.

Yes, I did :-)

However, for any system running Jelly Bean that's not really an option,
and I have no idea if/how K-whatever is coming, so it might not be
possible there either. Additionally, fairly large changes are needed in
wpa_supplicant to actually support the P2P-Device with only nl82011
APIs.

This gives us a transition path while making changes to the other parts
of the stack.

> > +			if (!dev
> > +#ifdef CONFIG_CFG80211_ANDROID_P2P_HACK
> > +			    || (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE &&
> > +				info->genlhdr->cmd != NL80211_CMD_SET_INTERFACE)
> > +#endif
> > +			) {
> > 				mutex_unlock(&cfg80211_mutex);
> > 				if (rtnl)
> > 					rtnl_unlock();
> 
> And doing an #ifdef in the middle of if-clause doesn't ring any alarm
> bells that this might be a really bad idea ;)

Well, I could put an #ifdef into each and every command instead which I
didn't want to, which incidentally is the reason for not allowing this
with WEXT, WEXT ioctls on the P2P-Device netdev just cause crashes :)

Basically this way also reduces the surface of this patch to make it
easier to use out of tree.

> When I am looking at the USB gadget handling, I see a lot of progress
> in establishing a standard kernel interface and changing Android
> userspace to work with that instead.

"progress" doesn't really help, at least in this case it's pretty much
an either-or situation and changing the userspace will take a long time.

johannes


  reply	other threads:[~2013-04-23 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 12:45 [RFC] cfg80211: Android P2P-Device workaround Johannes Berg
2013-04-23 14:50 ` Marcel Holtmann
2013-04-23 16:42   ` Johannes Berg [this message]
2013-04-24  8:13     ` Arend van Spriel
2013-04-24  8:28       ` Johannes Berg
2013-04-24  8:31       ` Johannes Berg
2013-04-24 14:29       ` Marcel Holtmann
2013-04-25  9:03         ` Arend van Spriel

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=1366735340.8385.20.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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.