2015-05-09 20:32:20

by Daniel Drake

[permalink] [raw]
Subject: Realtek USB bluetooth: no scan results when wifi is connected

Hi Champion,

I have a card here which has RTL8723BE wifi and bluetooth combined. 2 antennas.

In linux-next (Linux 4.2) the bluetooth and wifi work fine separately,
but when using them together, I can sometimes see a problem. This is
using the btusb driver based on your code (now included in Linux 4.2),
and the RTL8723B rtlwifi driver, all using the latest firmware in the
linux-firmware git repo.

To reproduce:
- Boot with no wifi connection active
- "hcitool scan" and verify that my laptop and phone can be seen
- Connect to wifi
- Run "hcitool scan" again a few times a minute, within 2-5 minutes
normally my phone and laptop can no longer be seen
- Disconnect from wifi and immediately run "hcitool scan" again, my
phone and laptop can be seen

3 interesting observations when the scan results are coming back empty:
1. I can still get the names of the remote devices by running
"hcitool name <addr>"
2. I can still query the remote devices by running "hcitool info
<addr>". After this, the scan suddenly starts working again!
3. Even though both of my local bluetooth devices no longer appear in
scan results, I can sometimes see my neighbour's phone coming up as a
scan result at this time.

Anyway, disabling btcoexist avoids the issue, so I dug through that
code, and found the exact line of code that seems to (sometimes) make
us enter this strange mode.

Call chain inside drivers/net/wireless/rtlwifi/btcoexist/halbtc8723b2ant.c:
ex_btc8723b2ant_bt_info_notify (called when starting and finishing a BT scan)
btc8723b2ant_run_coexist_mechanism
btc8723b2ant_action_bt_inquiry

As wifi is connected, we now call:
btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 3);

This is the function call that sometimes puts us into the mode where
there are no scan results. Inside this function, if I comment out
these lines in the turn_on section, the bug is avoided:

case 3:
//btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
// 0x3, 0xf1, 0x90);
break;

Any idea what is happening here? Can you help me find a better fix?

Thanks
Daniel


2015-05-29 08:17:44

by Shaofu

[permalink] [raw]
Subject: RE: Realtek USB bluetooth: no scan results when wifi is connected

RGVhciBhbGwsCgpBcyBNYXJjZWwgc2FpZCwgc29tZSBSZWFsdGVrIFdpRmkgKyBCVCBzb2x1dGlv
biBh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GxlYXNlIGNvbnNpZGVyIHRoZSBlbnZpcm9ubWVudCBiZWZvcmUg
cHJpbnRpbmcgdGhpcyBlLW1haWwuCg==

2015-05-28 15:58:29

by Larry Finger

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

On 05/28/2015 10:13 AM, Marcel Holtmann wrote:
> Hi Daniel,
>
>>>> We want to share some information between wifi driver and bt driver, what rules do you recommend for the following situation ?
>>>> 1. at system startup, bluetooth driver want to read some information (eg antenna settings) that generated by wifi , shall we use files or /proc/ information?
>>>> 2. when user is using Bluetooth, bt driver may notify wifi driver to perform better, shall we use socket to communication?
>>>
>>> this is the Bluetooth subsystem communicating with the WiFi subsystem (cfg80211) and vice versa, then this is happening inside the kernel. I do not see any need to even try to go via userspace at all. So neither /proc and no sockets for this.
>>
>> I agree. But can we give more specific advice on how to do this inside
>> the kernel?
>> i.e. should they create a new driver under drivers/misc which exposes
>> a shared API via EXPORT_SYMBOL?
>
> I was actually thinking about creating a rfres subsystem where each radio subsystem can register their antenna and channel information. That why WiFi does not depend on Bluetooth or that Bluetooth depend on WiFi. This cross dependency is something I like to avoid.
>
> And with rfres subsystem in place, each subsystem could also register for notification and adapt its radio usage if possible. Keep in mind that we support multiple Bluetooth and WiFi cards in the system. So this all needs to be fully generic.
>
>> The other option for Realtek to consider is to do this in
>> hardware/firmware. I already saw that the btcoexist driver knows
>> exactly when the wifi and BT start and finish scanning, so there is
>> clearly already an information-passing mechanism between the two
>> interfaces. I wonder if an updated firmware could extend that to
>> include the new information that you wish to additionally transfer.
>
> That is another option and a lot of companies have chosen to do this. If this is a card that has WiFi and Bluetooth on the same hardware, then normally an internal bus exists for communicating coexistence information out-of-band. That is what we are expecting in a lot of cases to happen when looking at platforms.
>
> Of course rfres will be hardly do a better job then the internal communication between the WiFi and Bluetooth parts on the same chip. It can only help when the two pieces are independent or when you have more than one of each installed.

I do not know much about the internal structure of the Realtek devices, and I
have no idea if the two parts can communicate over an internal bus. For that
reason, I have added Shaofu, the lead engineer on the PCIe wifi driver.

Is there a time frame for rfres? Although it might not do a better job in all
cases, its generality will be useful.

Larry

2015-05-28 15:13:27

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

Hi Daniel,

>>> We want to share some information between wifi driver and bt driver, what rules do you recommend for the following situation ?
>>> 1. at system startup, bluetooth driver want to read some information (eg antenna settings) that generated by wifi , shall we use files or /proc/ information?
>>> 2. when user is using Bluetooth, bt driver may notify wifi driver to perform better, shall we use socket to communication?
>>
>> this is the Bluetooth subsystem communicating with the WiFi subsystem (cfg80211) and vice versa, then this is happening inside the kernel. I do not see any need to even try to go via userspace at all. So neither /proc and no sockets for this.
>
> I agree. But can we give more specific advice on how to do this inside
> the kernel?
> i.e. should they create a new driver under drivers/misc which exposes
> a shared API via EXPORT_SYMBOL?

I was actually thinking about creating a rfres subsystem where each radio subsystem can register their antenna and channel information. That why WiFi does not depend on Bluetooth or that Bluetooth depend on WiFi. This cross dependency is something I like to avoid.

And with rfres subsystem in place, each subsystem could also register for notification and adapt its radio usage if possible. Keep in mind that we support multiple Bluetooth and WiFi cards in the system. So this all needs to be fully generic.

> The other option for Realtek to consider is to do this in
> hardware/firmware. I already saw that the btcoexist driver knows
> exactly when the wifi and BT start and finish scanning, so there is
> clearly already an information-passing mechanism between the two
> interfaces. I wonder if an updated firmware could extend that to
> include the new information that you wish to additionally transfer.

That is another option and a lot of companies have chosen to do this. If this is a card that has WiFi and Bluetooth on the same hardware, then normally an internal bus exists for communicating coexistence information out-of-band. That is what we are expecting in a lot of cases to happen when looking at platforms.

Of course rfres will be hardly do a better job then the internal communication between the WiFi and Bluetooth parts on the same chip. It can only help when the two pieces are independent or when you have more than one of each installed.

Regards

Marcel


2015-05-28 14:48:32

by Daniel Drake

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

On Thu, May 28, 2015 at 8:23 AM, Marcel Holtmann <[email protected]> wrote:
> Hi Champion,
>
>> We want to share some information between wifi driver and bt driver, what rules do you recommend for the following situation ?
>> 1. at system startup, bluetooth driver want to read some information (eg antenna settings) that generated by wifi , shall we use files or /proc/ information?
>> 2. when user is using Bluetooth, bt driver may notify wifi driver to perform better, shall we use socket to communication?
>
> this is the Bluetooth subsystem communicating with the WiFi subsystem (cfg80211) and vice versa, then this is happening inside the kernel. I do not see any need to even try to go via userspace at all. So neither /proc and no sockets for this.

I agree. But can we give more specific advice on how to do this inside
the kernel?
i.e. should they create a new driver under drivers/misc which exposes
a shared API via EXPORT_SYMBOL?

The other option for Realtek to consider is to do this in
hardware/firmware. I already saw that the btcoexist driver knows
exactly when the wifi and BT start and finish scanning, so there is
clearly already an information-passing mechanism between the two
interfaces. I wonder if an updated firmware could extend that to
include the new information that you wish to additionally transfer.

Daniel

2015-05-28 14:23:17

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

Hi Champion,

> We want to share some information between wifi driver and bt driver, what rules do you recommend for the following situation ?
> 1. at system startup, bluetooth driver want to read some information (eg antenna settings) that generated by wifi , shall we use files or /proc/ information?
> 2. when user is using Bluetooth, bt driver may notify wifi driver to perform better, shall we use socket to communication?

this is the Bluetooth subsystem communicating with the WiFi subsystem (cfg80211) and vice versa, then this is happening inside the kernel. I do not see any need to even try to go via userspace at all. So neither /proc and no sockets for this.

Regards

Marcel


2015-05-28 10:02:57

by 陈艳萍

[permalink] [raw]
Subject: 答复: 答复: 答复: Realtek USB bluetooth : no scan results when wifi is connected

RGVhciBEYW5pZWwsDQoJV2Ugd2FudCB0byBzaGFyZSBzb21lIGluZm9ybWF0aW9uIGJldHdlZW4g
d2lmaSBkcml2ZXIgYW5kIGJ0IGRyaXZlciwgd2hhdCBydWxlcyBkbyB5b3UgcmVjb21tZW5kIGZv
ciB0aGUgZm9sbG93aW5nIHNpdHVhdGlvbiA/DQoxLiBhdCBzeXN0ZW0gc3RhcnR1cCwgYmx1ZXRv
b3RoIGRyaXZlciB3YW50IHRvIH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 答复: 答复: Realtek USB bluetooth: no scan r esults when wifi is connected

Hi,

On Tue, May 12, 2015 at 8:36 PM, 陈艳萍 <[email protected]> wrote:
> Dear Daniel,
> For 8723BU, always use CONFIG_S0_ANTTENA;
> For 8723BE , 1 antenna CONFIG_S1_ANTTENA; 2 antennas CONFIG_S0_ANTTENA


I tested with CONFIG_S0_ANTENNA as I am using a 8723BE with 2 antennas.

I believe this configuration is having no effect. I tested as follows:

Built kernel without rtlwifi support.
Booted.
Disconnected both antennas.
Moved remote bluetooth device 2 metres away.
Ran "hcitool scan" --> no results. Good.
Connected antenna 1. Scan --> remote device can be seen
Disconnected antenna 1, connected antenna 2. Scan --> remote device can be seen

I then tried with CONFIG_S1_ANTENNA and then again without doing the
S0/S1 antenna config at all. The results are always the same. It seems
like the bluetooth interface is always using both antennas (hence it
can work even if one of them is disconnected).

Also, even with this antenna config in place, there is no affect on
the original issue: connecting to wifi still breaks the bluetooth scan
after a short while.

On Wed, May 13, 2015 at 1:51 AM, 陈艳萍 <[email protected]> wrote:
> Dear Daniel,
> Please try to comment the following code in wifi driver halbtc8723b2ant_action_bt_inquiry()
> /*
> coex_dm->need_recover0x948 = true;
> coex_dm->backup0x948 = btcoexist->btc_read_4byte(btcoexist, 0x948);
>
> halbtc8723b2ant_set_ant_path(btcoexist, BTC_ANT_WIFI_AT_AUX, false, false);
> */

This also makes no difference, the issue is still there.

Thanks
Daniel

2015-05-13 02:36:56

by 陈艳萍

[permalink] [raw]
Subject: 答复: 答复: Realtek USB bluetooth: no sca n results when wifi is connected

RGVhciBEYW5pZWwsDQoJRm9yICA4NzIzQlUsCSAgIGFsd2F5cyB1c2UgQ09ORklHX1MwX0FOVFRF
TkHvvJsNCglGb3IgIDg3MjNCRSDvvIwgMSBhbnRlbm5hIENPTkZJR19TMV9BTlRURU5BOyAyIGFu
dGVubmFzIENPTkZJR19TMF9BTlRURU5BDQoNCkRlYXIgIHNoYW9mdSwNCglXb3VsZCB5b3UgcGxl
YXNlIGhlbH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
IHRob3VnaCwgd2hpY2ggY29uZmlndXJhdGlvbiBzaG91bGQgSSB1c2UsIENPTkZJR19TMF9BTlRU
RU5BIG9yIENPTkZJR19TMV9BTlRURU5BPw0KDQpCeSBvbmx5IGNvbm5lY3Rpbmcgb25lIGFudGVu
bmEgYXQgYSB0aW1lLCBJIHdhcyBhYmxlIHRvIHNlZSB0aGF0IGJsdWV0b290aCBoYXBwaWx5IHVz
ZXMgZWl0aGVyIG9uZS4gSSBoYXZlIGEgZmVlbGluZyB0aGF0IHRoZSBwcmVmZXJlbmNlIHlvdSB3
cml0ZSBhYm92ZSBpcyBvdmVycmlkZGVuIGJ5IGNvZGUgaW4gdGhlIGhhbGJ0Yzg3MjNiMmFudC5j
IGJ0Y29leGlzdCBkcml2ZXIuDQoNCkRhbmllbA0K

2015-05-12 12:53:29

by Daniel Drake

[permalink] [raw]
Subject: Re: 答复: Realtek USB bluetooth: no scan results w hen wifi is connected

Hi Champion,

Thanks for the suggestion.

On Mon, May 11, 2015 at 8:54 PM, 陈艳萍 <[email protected]> wrote:
> Dear Daniel,
> For some reason, 8723B chip with single antenna and 2 antennas have different settings and this can only be modified manually.
> BT driver will set controller to use S0 when use 2 antennas.
> In my submitted driver , there are following codes to add the config settings at the end of firmware to be downloaded.
> Would you please try to add these codes and test again?
>
> /*for 8723B,use S0 Anttena for bluetooth*/
> if(lmp_version==ROM_LMP_8723B)
> {
> memcpy(*buf+patch_entry->patch_length,RTK_CONFIG_SIGNATURE,6);
> if (USE_S0_ANTTENA)
> memcpy(*buf+patch_entry->patch_length+6,CONFIG_S0_ANTTENA,4);
> else
> memcpy(*buf+patch_entry->patch_length+6,CONFIG_S1_ANTTENA,4);
> *buf_len += 10;
> BT_DBG("USE_S0_ANTTENA");
> }

Yes, I saw this code already and experimented with it. It didn't seem
to make any difference. I'll try again though, which configuration
should I use, CONFIG_S0_ANTTENA or CONFIG_S1_ANTTENA?

By only connecting one antenna at a time, I was able to see that
bluetooth happily uses either one. I have a feeling that the
preference you write above is overridden by code in the
halbtc8723b2ant.c btcoexist driver.

Daniel

2015-05-12 02:54:04

by 陈艳萍

[permalink] [raw]
Subject: 答复: Realtek USB bluetooth: no scan result s when wifi is connected

Dear Daniel,
For some reason, 8723B chip with single antenna and 2 antennas have different settings and this can only be modified manually.
BT driver will set controller to use S0 when use 2 antennas.
In my submitted driver , there are following codes to add the config settings at the end of firmware to be downloaded.
Would you please try to add these codes and test again?

/*for 8723B,use S0 Anttena for bluetooth*/
if(lmp_version==ROM_LMP_8723B)
{
memcpy(*buf+patch_entry->patch_length,RTK_CONFIG_SIGNATURE,6);
if (USE_S0_ANTTENA)
memcpy(*buf+patch_entry->patch_length+6,CONFIG_S0_ANTTENA,4);
else
memcpy(*buf+patch_entry->patch_length+6,CONFIG_S1_ANTTENA,4);
*buf_len += 10;
BT_DBG("USE_S0_ANTTENA");
}

-----邮件原件-----
发件人: Larry Finger [mailto:[email protected]] 代表 Larry Finger
发送时间: 2015年5月10日 5:47
收件人: Daniel Drake; 陈艳萍
抄送: Carlo Caione; Linux Bluetooth mailing list; [email protected] > shaofu
主题: Re: Realtek USB bluetooth: no scan results when wifi is connected

On 05/09/2015 03:32 PM, Daniel Drake wrote:
> Hi Champion,
>
> I have a card here which has RTL8723BE wifi and bluetooth combined. 2 antennas.
>
> In linux-next (Linux 4.2) the bluetooth and wifi work fine separately,
> but when using them together, I can sometimes see a problem. This is
> using the btusb driver based on your code (now included in Linux 4.2),
> and the RTL8723B rtlwifi driver, all using the latest firmware in the
> linux-firmware git repo.
>
> To reproduce:
> - Boot with no wifi connection active
> - "hcitool scan" and verify that my laptop and phone can be seen
> - Connect to wifi
> - Run "hcitool scan" again a few times a minute, within 2-5 minutes
> normally my phone and laptop can no longer be seen
> - Disconnect from wifi and immediately run "hcitool scan" again, my
> phone and laptop can be seen
>
> 3 interesting observations when the scan results are coming back empty:
> 1. I can still get the names of the remote devices by running
> "hcitool name <addr>"
> 2. I can still query the remote devices by running "hcitool info
> <addr>". After this, the scan suddenly starts working again!
> 3. Even though both of my local bluetooth devices no longer appear
> in scan results, I can sometimes see my neighbour's phone coming up as
> a scan result at this time.
>
> Anyway, disabling btcoexist avoids the issue, so I dug through that
> code, and found the exact line of code that seems to (sometimes) make
> us enter this strange mode.
>
> Call chain inside drivers/net/wireless/rtlwifi/btcoexist/halbtc8723b2ant.c:
> ex_btc8723b2ant_bt_info_notify (called when starting and finishing a
> BT scan) btc8723b2ant_run_coexist_mechanism
> btc8723b2ant_action_bt_inquiry
>
> As wifi is connected, we now call:
> btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 3);
>
> This is the function call that sometimes puts us into the mode where
> there are no scan results. Inside this function, if I comment out
> these lines in the turn_on section, the bug is avoided:
>
> case 3:
> //btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
> // 0x3, 0xf1, 0x90);
> break;
>
> Any idea what is happening here? Can you help me find a better fix?

Daniel,

Do you see any adverse side effects when you comment out the "case 3" code?

As there has not been a lot of testing of wifi and BT with Realtek devices in the field, I expect to see a number of bugs like this.

I added Shao Fu (aka Rock) to the Cc list. He is the Realtek engineer responsible for the wifi driver.

Larry


Attachments:
btusb.c (57.16 kB)
btusb.c

2015-05-11 15:38:47

by Larry Finger

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

On 05/11/2015 08:36 AM, Daniel Drake wrote:
> Hi Larry,
>
> On Sat, May 9, 2015 at 3:46 PM, Larry Finger <[email protected]> wrote:
>> Do you see any adverse side effects when you comment out the "case 3" code?
>
> No, it fixes the scan results issue and I also tested a simultaneous
> download over wifi while sending a file over bluetooth. Seems to be
> working fine.

OK. As I know you are busy, I will submit the patch to
[email protected] for you.

Larry


2015-05-11 13:36:43

by Daniel Drake

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

Hi Larry,

On Sat, May 9, 2015 at 3:46 PM, Larry Finger <[email protected]> wrote:
> Do you see any adverse side effects when you comment out the "case 3" code?

No, it fixes the scan results issue and I also tested a simultaneous
download over wifi while sending a file over bluetooth. Seems to be
working fine.

Daniel

2015-05-09 21:46:55

by Larry Finger

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

On 05/09/2015 03:32 PM, Daniel Drake wrote:
> Hi Champion,
>
> I have a card here which has RTL8723BE wifi and bluetooth combined. 2 antennas.
>
> In linux-next (Linux 4.2) the bluetooth and wifi work fine separately,
> but when using them together, I can sometimes see a problem. This is
> using the btusb driver based on your code (now included in Linux 4.2),
> and the RTL8723B rtlwifi driver, all using the latest firmware in the
> linux-firmware git repo.
>
> To reproduce:
> - Boot with no wifi connection active
> - "hcitool scan" and verify that my laptop and phone can be seen
> - Connect to wifi
> - Run "hcitool scan" again a few times a minute, within 2-5 minutes
> normally my phone and laptop can no longer be seen
> - Disconnect from wifi and immediately run "hcitool scan" again, my
> phone and laptop can be seen
>
> 3 interesting observations when the scan results are coming back empty:
> 1. I can still get the names of the remote devices by running
> "hcitool name <addr>"
> 2. I can still query the remote devices by running "hcitool info
> <addr>". After this, the scan suddenly starts working again!
> 3. Even though both of my local bluetooth devices no longer appear in
> scan results, I can sometimes see my neighbour's phone coming up as a
> scan result at this time.
>
> Anyway, disabling btcoexist avoids the issue, so I dug through that
> code, and found the exact line of code that seems to (sometimes) make
> us enter this strange mode.
>
> Call chain inside drivers/net/wireless/rtlwifi/btcoexist/halbtc8723b2ant.c:
> ex_btc8723b2ant_bt_info_notify (called when starting and finishing a BT scan)
> btc8723b2ant_run_coexist_mechanism
> btc8723b2ant_action_bt_inquiry
>
> As wifi is connected, we now call:
> btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 3);
>
> This is the function call that sometimes puts us into the mode where
> there are no scan results. Inside this function, if I comment out
> these lines in the turn_on section, the bug is avoided:
>
> case 3:
> //btc8723b2ant_set_fw_ps_tdma(btcoexist, 0xe3, 0x1c,
> // 0x3, 0xf1, 0x90);
> break;
>
> Any idea what is happening here? Can you help me find a better fix?

Daniel,

Do you see any adverse side effects when you comment out the "case 3" code?

As there has not been a lot of testing of wifi and BT with Realtek devices in
the field, I expect to see a number of bugs like this.

I added Shao Fu (aka Rock) to the Cc list. He is the Realtek engineer
responsible for the wifi driver.

Larry


2015-06-06 05:08:05

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

Hi Larry,

>>>>> We want to share some information between wifi driver and bt driver, what rules do you recommend for the following situation ?
>>>>> 1. at system startup, bluetooth driver want to read some information (eg antenna settings) that generated by wifi , shall we use files or /proc/ information?
>>>>> 2. when user is using Bluetooth, bt driver may notify wifi driver to perform better, shall we use socket to communication?
>>>>
>>>> this is the Bluetooth subsystem communicating with the WiFi subsystem (cfg80211) and vice versa, then this is happening inside the kernel. I do not see any need to even try to go via userspace at all. So neither /proc and no sockets for this.
>>>
>>> I agree. But can we give more specific advice on how to do this inside
>>> the kernel?
>>> i.e. should they create a new driver under drivers/misc which exposes
>>> a shared API via EXPORT_SYMBOL?
>>
>> I was actually thinking about creating a rfres subsystem where each radio subsystem can register their antenna and channel information. That why WiFi does not depend on Bluetooth or that Bluetooth depend on WiFi. This cross dependency is something I like to avoid.
>>
>> And with rfres subsystem in place, each subsystem could also register for notification and adapt its radio usage if possible. Keep in mind that we support multiple Bluetooth and WiFi cards in the system. So this all needs to be fully generic.
>>
>>> The other option for Realtek to consider is to do this in
>>> hardware/firmware. I already saw that the btcoexist driver knows
>>> exactly when the wifi and BT start and finish scanning, so there is
>>> clearly already an information-passing mechanism between the two
>>> interfaces. I wonder if an updated firmware could extend that to
>>> include the new information that you wish to additionally transfer.
>>
>> That is another option and a lot of companies have chosen to do this. If this is a card that has WiFi and Bluetooth on the same hardware, then normally an internal bus exists for communicating coexistence information out-of-band. That is what we are expecting in a lot of cases to happen when looking at platforms.
>>
>> Of course rfres will be hardly do a better job then the internal communication between the WiFi and Bluetooth parts on the same chip. It can only help when the two pieces are independent or when you have more than one of each installed.
>
> I do not know much about the internal structure of the Realtek devices, and I have no idea if the two parts can communicate over an internal bus. For that reason, I have added Shaofu, the lead engineer on the PCIe wifi driver.
>
> Is there a time frame for rfres? Although it might not do a better job in all cases, its generality will be useful.

there is no timeframe on rfres. It is something we clearly want, but I have not yet started working on it.

Regards

Marcel


2015-06-06 05:07:10

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected

Hi Shaofu,

please do not top-post on this mailing list.

> As Marcel said, some Realtek WiFi + BT solution are two chips solution.
> - 1 chip solution: 8723BE, 8821AE
> - 2 chips solution: 8812AE + 8761AU, 8192EE + 8761AU
>
> Even in 2 chips solution, there are some difference:
> - Hardware connected in module: 8192EE + 8761AU
> - Independent, need SW involved, even in the same module: 8812AE + 8761AU
>
> In 1 chip or hardware connected solution, both driver don't need communicate,
> BTcoex driver knows everything via HW event, and control everything it wants.
>
> In 2 chips and independent solution, yes, its our problem. In this case, we need
> some communication mechanism between drivers. The rfres subsystem seems
> good, but it takes time. If other simple methods can do, please tell us.

there is no simple method. You need to retrieve the current WiFi channels in use from the WiFi subsystem and handle the update of the AFH channel based on that.

Regards

Marcel