Return-Path: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Realtek USB bluetooth: no scan results when wifi is connected From: Marcel Holtmann In-Reply-To: Date: Thu, 28 May 2015 17:13:27 +0200 Cc: =?utf-8?B?6ZmI6Imz6JCN?= , Larry Finger , Carlo Caione , Linux Bluetooth mailing list , "shaofu@realtek.com > shaofu" , =?utf-8?B?5byg5b+X56Wl?= , =?utf-8?B?6ZmG5pyx5Lyf?= , Chih-Hsiang Wang , =?utf-8?B?5q+b5Li66ZSL?= , "pkshih@realtek.com" Message-Id: <6156899E-F971-46CC-A3D9-6DDDFA9FDC4B@holtmann.org> References: <554E804F.9090407@lwfinger.net> <54F70642BAB21D4498E1AA3EFE3D519A461012DA@rsex2.realsil.com.cn> <54F70642BAB21D4498E1AA3EFE3D519A46101882@rsex2.realsil.com.cn> <54F70642BAB21D4498E1AA3EFE3D519A4610F810@rsex2.realsil.com.cn> To: Daniel Drake Sender: linux-bluetooth-owner@vger.kernel.org List-ID: 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