linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BlueZ PATCH 1/6] Bluetooth: Update Adv monitor count upon removal
@ 2020-09-17  5:29 Howard Chung
  2020-09-17  5:29 ` [BlueZ PATCH 2/6] Bluetooth: Set scan parameters for ADV Monitor Howard Chung
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Howard Chung @ 2020-09-17  5:29 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mcchou, marcel, mmandlik, howardchung, luiz.dentz, alainm,
	David S. Miller, Jakub Kicinski, Johan Hedberg, linux-kernel,
	netdev

From: Miao-chen Chou <mcchou@chromium.org>

This fixes the count of Adv monitor upon monitor removal.

The following test was performed.
- Start two btmgmt consoles, issue a btmgmt advmon-remove command on one
console and observe a MGMT_EV_ADV_MONITOR_REMOVED event on the other.

Signed-off-by: Howard Chung <howardchung@google.com>
Signed-off-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
---

 net/bluetooth/hci_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 8a2645a833013..f30a1f5950e15 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3061,6 +3061,7 @@ static int free_adv_monitor(int id, void *ptr, void *data)
 
 	idr_remove(&hdev->adv_monitors_idr, monitor->handle);
 	hci_free_adv_monitor(monitor);
+	hdev->adv_monitors_cnt--;
 
 	return 0;
 }
@@ -3077,6 +3078,7 @@ int hci_remove_adv_monitor(struct hci_dev *hdev, u16 handle)
 
 		idr_remove(&hdev->adv_monitors_idr, monitor->handle);
 		hci_free_adv_monitor(monitor);
+		hdev->adv_monitors_cnt--;
 	} else {
 		/* Remove all monitors if handle is 0. */
 		idr_for_each(&hdev->adv_monitors_idr, &free_adv_monitor, hdev);
-- 
2.28.0.618.gf4bc123cb7-goog


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

end of thread, other threads:[~2020-09-17  5:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  5:29 [BlueZ PATCH 1/6] Bluetooth: Update Adv monitor count upon removal Howard Chung
2020-09-17  5:29 ` [BlueZ PATCH 2/6] Bluetooth: Set scan parameters for ADV Monitor Howard Chung
2020-09-17  5:29 ` [BlueZ PATCH 3/6] Bluetooth: Interleave with allowlist scan Howard Chung
2020-09-17  5:29 ` [BlueZ PATCH 4/6] Bluetooth: Handle system suspend resume case Howard Chung
2020-09-17  5:29 ` [BlueZ PATCH 5/6] Bluetooth: Handle active scan case Howard Chung
2020-09-17  5:29 ` [BlueZ PATCH 6/6] Bluetooth: Add toggle to switch off interleave scan Howard Chung

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