linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <pkshih@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <Larry.Finger@lwfinger.net>, <linux-wireless@vger.kernel.org>
Subject: [PATCH v2 08/15] rtlwifi: btcoex: Add pre- and post- normal LPS function
Date: Tue, 6 Mar 2018 09:25:47 +0800	[thread overview]
Message-ID: <20180306012554.3108-9-pkshih@realtek.com> (raw)
In-Reply-To: <20180306012554.3108-1-pkshih@realtek.com>

From: Ping-Ke Shih <pkshih@realtek.com>

Normal LPS is decomposed into pre- and post- parts, so we can issue H2C
with TDMA parameters in the "critical section" that dirver can't change
LPS state at the moment.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.c       | 22 ++++++++++++++++++++++
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h       |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index bfb32d476a70..0f664a0490a7 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -363,6 +363,22 @@ static void halbtc_normal_lps(struct btc_coexist *btcoexist)
 	}
 }
 
+static void halbtc_pre_normal_lps(struct btc_coexist *btcoexist)
+{
+	struct rtl_priv *rtlpriv = btcoexist->adapter;
+
+	if (btcoexist->bt_info.bt_ctrl_lps) {
+		btcoexist->bt_info.bt_lps_on = false;
+		rtl_lps_leave(rtlpriv->mac80211.hw);
+	}
+}
+
+static void halbtc_post_normal_lps(struct btc_coexist *btcoexist)
+{
+	if (btcoexist->bt_info.bt_ctrl_lps)
+		btcoexist->bt_info.bt_ctrl_lps = false;
+}
+
 static void halbtc_leave_low_power(struct btc_coexist *btcoexist)
 {
 }
@@ -806,6 +822,12 @@ static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)
 	case BTC_SET_ACT_NORMAL_LPS:
 		halbtc_normal_lps(btcoexist);
 		break;
+	case BTC_SET_ACT_PRE_NORMAL_LPS:
+		halbtc_pre_normal_lps(btcoexist);
+		break;
+	case BTC_SET_ACT_POST_NORMAL_LPS:
+		halbtc_post_normal_lps(btcoexist);
+		break;
 	case BTC_SET_ACT_DISABLE_LOW_POWER:
 		halbtc_disable_low_power(btcoexist, *bool_tmp);
 		break;
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
index 1f12449363c2..ad80ec05975e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
@@ -349,6 +349,8 @@ enum btc_set_type {
 	BTC_SET_ACT_LEAVE_LPS,
 	BTC_SET_ACT_ENTER_LPS,
 	BTC_SET_ACT_NORMAL_LPS,
+	BTC_SET_ACT_PRE_NORMAL_LPS,
+	BTC_SET_ACT_POST_NORMAL_LPS,
 	BTC_SET_ACT_INC_FORCE_EXEC_PWR_CMD_CNT,
 	BTC_SET_ACT_DISABLE_LOW_POWER,
 	BTC_SET_ACT_UPDATE_RAMASK,
-- 
2.15.1

  parent reply	other threads:[~2018-03-06  1:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  1:25 [PATCH v2 00/15] rtlwifi: Add 8822b 1ant/2ant btcoex files pkshih
2018-03-06  1:25 ` [PATCH v2 01/15] rtlwifi: Add modifier static to functions reported by sparse pkshih
2018-03-27  9:01   ` [v2, " Kalle Valo
2018-03-06  1:25 ` [PATCH v2 02/15] rtlwifi: remove redundant statement found by static checker pkshih
2018-03-06  1:25 ` [PATCH v2 03/15] rtlwifi: btcoex: Add enum DM_INFO for btcoex to query dm's counters pkshih
2018-03-20  3:55   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 04/15] rtlwifi: btcoex: Add customer_id to do special deal to oem vendor pkshih
2018-03-06  1:25 ` [PATCH v2 05/15] rtlwifi: btcoex: Get status of multichannel concurrence pkshih
2018-03-20  3:56   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 06/15] rtlwifi: btcoex: Add rate table for the use of btcoex pkshih
2018-03-20  3:58   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 07/15] rtlwifi: btcoex: Add interaction with phydm pkshih
2018-03-20  3:59   ` Larry Finger
2018-03-06  1:25 ` pkshih [this message]
2018-03-20  4:00   ` [PATCH v2 08/15] rtlwifi: btcoex: Add pre- and post- normal LPS function Larry Finger
2018-03-06  1:25 ` [PATCH v2 09/15] rtlwifi: btcoex: add assoc type v2 to connection notify pkshih
2018-03-20  4:01   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 10/15] rtlwifi: btcoex: new definitions introduced by 8822be pkshih
2018-03-20  4:02   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 11/15] rtlwifi: btcoex: Add new but dummy definitions introduced by 8822b pkshih
2018-03-20  4:02   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 12/15] rtlwifi: btcoex: Add 8822b 1ant/2ant coex files pkshih
2018-03-20  4:12   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 13/15] rtlwifi: btcoex: Add 8822b header files to precomp.h pkshih
2018-03-20  4:03   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 14/15] rtlwifi: btcoex: Add 8822b to Makefile pkshih
2018-03-20  4:04   ` Larry Finger
2018-03-06  1:25 ` [PATCH v2 15/15] rtlwifi: btcoex: Add 8822b routine to btc interfaces pkshih
2018-03-20  4:05   ` 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=20180306012554.3108-9-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).