Hello Johannes, hello all,
As you may know the wl1271 hardware implements WLAN-Bluetooth
co-existence by toggling a single antenna between WLAN and Bluetooth.
To pull this off, several quirks are required, for instance WLAN must be
forced to full-PSM so that antenna-time for BT can be made available.
This is implemented by the wl1271 driver with the help of the mac80211.
There are lots of timing issues involved, and there is a priority
between WLAN an BT. To ensure BT A2DP and SCO work properly, BT needs to
have enough priority at the expense of WLAN performance. While this
works well enough when connected, during WLAN association and especially
during EAP negotiation the priority needs to be more on the WLAN side to
ensure reliability.
The wl1271 driver starts association with the priority on WLAN, which
means that BT performance is compromised. The wl1271 driver should
change the priority to BT after association and the EAP negotiations are
complete, to make sure BT is performing acceptably.
So, what this all boils down to is that the wl1271 driver needs to know
when the association, including the possible EAP negotations are fully
complete, to be able to adjust the priority.
Currently, there is no such information available to the driver. In fact
this information is not available anywhere in the kernel level either
(as the details of the EAP negotiation, needed keys etc are controlled
in user-space), so the trigger would need to come from user-space.
To enable this, an operand would be needed to nl80211 to indicate
completion of association (including the EAP negotiations.)
Corresponding functions would then be needed on the cfg80211 ops and
mac80211 ops.
User-space would then call the operand when association is complete. For
open/WEP AP's the operand would be called immediately after association,
and for WPA AP's the operand would be called once the EAP negotiations
are complete.
Thoughts? Ideas? Would this be acceptable?
-Juuso
On Mon, 2010-07-26 at 14:06 +0300, Juuso Oikarinen wrote:
> Hello Johannes, hello all,
>
> As you may know the wl1271 hardware implements WLAN-Bluetooth
> co-existence by toggling a single antenna between WLAN and Bluetooth.
>
> To pull this off, several quirks are required, for instance WLAN must be
> forced to full-PSM so that antenna-time for BT can be made available.
> This is implemented by the wl1271 driver with the help of the mac80211.
>
> There are lots of timing issues involved, and there is a priority
> between WLAN an BT. To ensure BT A2DP and SCO work properly, BT needs to
> have enough priority at the expense of WLAN performance. While this
> works well enough when connected, during WLAN association and especially
> during EAP negotiation the priority needs to be more on the WLAN side to
> ensure reliability.
>
> The wl1271 driver starts association with the priority on WLAN, which
> means that BT performance is compromised. The wl1271 driver should
> change the priority to BT after association and the EAP negotiations are
> complete, to make sure BT is performing acceptably.
>
> So, what this all boils down to is that the wl1271 driver needs to know
> when the association, including the possible EAP negotations are fully
> complete, to be able to adjust the priority.
>
> Currently, there is no such information available to the driver. In fact
> this information is not available anywhere in the kernel level either
> (as the details of the EAP negotiation, needed keys etc are controlled
> in user-space), so the trigger would need to come from user-space.
>
> To enable this, an operand would be needed to nl80211 to indicate
> completion of association (including the EAP negotiations.)
> Corresponding functions would then be needed on the cfg80211 ops and
> mac80211 ops.
>
> User-space would then call the operand when association is complete. For
> open/WEP AP's the operand would be called immediately after association,
> and for WPA AP's the operand would be called once the EAP negotiations
> are complete.
>
>
> Thoughts? Ideas? Would this be acceptable?
I really don't like this. You _can_ figure out if a given frame is EAP
by looking at its ethertype (but don't implement WAPI then!) ... can't
you just give it priority _by frame_?
Also, it doesn't make any sense, since if you really care then you want
rekeying to also have priority...
johannes
On Mon, 2010-07-26 at 13:23 +0200, ext Johannes Berg wrote:
> On Mon, 2010-07-26 at 14:06 +0300, Juuso Oikarinen wrote:
> >
> >
> > Thoughts? Ideas? Would this be acceptable?
>
> I really don't like this. You _can_ figure out if a given frame is EAP
> by looking at its ethertype (but don't implement WAPI then!) ... can't
> you just give it priority _by frame_?
I don't like it either, but my hands are bound. With this chip I cannot
give priority by frame. The way it works on that chip is that after
association you tell the chip to change mode, and that's it - no going
back.
> Also, it doesn't make any sense, since if you really care then you want
> rekeying to also have priority...
Yep, this is a problem I too have been thinking about. However, with
this chip, you cannot change the priority back for re-keying. So
essentially, those negotiations are done with the "lowered" WLAN
priority, and if they happen to fail the connection manager will as
result end up associating again with increased priority.
The fact is we need this to be done this way. I have been thinking about
all possible ways to do this hack inside the driver, triggering on
setting of keys etc, but as far as I can tell it's not doable without
assumptions having unacceptable impact on functionality.
We'll have to consider some driver-specific hack-interface then, along
with a correspondingly hacked user-space connection manager. This will
just cause other users of the wl1271 driver ending up with dysfunctional
BT-WLAN coex.
-Juuso
> johannes
>
On Mon, Jul 26, 2010 at 02:06:40PM +0300, Juuso Oikarinen wrote:
> There are lots of timing issues involved, and there is a priority
> between WLAN an BT. To ensure BT A2DP and SCO work properly, BT needs to
> have enough priority at the expense of WLAN performance. While this
> works well enough when connected, during WLAN association and especially
> during EAP negotiation the priority needs to be more on the WLAN side to
> ensure reliability.
Could you please explain why EAP negotiation is a special case? It is
using data frames just like any other operation after it..
> So, what this all boils down to is that the wl1271 driver needs to know
> when the association, including the possible EAP negotations are fully
> complete, to be able to adjust the priority.
This sounds like a horrible hack and really, the unreliability during
EAP should likely fixed in some other way.
> Currently, there is no such information available to the driver. In fact
> this information is not available anywhere in the kernel level either
> (as the details of the EAP negotiation, needed keys etc are controlled
> in user-space), so the trigger would need to come from user-space.
That's not actually true.. At least when run with wpa_supplicant is
setting operation state to IF_OPER_UP when the full authentication
sequence (i.e., not only EAP, but also the following 4-way handshake
with EAPOL-Key frames) is done (and IF_OPER_DORMANT when not ready).
This is needed for other purposes to indicate when real data traffic can
be sent, e.g., for DHCP clients.
I don't think I would support the idea of using that information to
change the WLAN vs. BT priority without some additional data on what
exactly goes wrong during EAP negotiation, but at least the information
should already be in the kernel, so we do not need to change nl80211 for
this.
--
Jouni Malinen PGP id EFC895FA
On Mon, 2010-07-26 at 16:30 +0200, ext Jouni Malinen wrote:
> On Mon, Jul 26, 2010 at 02:06:40PM +0300, Juuso Oikarinen wrote:
> > There are lots of timing issues involved, and there is a priority
> > between WLAN an BT. To ensure BT A2DP and SCO work properly, BT needs to
> > have enough priority at the expense of WLAN performance. While this
> > works well enough when connected, during WLAN association and especially
> > during EAP negotiation the priority needs to be more on the WLAN side to
> > ensure reliability.
>
> Could you please explain why EAP negotiation is a special case? It is
> using data frames just like any other operation after it..
I'm not aware of all the facts, but I believe it's more about the EAP
negotiation being more sensitive to lost frames for instance.
> > So, what this all boils down to is that the wl1271 driver needs to know
> > when the association, including the possible EAP negotations are fully
> > complete, to be able to adjust the priority.
>
> This sounds like a horrible hack and really, the unreliability during
> EAP should likely fixed in some other way.
To be truthful, I think it's a hack all the way - also on the wl1271.
This way of WLAN-BT coexistence has proven to be a pandora's box of
problems - all these weird issues keep popping up. And this particular
issue is probably one of those, and this way around it, is probably a
last minute hack to solve the issue on the chipset vendor part.
> > Currently, there is no such information available to the driver. In fact
> > this information is not available anywhere in the kernel level either
> > (as the details of the EAP negotiation, needed keys etc are controlled
> > in user-space), so the trigger would need to come from user-space.
>
> That's not actually true.. At least when run with wpa_supplicant is
> setting operation state to IF_OPER_UP when the full authentication
> sequence (i.e., not only EAP, but also the following 4-way handshake
> with EAPOL-Key frames) is done (and IF_OPER_DORMANT when not ready).
> This is needed for other purposes to indicate when real data traffic can
> be sent, e.g., for DHCP clients.
> I don't think I would support the idea of using that information to
> change the WLAN vs. BT priority without some additional data on what
> exactly goes wrong during EAP negotiation, but at least the information
> should already be in the kernel, so we do not need to change nl80211 for
> this.
>
Yeah, this sounds like something that could be used for a trigger. I
will look into it.
I did not really think this proposal would be accepted. I stated out the
problem mainly to get a second opinion, and possibly ideas.
In the meanwhile, we will have to somehow make this work. I thank you
for your thoughts. :)
-Juuso