From: Kalle Valo <kvalo@codeaurora.org>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
linux-wireless@vger.kernel.org, Ping-Ke Shih <pkshih@realtek.com>,
Yan-Hsuan Chuang <yhchuang@realtek.com>,
Birming Chiu <birming@realtek.com>, Shaofu <shaofu@realtek.com>,
Steven Ting <steventing@realtek.com>
Subject: Re: [PATCH v4 02/10] rtlwifi: Add BT_MP_INFO to c2h handler.
Date: Tue, 25 Jul 2017 15:18:54 +0300 [thread overview]
Message-ID: <87fudkk8up.fsf@codeaurora.org> (raw)
In-Reply-To: <02d73d82-b609-036f-6560-ca7a657d7bf2@broadcom.com> (Arend Van Spriel's message of "Mon, 3 Jul 2017 23:08:43 +0200")
Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
> On 2-7-2017 20:12, Larry Finger wrote:
>> From: Ping-Ke Shih <pkshih@realtek.com>
>>
>> We use H2C to ask BT's status, and C2H will return the status.
>>
>> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
>> Cc: Birming Chiu <birming@realtek.com>
>> Cc: Shaofu <shaofu@realtek.com>
>> Cc: Steven Ting <steventing@realtek.com>
>> ---
>> v2 - no changes
>> v3 - no changes
>> v4 - no changes
>> ---
>> .../realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 17 ++++++++++++-
>> .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 28 ++++++++++++++++++++++
>> .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.h | 1 +
>> .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 9 +++++--
>> .../net/wireless/realtek/rtlwifi/rtl8723be/fw.c | 9 +++++--
>> .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 13 +++++++---
>> drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 ++
>> 7 files changed, 71 insertions(+), 8 deletions(-)
>>
>
> [...]
>
>>
>> +void rtl_btc_btmpinfo_notify(struct rtl_priv *rtlpriv, u8 *tmp_buf, u8 length)
>> +{
>> + u8 extid, seq, len;
>> + u16 bt_real_fw_ver;
>> + u8 bt_fw_ver;
>> +
>> + if ((length < 4) || (!tmp_buf))
>> + return;
>> +
>> + extid = tmp_buf[0];
>> + /* not response from BT FW then exit*/
>> + if (extid != 1) /* C2H_TRIG_BY_BT_FW = 1 */
>> + return;
>> +
>> + len = tmp_buf[1] >> 4;
>> + seq = tmp_buf[2] >> 4;
>> +
>> + /* BT Firmware version response */
>> + if (seq == 0x0E) {
>> + bt_real_fw_ver = tmp_buf[3] | (tmp_buf[4] << 8);
>> + bt_fw_ver = tmp_buf[5];
>> +
>> + gl_bt_coexist.bt_info.bt_real_fw_ver = bt_real_fw_ver;
>> + gl_bt_coexist.bt_info.bt_fw_ver = bt_fw_ver;
>> + }
>> +}
>
> Just stumbled upon this and curious. I assume gl_bt_coexist is a global
> variable so I guess this code will not work when running multiple
> realtek device with btcoexist on your system.
Good catch, rtlwifi/btcoexist/halbtcoutsrc.c contains two global
variables even with a big fat comment stating that:
----------------------------------------------------------------------
/***********************************************
* Global variables
***********************************************/
struct btc_coexist gl_bt_coexist;
u32 btc_dbg_type[BTC_MSG_MAX];
----------------------------------------------------------------------
Global variables do not belong to upstream drivers, instead they should
be in per device structures so that multiple devices can be used at the
same time. Now that seems to be horribly broken.
These variables were added back in 2014:
aa45a673b291 rtlwifi: btcoexist: Add new mini driver
--
Kalle Valo
next prev parent reply other threads:[~2017-07-25 12:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-02 18:12 [PATCH v3 00/10] Set 3 of changes related to updates of btcoexist Larry Finger
2017-07-02 18:12 ` [PATCH v4 01/10] rtlwifi: Fill in_4way field by driver Larry Finger
2017-07-25 12:20 ` Kalle Valo
2017-07-27 9:54 ` Kalle Valo
2017-07-27 9:56 ` Arend van Spriel
2017-07-27 10:08 ` Kalle Valo
2017-07-28 15:17 ` [v4,01/10] " Kalle Valo
2017-07-28 15:20 ` Kalle Valo
2017-07-02 18:12 ` [PATCH v4 02/10] rtlwifi: Add BT_MP_INFO to c2h handler Larry Finger
2017-07-03 21:08 ` Arend Van Spriel
2017-07-25 12:18 ` Kalle Valo [this message]
2017-07-27 9:59 ` Kalle Valo
2017-07-02 18:12 ` [PATCH v4 03/10] rtlwifi: Add board type for 8723be and 8192ee Larry Finger
2017-07-02 18:12 ` [PATCH v4 04/10] rtlwifi: add amplifier type for 8812ae Larry Finger
2017-07-02 18:12 ` [PATCH v4 05/10] rtlwifi: Update 8723be new phy parameters and its parser Larry Finger
2017-07-02 18:12 ` [PATCH v4 06/10] rtlwifi: Rename rtl_desc92_rate to rtl_desc_rate Larry Finger
2017-07-02 18:12 ` [PATCH v4 07/10] rtlwifi: Uses addr1 instead DA to determine broadcast and multicast addr Larry Finger
2017-07-02 18:12 ` [PATCH v4 08/10] rtlwifi: move IS_HARDWARE_TYPE_xxx checker to wifi.h Larry Finger
2017-07-02 18:12 ` [PATCH v4 09/10] rtlwifi: use debugfs to debug Larry Finger
2017-07-27 10:17 ` Kalle Valo
2017-07-27 10:39 ` Arend van Spriel
2017-07-27 10:56 ` Kalle Valo
2017-07-27 10:24 ` Kalle Valo
2017-07-28 15:22 ` [v4,09/10] " Kalle Valo
2017-07-02 18:12 ` [PATCH v4 10/10] rtlwifi: btcoex: Use seq_file to dump btcoex status Larry Finger
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=87fudkk8up.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=Larry.Finger@lwfinger.net \
--cc=arend.vanspriel@broadcom.com \
--cc=birming@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=shaofu@realtek.com \
--cc=steventing@realtek.com \
--cc=yhchuang@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).