From: <pkshih@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <Larry.Finger@lwfinger.net>, <linux-wireless@vger.kernel.org>
Subject: [PATCH v2 09/10] rtlwifi: btcoex: add routine to set default port id
Date: Mon, 29 Jan 2018 11:26:40 +0800 [thread overview]
Message-ID: <20180129032641.17841-10-pkshih@realtek.com> (raw)
In-Reply-To: <20180129032641.17841-1-pkshih@realtek.com>
From: Ping-Ke Shih <pkshih@realtek.com>
Tell wifi and BT firmware the default port ID to set multiports' state
properly, but only 8822be needs this function currently.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
.../realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 22 ++++++++++++++++++++++
.../realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 2 ++
drivers/net/wireless/realtek/rtlwifi/wifi.h | 5 +++++
3 files changed, 29 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index 1404729441a2..823694cb4fdb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -1039,6 +1039,28 @@ static void halbtc_fill_h2c_cmd(void *bt_context, u8 element_id,
cmd_len, cmd_buf);
}
+void halbtc_send_wifi_port_id_cmd(void *bt_context)
+{
+ struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context;
+ struct rtl_priv *rtlpriv = btcoexist->adapter;
+ u8 cmd_buf[1] = {0}; /* port id [2:0] = 0 */
+
+ rtlpriv->cfg->ops->fill_h2c_cmd(rtlpriv->mac80211.hw, H2C_BT_PORT_ID,
+ 1, cmd_buf);
+}
+
+void halbtc_set_default_port_id_cmd(void *bt_context)
+{
+ struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context;
+ struct rtl_priv *rtlpriv = btcoexist->adapter;
+ struct ieee80211_hw *hw = rtlpriv->mac80211.hw;
+
+ if (!rtlpriv->cfg->ops->set_default_port_id_cmd)
+ return;
+
+ rtlpriv->cfg->ops->set_default_port_id_cmd(hw);
+}
+
static
void halbtc_set_bt_reg(void *btc_context, u8 reg_type, u32 offset, u32 set_val)
{
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
index 8ed217656539..f5d8159a88eb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
@@ -691,6 +691,8 @@ void exhalbtc_lps_leave(struct btc_coexist *btcoexist);
void exhalbtc_low_wifi_traffic_notify(struct btc_coexist *btcoexist);
void exhalbtc_set_single_ant_path(struct btc_coexist *btcoexist,
u8 single_ant_path);
+void halbtc_send_wifi_port_id_cmd(void *bt_context);
+void halbtc_set_default_port_id_cmd(void *bt_context);
/* The following are used by wifi_only case */
enum wifionly_chip_interface {
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index 0e8aae0c05c1..1c9ed28b42da 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -153,6 +153,10 @@ enum rtl8192c_h2c_cmd {
MAX_H2CCMD
};
+enum {
+ H2C_BT_PORT_ID = 0x71,
+};
+
#define GET_TX_REPORT_SN_V1(c2h) (c2h[6])
#define GET_TX_REPORT_ST_V1(c2h) (c2h[0] & 0xC0)
#define GET_TX_REPORT_RETRY_V1(c2h) (c2h[2] & 0x3F)
@@ -2256,6 +2260,7 @@ struct rtl_hal_ops {
void (*bt_coex_off_before_lps) (struct ieee80211_hw *hw);
void (*fill_h2c_cmd) (struct ieee80211_hw *hw, u8 element_id,
u32 cmd_len, u8 *p_cmdbuffer);
+ void (*set_default_port_id_cmd)(struct ieee80211_hw *hw);
bool (*get_btc_status) (void);
bool (*is_fw_header)(struct rtlwifi_firmware_header *hdr);
u32 (*rx_command_packet)(struct ieee80211_hw *hw,
--
2.15.1
next prev parent reply other threads:[~2018-01-29 3:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-29 3:26 [PATCH v2 00/10] rtlwifi: add more materials for 8822be pkshih
2018-01-29 3:26 ` [PATCH v2 01/10] rtlwifi: enable mac80211 fast-tx support pkshih
2018-02-27 16:16 ` [v2,01/10] " Kalle Valo
2018-01-29 3:26 ` [PATCH v2 02/10] rtlwifi: Add Support VHT to spec_ver pkshih
2018-01-29 3:26 ` [PATCH v2 03/10] rtlwifi: Use 6 bits as sequence number of TX report pkshih
2018-01-29 3:26 ` [PATCH v2 04/10] rtlwifi: Extend tx_power_by_rate_offset size for newer IC pkshih
2018-01-29 3:26 ` [PATCH v2 05/10] rtlwifi: Add rate section and its related definition and comment pkshih
2018-01-29 3:26 ` [PATCH v2 06/10] rtlwifi: Fix VHT NSS in RC pkshih
2018-01-29 3:52 ` Larry Finger
2018-01-29 3:26 ` [PATCH v2 07/10] rtlwifi: add definition radio_mask for RF and maximum bandwidth pkshih
2018-01-29 3:26 ` [PATCH v2 08/10] rtlwifi: add efuse ops for other components pkshih
2018-01-29 3:26 ` pkshih [this message]
2018-01-29 3:26 ` [PATCH v2 10/10] rtlwifi: btcoex: Add 8822be btcoex supported files for wifi only pkshih
2018-02-09 13:42 ` [PATCH v2 00/10] rtlwifi: add more materials for 8822be Pkshih
2018-02-12 12:55 ` Kalle Valo
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=20180129032641.17841-10-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=Larry.Finger@lwfinger.net \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.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 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).