linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] Bluetooth: hci_event: Fix power save marking logic
@ 2023-12-14 14:36 Zijun Hu
  2023-12-14 15:33 ` [v1,1/1] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Zijun Hu @ 2023-12-14 14:36 UTC (permalink / raw)
  To: luiz.dentz, marcel, johan.hedberg, jaikumar; +Cc: linux-bluetooth, quic_zijuhu

Flag HCI_CONN_POWER_SAVE stands for sniff mode, but hci_mode_change_evt()
wrongly set the flag for active mode and clear for sniff mode, it is fixed
by reversing power save marking logic.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 net/bluetooth/hci_event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ef8c3bed7361..74a14f2e0eaa 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4601,9 +4601,9 @@ static void hci_mode_change_evt(struct hci_dev *hdev, void *data,
 		if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND,
 					&conn->flags)) {
 			if (conn->mode == HCI_CM_ACTIVE)
-				set_bit(HCI_CONN_POWER_SAVE, &conn->flags);
-			else
 				clear_bit(HCI_CONN_POWER_SAVE, &conn->flags);
+			else
+				set_bit(HCI_CONN_POWER_SAVE, &conn->flags);
 		}
 
 		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags))
-- 
The Qualcomm Innovation Center


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-14 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14 14:36 [PATCH v1 1/1] Bluetooth: hci_event: Fix power save marking logic Zijun Hu
2023-12-14 15:33 ` [v1,1/1] " bluez.test.bot

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).