All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH v2] profile: Remove probe_on_discover
@ 2023-08-17 21:26 Luiz Augusto von Dentz
  2023-08-17 22:43 ` [BlueZ,v2] " bluez.test.bot
  2023-08-18 20:50 ` [BlueZ PATCH v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2023-08-17 21:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

The concept of probing not connected devices is already supported when
loading devices from storage, so drivers shall already be capabable of
handling such a thing as there are dedicated callbacks to indicate when
there is a new connection in the form of .accept callback.
---
 src/device.c  | 33 +++++++++++++--------------------
 src/profile.h |  5 -----
 2 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/src/device.c b/src/device.c
index ecd385cf813a..e0ff0b1c1543 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3930,17 +3930,13 @@ static bool device_match_profile(struct btd_device *device,
 					struct btd_profile *profile,
 					GSList *uuids)
 {
+	GSList *l;
+
 	if (profile->remote_uuid == NULL)
 		return false;
 
-	/* Don't match if device was just discovered, is temporary, and the
-	 * profile don't have probe_on_discover flag set.
-	 */
-	if (device->temporary && !profile->probe_on_discover)
-		return false;
-
-	if (g_slist_find_custom(uuids, profile->remote_uuid,
-							bt_uuid_strcmp) == NULL)
+	l = g_slist_find_custom(uuids, profile->remote_uuid, bt_uuid_strcmp);
+	if (!l)
 		return false;
 
 	return true;
@@ -4831,8 +4827,15 @@ static struct btd_service *probe_service(struct btd_device *device,
 	/* Only set auto connect if profile has set the flag and can really
 	 * accept connections.
 	 */
-	if (profile->auto_connect && profile->accept)
-		device_set_auto_connect(device, TRUE);
+	if (profile->auto_connect && profile->accept) {
+		/* If temporary mark auto_connect as disabled so when the
+		 * device is connected it attempts to enable it.
+		 */
+		if (device->temporary)
+			device->disable_auto_connect = TRUE;
+		else
+			device_set_auto_connect(device, TRUE);
+	}
 
 	return service;
 }
@@ -4903,8 +4906,6 @@ void device_probe_profiles(struct btd_device *device, GSList *uuids)
 		goto add_uuids;
 	}
 
-	DBG("Probing profiles for device %s", addr);
-
 	btd_profile_foreach(dev_probe, &d);
 
 add_uuids:
@@ -6932,9 +6933,6 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid)
 	GSList *uuid_list;
 	char *new_uuid;
 
-	if (g_slist_find_custom(device->uuids, uuid, bt_uuid_strcmp))
-		return;
-
 	new_uuid = g_strdup(uuid);
 	uuid_list = g_slist_append(NULL, new_uuid);
 
@@ -6942,11 +6940,6 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid)
 
 	g_free(new_uuid);
 	g_slist_free(uuid_list);
-
-	store_device_info(device);
-
-	g_dbus_emit_property_changed(dbus_conn, device->path,
-						DEVICE_INTERFACE, "UUIDs");
 }
 
 static sdp_list_t *read_device_records(struct btd_device *device)
diff --git a/src/profile.h b/src/profile.h
index cfc50058812d..6871f2f0d7d8 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -33,11 +33,6 @@ struct btd_profile {
 	 */
 	bool experimental;
 
-	/* Indicates the profile needs to be probed when the remote_uuid is
-	 * discovered.
-	 */
-	bool probe_on_discover;
-
 	int (*device_probe) (struct btd_service *service);
 	void (*device_remove) (struct btd_service *service);
 
-- 
2.41.0


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

* RE: [BlueZ,v2] profile: Remove probe_on_discover
  2023-08-17 21:26 [BlueZ PATCH v2] profile: Remove probe_on_discover Luiz Augusto von Dentz
@ 2023-08-17 22:43 ` bluez.test.bot
  2023-08-18 20:50 ` [BlueZ PATCH v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-08-17 22:43 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=777179

---Test result---

Test Summary:
CheckPatch                    PASS      0.54 seconds
GitLint                       PASS      0.35 seconds
BuildEll                      PASS      28.31 seconds
BluezMake                     PASS      1050.01 seconds
MakeCheck                     PASS      12.08 seconds
MakeDistcheck                 PASS      164.09 seconds
CheckValgrind                 PASS      266.26 seconds
CheckSmatch                   PASS      356.41 seconds
bluezmakeextell               PASS      108.54 seconds
IncrementalBuild              PASS      882.73 seconds
ScanBuild                     PASS      1119.15 seconds



---
Regards,
Linux Bluetooth


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

* Re: [BlueZ PATCH v2] profile: Remove probe_on_discover
  2023-08-17 21:26 [BlueZ PATCH v2] profile: Remove probe_on_discover Luiz Augusto von Dentz
  2023-08-17 22:43 ` [BlueZ,v2] " bluez.test.bot
@ 2023-08-18 20:50 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2023-08-18 20:50 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 17 Aug 2023 14:26:06 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> The concept of probing not connected devices is already supported when
> loading devices from storage, so drivers shall already be capabable of
> handling such a thing as there are dedicated callbacks to indicate when
> there is a new connection in the form of .accept callback.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2] profile: Remove probe_on_discover
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=507ba12483c3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-08-18 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 21:26 [BlueZ PATCH v2] profile: Remove probe_on_discover Luiz Augusto von Dentz
2023-08-17 22:43 ` [BlueZ,v2] " bluez.test.bot
2023-08-18 20:50 ` [BlueZ PATCH v2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.