[PATCH BlueZ v2] Set `SDP_LARGE_MTU` flag for DS4 Rev. 2 product code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



iterate over a table instead of checking individual product codes
---
 src/device.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 2b3d19f55..09121e1b9 100644
--- a/src/device.c
+++ b/src/device.c
@@ -6038,7 +6038,12 @@ static int device_browse_gatt(struct btd_device *device, DBusMessage *msg)
 
 static uint16_t get_sdp_flags(struct btd_device *device)
 {
+	size_t i;
 	uint16_t vid, pid;
+	static const uint16_t device_sdp_flags[][3] = {
+		{0x054c, 0x05c4, SDP_LARGE_MTU},
+		{0x054c, 0x09cc, SDP_LARGE_MTU}
+	};
 
 	vid = btd_device_get_vendor(device);
 	pid = btd_device_get_product(device);
@@ -6047,8 +6052,11 @@ static uint16_t get_sdp_flags(struct btd_device *device)
 	 * results in SDP response being dropped by kernel. Workaround this by
 	 * forcing SDP code to use bigger MTU while connecting.
 	 */
-	if (vid == 0x054c && pid == 0x05c4)
-		return SDP_LARGE_MTU;
+	for (i=0; i<G_N_ELEMENTS(device_sdp_flags); i++) {
+		if (vid == device_sdp_flags[i][0] &&
+				pid == device_sdp_flags[i][1])
+			return device_sdp_flags[i][2];
+	}
 
 	if (btd_adapter_ssp_enabled(device->adapter))
 		return 0;
-- 
2.47.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux