* [PATCH BlueZ v1 0/1] Support for Enhanced Accept Sync Connection Request command in BlueZ emulator
@ 2025-12-24 6:34 Mahesh Talewad
2025-12-24 6:34 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Mahesh Talewad
0 siblings, 1 reply; 8+ messages in thread
From: Mahesh Talewad @ 2025-12-24 6:34 UTC (permalink / raw)
To: linux-bluetooth
Cc: devyani.godbole, luiz.dentz, sarveshwar.bajaj, mahesh.talewad,
vinit.mehta
Hello Maintainers,
In this PR, we have introduced support for Enhanced Accept Synchronous
Connection Request command into BlueZ emulator.
Thanks and regards,
Mahesh Vithal Talewad
Mahesh Talewad (1):
Enhanced Accept Synchronous Connection Request command is handled in
emulator.
emulator/btdev.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2025-12-24 6:34 [PATCH BlueZ v1 0/1] Support for Enhanced Accept Sync Connection Request command in BlueZ emulator Mahesh Talewad @ 2025-12-24 6:34 ` Mahesh Talewad 2025-12-24 7:39 ` Support for Enhanced Accept Sync Connection Request command in BlueZ emulator bluez.test.bot 2026-01-14 14:24 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Luiz Augusto von Dentz 0 siblings, 2 replies; 8+ messages in thread From: Mahesh Talewad @ 2025-12-24 6:34 UTC (permalink / raw) To: linux-bluetooth Cc: devyani.godbole, luiz.dentz, sarveshwar.bajaj, mahesh.talewad, vinit.mehta Implemented the command - Enhanced Accept Synchronous Connection Request command in emulator[emulator/btdev.c]. Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> --- emulator/btdev.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index be43623e8..55367cc7d 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, return 0; } +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, + const void *data, uint8_t len) +{ + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; + uint8_t status = BT_HCI_ERR_SUCCESS; + + if (cmd->tx_coding_format[0] > 5) + status = BT_HCI_ERR_INVALID_PARAMETERS; + + cmd_status(dev, status, BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); + + return 0; +} + +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, + const void *data, uint8_t len) +{ + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; + struct bt_hci_evt_sync_conn_complete cc; + struct btdev_conn *conn; + + memset(&cc, 0, sizeof(cc)); + + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); + if (!conn) { + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; + goto done; + } + + conn = conn_add_sco(conn); + if (!conn) { + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; + goto done; + } + + + cc.status = BT_HCI_ERR_SUCCESS; + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); + + cc.handle = cpu_to_le16(conn->handle); + cc.link_type = 0x02; + cc.tx_interval = 0x000c; + cc.retrans_window = 0x06; + cc.rx_pkt_len = 60; + cc.tx_pkt_len = 60; + cc.air_mode = cmd->tx_coding_format[0]; + +done: + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, sizeof(cc)); + + if (conn) + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, + &cc, sizeof(cc)); + + return 0; + +} + #define CMD_BREDR \ CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ cmd_setup_sync_conn_complete), \ @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ NULL), \ CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ - cmd_enhanced_setup_sync_conn_complete) + cmd_enhanced_setup_sync_conn_complete), \ + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ + cmd_enhanced_accept_sync_conn_req, \ + cmd_enhanced_accept_sync_conn_req_complete) static int cmd_set_event_mask_2(struct btdev *dev, const void *data, uint8_t len) @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) btdev->commands[23] |= 0x04; /* Read Data Block Size */ btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ btdev->cmds = cmd_bredr; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: Support for Enhanced Accept Sync Connection Request command in BlueZ emulator 2025-12-24 6:34 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Mahesh Talewad @ 2025-12-24 7:39 ` bluez.test.bot 2026-01-14 14:24 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Luiz Augusto von Dentz 1 sibling, 0 replies; 8+ messages in thread From: bluez.test.bot @ 2025-12-24 7:39 UTC (permalink / raw) To: linux-bluetooth, mahesh.talewad [-- Attachment #1: Type: text/plain, Size: 1428 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=1036285 ---Test result--- Test Summary: CheckPatch PENDING 0.22 seconds GitLint PENDING 0.28 seconds BuildEll PASS 20.01 seconds BluezMake PASS 637.42 seconds MakeCheck PASS 21.73 seconds MakeDistcheck PASS 241.63 seconds CheckValgrind PASS 301.27 seconds CheckSmatch WARNING 350.75 seconds bluezmakeextell PASS 182.10 seconds IncrementalBuild PENDING 0.32 seconds ScanBuild PASS 1014.04 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: CheckSmatch - WARNING Desc: Run smatch tool with source Output: emulator/btdev.c:470:29: warning: Variable length array is used. ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2025-12-24 6:34 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Mahesh Talewad 2025-12-24 7:39 ` Support for Enhanced Accept Sync Connection Request command in BlueZ emulator bluez.test.bot @ 2026-01-14 14:24 ` Luiz Augusto von Dentz 2026-01-15 12:47 ` [EXT] " Mahesh Talewad 1 sibling, 1 reply; 8+ messages in thread From: Luiz Augusto von Dentz @ 2026-01-14 14:24 UTC (permalink / raw) To: Mahesh Talewad Cc: linux-bluetooth, devyani.godbole, sarveshwar.bajaj, vinit.mehta Hi Mahesh, On Wed, Dec 24, 2025 at 1:30 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > Implemented the command - Enhanced Accept Synchronous Connection Request > command in emulator[emulator/btdev.c]. > > Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> > --- > emulator/btdev.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 63 insertions(+), 1 deletion(-) > > diff --git a/emulator/btdev.c b/emulator/btdev.c > index be43623e8..55367cc7d 100644 > --- a/emulator/btdev.c > +++ b/emulator/btdev.c > @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > return 0; > } > > +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, > + const void *data, uint8_t len) > +{ > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > + uint8_t status = BT_HCI_ERR_SUCCESS; > + > + if (cmd->tx_coding_format[0] > 5) > + status = BT_HCI_ERR_INVALID_PARAMETERS; > + > + cmd_status(dev, status, BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); > + > + return 0; > +} > + > +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, > + const void *data, uint8_t len) > +{ > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > + struct bt_hci_evt_sync_conn_complete cc; > + struct btdev_conn *conn; > + > + memset(&cc, 0, sizeof(cc)); > + > + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); > + if (!conn) { > + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; > + goto done; > + } > + > + conn = conn_add_sco(conn); > + if (!conn) { > + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; > + goto done; > + } > + > + > + cc.status = BT_HCI_ERR_SUCCESS; > + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); > + > + cc.handle = cpu_to_le16(conn->handle); > + cc.link_type = 0x02; > + cc.tx_interval = 0x000c; > + cc.retrans_window = 0x06; > + cc.rx_pkt_len = 60; > + cc.tx_pkt_len = 60; > + cc.air_mode = cmd->tx_coding_format[0]; Why are you harding most of the field above, aren't they available from the cmd? > + > +done: > + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, sizeof(cc)); > + > + if (conn) > + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, > + &cc, sizeof(cc)); > + > + return 0; > + > +} > + > #define CMD_BREDR \ > CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ > cmd_setup_sync_conn_complete), \ > @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ > NULL), \ > CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ > - cmd_enhanced_setup_sync_conn_complete) > + cmd_enhanced_setup_sync_conn_complete), \ > + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ > + cmd_enhanced_accept_sync_conn_req, \ > + cmd_enhanced_accept_sync_conn_req_complete) > > static int cmd_set_event_mask_2(struct btdev *dev, const void *data, > uint8_t len) > @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) > btdev->commands[23] |= 0x04; /* Read Data Block Size */ > btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ > btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ > + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ > btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ > btdev->cmds = cmd_bredr; > } > -- > 2.34.1 > -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2026-01-14 14:24 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Luiz Augusto von Dentz @ 2026-01-15 12:47 ` Mahesh Talewad 2026-01-15 14:59 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 8+ messages in thread From: Mahesh Talewad @ 2026-01-15 12:47 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, Devyani Godbole, Sarveshwar Bajaj, Vinit Mehta Hi Luiz, -----Original Message----- From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> Sent: Wednesday, January 14, 2026 7:54 PM To: Mahesh Talewad <mahesh.talewad@nxp.com> Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole <devyani.godbole@nxp.com>; Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> Subject: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button Hi Mahesh, On Wed, Dec 24, 2025 at 1:30 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > Implemented the command - Enhanced Accept Synchronous Connection > Request command in emulator[emulator/btdev.c]. > > Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> > --- > emulator/btdev.c | 64 > +++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 63 insertions(+), 1 deletion(-) > > diff --git a/emulator/btdev.c b/emulator/btdev.c index > be43623e8..55367cc7d 100644 > --- a/emulator/btdev.c > +++ b/emulator/btdev.c > @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > return 0; > } > > +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, > + const void *data, uint8_t len) { > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > + uint8_t status = BT_HCI_ERR_SUCCESS; > + > + if (cmd->tx_coding_format[0] > 5) > + status = BT_HCI_ERR_INVALID_PARAMETERS; > + > + cmd_status(dev, status, > + BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); > + > + return 0; > +} > + > +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, > + const void *data, uint8_t len) > +{ > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > + struct bt_hci_evt_sync_conn_complete cc; > + struct btdev_conn *conn; > + > + memset(&cc, 0, sizeof(cc)); > + > + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); > + if (!conn) { > + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; > + goto done; > + } > + > + conn = conn_add_sco(conn); > + if (!conn) { > + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; > + goto done; > + } > + > + > + cc.status = BT_HCI_ERR_SUCCESS; > + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); > + > + cc.handle = cpu_to_le16(conn->handle); > + cc.link_type = 0x02; > + cc.tx_interval = 0x000c; > + cc.retrans_window = 0x06; > + cc.rx_pkt_len = 60; > + cc.tx_pkt_len = 60; > + cc.air_mode = cmd->tx_coding_format[0]; Why are you harding most of the field above, aren't they available from the cmd? [Mahesh]: They aren't available from the cmd. Hence hardcoded. > + > +done: > + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, > +sizeof(cc)); > + > + if (conn) > + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, > + &cc, > + sizeof(cc)); > + > + return 0; > + > +} > + > #define CMD_BREDR \ > CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ > cmd_setup_sync_conn_complete), > \ @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ > NULL), \ > CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ > - cmd_enhanced_setup_sync_conn_complete) > + cmd_enhanced_setup_sync_conn_complete), \ > + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ > + cmd_enhanced_accept_sync_conn_req, \ > + cmd_enhanced_accept_sync_conn_req_complete) > > static int cmd_set_event_mask_2(struct btdev *dev, const void *data, > uint8_t len) > @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) > btdev->commands[23] |= 0x04; /* Read Data Block Size */ > btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ > btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ > + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ > btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ > btdev->cmds = cmd_bredr; > } > -- > 2.34.1 > -- Luiz Augusto von Dentz Thanks and regards, Mahesh Vithal Talewad ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2026-01-15 12:47 ` [EXT] " Mahesh Talewad @ 2026-01-15 14:59 ` Luiz Augusto von Dentz 2026-01-16 15:15 ` Mahesh Talewad 0 siblings, 1 reply; 8+ messages in thread From: Luiz Augusto von Dentz @ 2026-01-15 14:59 UTC (permalink / raw) To: Mahesh Talewad Cc: linux-bluetooth@vger.kernel.org, Devyani Godbole, Sarveshwar Bajaj, Vinit Mehta Hi Mahesh, On Thu, Jan 15, 2026 at 7:47 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > Hi Luiz, > > -----Original Message----- > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > Sent: Wednesday, January 14, 2026 7:54 PM > To: Mahesh Talewad <mahesh.talewad@nxp.com> > Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole <devyani.godbole@nxp.com>; Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> > Subject: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. > > Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button > > > Hi Mahesh, > > On Wed, Dec 24, 2025 at 1:30 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > > > Implemented the command - Enhanced Accept Synchronous Connection > > Request command in emulator[emulator/btdev.c]. > > > > Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> > > --- > > emulator/btdev.c | 64 > > +++++++++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 63 insertions(+), 1 deletion(-) > > > > diff --git a/emulator/btdev.c b/emulator/btdev.c index > > be43623e8..55367cc7d 100644 > > --- a/emulator/btdev.c > > +++ b/emulator/btdev.c > > @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > return 0; > > } > > > > +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, > > + const void *data, uint8_t len) { > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > + uint8_t status = BT_HCI_ERR_SUCCESS; > > + > > + if (cmd->tx_coding_format[0] > 5) > > + status = BT_HCI_ERR_INVALID_PARAMETERS; > > + > > + cmd_status(dev, status, > > + BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); > > + > > + return 0; > > +} > > + > > +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, > > + const void *data, uint8_t len) > > +{ > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > + struct bt_hci_evt_sync_conn_complete cc; > > + struct btdev_conn *conn; > > + > > + memset(&cc, 0, sizeof(cc)); > > + > > + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); > > + if (!conn) { > > + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; > > + goto done; > > + } > > + > > + conn = conn_add_sco(conn); > > + if (!conn) { > > + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; > > + goto done; > > + } > > + > > + > > + cc.status = BT_HCI_ERR_SUCCESS; > > + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); > > + > > + cc.handle = cpu_to_le16(conn->handle); > > + cc.link_type = 0x02; > > + cc.tx_interval = 0x000c; > > + cc.retrans_window = 0x06; > > + cc.rx_pkt_len = 60; > > + cc.tx_pkt_len = 60; > > + cc.air_mode = cmd->tx_coding_format[0]; > > Why are you harding most of the field above, aren't they available from the cmd? > [Mahesh]: They aren't available from the cmd. Hence hardcoded. Well not the BT_HCI_EVT_CONN_REQUEST itself but the code that originate it, which I believe to be cmd_enhanced_setup_sync_conn_complete, it does stores bt_hci_cmd_enhanced_setup_sync_conn fields into conn->data which you should probably use that. Btw, make use you run sco-tester with these changes and the kernel changes to confirm it really works, you might want to run using test-runner: https://github.com/bluez/bluez/blob/master/doc/test-runner.rst > > + > > +done: > > + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, > > +sizeof(cc)); > > + > > + if (conn) > > + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, > > + &cc, > > + sizeof(cc)); > > + > > + return 0; > > + > > +} > > + > > #define CMD_BREDR \ > > CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ > > cmd_setup_sync_conn_complete), > > \ @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ > > NULL), \ > > CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ > > - cmd_enhanced_setup_sync_conn_complete) > > + cmd_enhanced_setup_sync_conn_complete), \ > > + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ > > + cmd_enhanced_accept_sync_conn_req, \ > > + cmd_enhanced_accept_sync_conn_req_complete) > > > > static int cmd_set_event_mask_2(struct btdev *dev, const void *data, > > uint8_t len) > > @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) > > btdev->commands[23] |= 0x04; /* Read Data Block Size */ > > btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ > > btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ > > + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ > > btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ > > btdev->cmds = cmd_bredr; > > } > > -- > > 2.34.1 > > > > > -- > Luiz Augusto von Dentz > > Thanks and regards, > Mahesh Vithal Talewad -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2026-01-15 14:59 ` Luiz Augusto von Dentz @ 2026-01-16 15:15 ` Mahesh Talewad 2026-02-09 21:07 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 8+ messages in thread From: Mahesh Talewad @ 2026-01-16 15:15 UTC (permalink / raw) To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, Devyani Godbole, Sarveshwar Bajaj, Vinit Mehta Hi Luiz, -----Original Message----- From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> Sent: Thursday, January 15, 2026 8:30 PM To: Mahesh Talewad <mahesh.talewad@nxp.com> Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole <devyani.godbole@nxp.com>; Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> Subject: Re: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button Hi Mahesh, On Thu, Jan 15, 2026 at 7:47 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > Hi Luiz, > > -----Original Message----- > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > Sent: Wednesday, January 14, 2026 7:54 PM > To: Mahesh Talewad <mahesh.talewad@nxp.com> > Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole > <devyani.godbole@nxp.com>; Sarveshwar Bajaj > <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> > Subject: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. > > Caution: This is an external email. Please take care when clicking > links or opening attachments. When in doubt, report the message using > the 'Report this email' button > > > Hi Mahesh, > > On Wed, Dec 24, 2025 at 1:30 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > > > Implemented the command - Enhanced Accept Synchronous Connection > > Request command in emulator[emulator/btdev.c]. > > > > Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> > > --- > > emulator/btdev.c | 64 > > +++++++++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 63 insertions(+), 1 deletion(-) > > > > diff --git a/emulator/btdev.c b/emulator/btdev.c index > > be43623e8..55367cc7d 100644 > > --- a/emulator/btdev.c > > +++ b/emulator/btdev.c > > @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > return 0; > > } > > > > +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, > > + const void *data, uint8_t len) { > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > + uint8_t status = BT_HCI_ERR_SUCCESS; > > + > > + if (cmd->tx_coding_format[0] > 5) > > + status = BT_HCI_ERR_INVALID_PARAMETERS; > > + > > + cmd_status(dev, status, > > + BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); > > + > > + return 0; > > +} > > + > > +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, > > + const void *data, uint8_t > > +len) { > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > + struct bt_hci_evt_sync_conn_complete cc; > > + struct btdev_conn *conn; > > + > > + memset(&cc, 0, sizeof(cc)); > > + > > + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); > > + if (!conn) { > > + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; > > + goto done; > > + } > > + > > + conn = conn_add_sco(conn); > > + if (!conn) { > > + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; > > + goto done; > > + } > > + > > + > > + cc.status = BT_HCI_ERR_SUCCESS; > > + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); > > + > > + cc.handle = cpu_to_le16(conn->handle); > > + cc.link_type = 0x02; > > + cc.tx_interval = 0x000c; > > + cc.retrans_window = 0x06; > > + cc.rx_pkt_len = 60; > > + cc.tx_pkt_len = 60; > > + cc.air_mode = cmd->tx_coding_format[0]; > > Why are you harding most of the field above, aren't they available from the cmd? > [Mahesh]: They aren't available from the cmd. Hence hardcoded. Well not the BT_HCI_EVT_CONN_REQUEST itself but the code that originate it, which I believe to be cmd_enhanced_setup_sync_conn_complete, it does stores bt_hci_cmd_enhanced_setup_sync_conn fields into conn->data which you should probably use that. Btw, make use you run sco-tester with these changes and the kernel changes to confirm it really works, you might want to run using test-runner: https://github.com/bluez/bluez/blob/master/doc/test-runner.rst [Mahesh] : bt_hci_cmd_enhanced_setup_sync_conn fields do not have tx_interval, retrans_window, rx_pkt_len, tx_pkt_len fields. Hence we can not use conn->data (which contains bt_hci_cmd_enhanced_setup_sync_conn fields), in cmd_enhanced_accept_sync_conn_req_complete(). Same fields are hardcoded in func - sync_conn_init_complete(), also. we are running sco-tester using test-runner using blow command sudo tools/test-runner -m -k /home/Documents/Kernel_Image/bzImage -- tools/sco-tester With and without 'Enhanced Accept Synchronous Connection Request command' code (both in emulator and kernel), below testcases(4) are failing: SCO CVSD Send - TX Timestamping Failed SCO CVSD Send No Flowctl - TX Timestamping Timed out SCO Ethtool Get Ts Info - Success Failed SCO Ethtool Get Ts Info No Flowctl - Success Failed > > + > > +done: > > + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, > > +sizeof(cc)); > > + > > + if (conn) > > + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, > > + &cc, > > + sizeof(cc)); > > + > > + return 0; > > + > > +} > > + > > #define CMD_BREDR \ > > CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ > > > > cmd_setup_sync_conn_complete), \ @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ > > NULL), \ > > CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ > > - cmd_enhanced_setup_sync_conn_complete) > > + cmd_enhanced_setup_sync_conn_complete), \ > > + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ > > + cmd_enhanced_accept_sync_conn_req, \ > > + cmd_enhanced_accept_sync_conn_req_complete) > > > > static int cmd_set_event_mask_2(struct btdev *dev, const void *data, > > uint8_t len) > > @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) > > btdev->commands[23] |= 0x04; /* Read Data Block Size */ > > btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ > > btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ > > + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ > > btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ > > btdev->cmds = cmd_bredr; > > } > > -- > > 2.34.1 > > > > > -- > Luiz Augusto von Dentz > > Thanks and regards, > Mahesh Vithal Talewad -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. 2026-01-16 15:15 ` Mahesh Talewad @ 2026-02-09 21:07 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 8+ messages in thread From: Luiz Augusto von Dentz @ 2026-02-09 21:07 UTC (permalink / raw) To: Mahesh Talewad Cc: linux-bluetooth@vger.kernel.org, Devyani Godbole, Sarveshwar Bajaj, Vinit Mehta Hi Mahesh, On Fri, Jan 16, 2026 at 10:15 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > Hi Luiz, > > -----Original Message----- > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > Sent: Thursday, January 15, 2026 8:30 PM > To: Mahesh Talewad <mahesh.talewad@nxp.com> > Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole <devyani.godbole@nxp.com>; Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> > Subject: Re: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. > > Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button > > > Hi Mahesh, > > On Thu, Jan 15, 2026 at 7:47 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > > > Hi Luiz, > > > > -----Original Message----- > > From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> > > Sent: Wednesday, January 14, 2026 7:54 PM > > To: Mahesh Talewad <mahesh.talewad@nxp.com> > > Cc: linux-bluetooth@vger.kernel.org; Devyani Godbole > > <devyani.godbole@nxp.com>; Sarveshwar Bajaj > > <sarveshwar.bajaj@nxp.com>; Vinit Mehta <vinit.mehta@nxp.com> > > Subject: [EXT] Re: [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator. > > > > Caution: This is an external email. Please take care when clicking > > links or opening attachments. When in doubt, report the message using > > the 'Report this email' button > > > > > > Hi Mahesh, > > > > On Wed, Dec 24, 2025 at 1:30 AM Mahesh Talewad <mahesh.talewad@nxp.com> wrote: > > > > > > Implemented the command - Enhanced Accept Synchronous Connection > > > Request command in emulator[emulator/btdev.c]. > > > > > > Signed-off-by: Mahesh Talewad <mahesh.talewad@nxp.com> > > > --- > > > emulator/btdev.c | 64 > > > +++++++++++++++++++++++++++++++++++++++++++++++- > > > 1 file changed, 63 insertions(+), 1 deletion(-) > > > > > > diff --git a/emulator/btdev.c b/emulator/btdev.c index > > > be43623e8..55367cc7d 100644 > > > --- a/emulator/btdev.c > > > +++ b/emulator/btdev.c > > > @@ -3434,6 +3434,64 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > > return 0; > > > } > > > > > > +static int cmd_enhanced_accept_sync_conn_req(struct btdev *dev, > > > + const void *data, uint8_t len) { > > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > > + uint8_t status = BT_HCI_ERR_SUCCESS; > > > + > > > + if (cmd->tx_coding_format[0] > 5) > > > + status = BT_HCI_ERR_INVALID_PARAMETERS; > > > + > > > + cmd_status(dev, status, > > > + BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST); > > > + > > > + return 0; > > > +} > > > + > > > +static int cmd_enhanced_accept_sync_conn_req_complete(struct btdev *dev, > > > + const void *data, uint8_t > > > +len) { > > > + const struct bt_hci_cmd_enhanced_accept_sync_conn_request *cmd = data; > > > + struct bt_hci_evt_sync_conn_complete cc; > > > + struct btdev_conn *conn; > > > + > > > + memset(&cc, 0, sizeof(cc)); > > > + > > > + conn = queue_find(dev->conns, match_bdaddr, cmd->bdaddr); > > > + if (!conn) { > > > + cc.status = BT_HCI_ERR_INVALID_PARAMETERS; > > > + goto done; > > > + } > > > + > > > + conn = conn_add_sco(conn); > > > + if (!conn) { > > > + cc.status = BT_HCI_ERR_MEM_CAPACITY_EXCEEDED; > > > + goto done; > > > + } > > > + > > > + > > > + cc.status = BT_HCI_ERR_SUCCESS; > > > + memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); > > > + > > > + cc.handle = cpu_to_le16(conn->handle); > > > + cc.link_type = 0x02; > > > + cc.tx_interval = 0x000c; > > > + cc.retrans_window = 0x06; > > > + cc.rx_pkt_len = 60; > > > + cc.tx_pkt_len = 60; > > > + cc.air_mode = cmd->tx_coding_format[0]; > > > > Why are you harding most of the field above, aren't they available from the cmd? > > [Mahesh]: They aren't available from the cmd. Hence hardcoded. > > Well not the BT_HCI_EVT_CONN_REQUEST itself but the code that originate it, which I believe to be cmd_enhanced_setup_sync_conn_complete, it does stores bt_hci_cmd_enhanced_setup_sync_conn fields into conn->data which you should probably use that. Btw, make use you run sco-tester with these changes and the kernel changes to confirm it really works, you might want to run using test-runner: > > https://github.com/bluez/bluez/blob/master/doc/test-runner.rst > > [Mahesh] : bt_hci_cmd_enhanced_setup_sync_conn fields do not have tx_interval, retrans_window, rx_pkt_len, tx_pkt_len fields. > Hence we can not use conn->data (which contains bt_hci_cmd_enhanced_setup_sync_conn fields), in cmd_enhanced_accept_sync_conn_req_complete(). > Same fields are hardcoded in func - sync_conn_init_complete(), also. Looks like I never replied here. Yes, now I see why you need to initialize it here. That said, we should probably use sync_conn_init_complete then or maybe just call sync_conn_complete since the function you are introducing appears to be a duplicate of that. > we are running sco-tester using test-runner using blow command > sudo tools/test-runner -m -k /home/Documents/Kernel_Image/bzImage -- tools/sco-tester > > With and without 'Enhanced Accept Synchronous Connection Request command' code (both in emulator and kernel), below testcases(4) are failing: > SCO CVSD Send - TX Timestamping Failed > SCO CVSD Send No Flowctl - TX Timestamping Timed out > SCO Ethtool Get Ts Info - Success Failed > SCO Ethtool Get Ts Info No Flowctl - Success Failed > > > > > + > > > +done: > > > + send_event(dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, &cc, > > > +sizeof(cc)); > > > + > > > + if (conn) > > > + send_event(conn->link->dev, BT_HCI_EVT_SYNC_CONN_COMPLETE, > > > + &cc, > > > + sizeof(cc)); > > > + > > > + return 0; > > > + > > > +} > > > + > > > #define CMD_BREDR \ > > > CMD(BT_HCI_CMD_SETUP_SYNC_CONN, cmd_setup_sync_conn, \ > > > > > > cmd_setup_sync_conn_complete), \ @@ -3471,7 +3529,10 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data, > > > CMD(BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG, cmd_get_mws_transport_config, \ > > > NULL), \ > > > CMD(BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN, cmd_enhanced_setup_sync_conn, \ > > > - cmd_enhanced_setup_sync_conn_complete) > > > + cmd_enhanced_setup_sync_conn_complete), \ > > > + CMD(BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST, \ > > > + cmd_enhanced_accept_sync_conn_req, \ > > > + cmd_enhanced_accept_sync_conn_req_complete) > > > > > > static int cmd_set_event_mask_2(struct btdev *dev, const void *data, > > > uint8_t len) > > > @@ -3604,6 +3665,7 @@ static void set_bredr_commands(struct btdev *btdev) > > > btdev->commands[23] |= 0x04; /* Read Data Block Size */ > > > btdev->commands[29] |= 0x20; /* Read Local Supported Codecs */ > > > btdev->commands[29] |= 0x08; /* Enhanced Setup Synchronous Conn */ > > > + btdev->commands[29] |= 0x10; /* Enhanced Accept Sync Connection */ > > > btdev->commands[30] |= 0x08; /* Get MWS Transport Layer Config */ > > > btdev->cmds = cmd_bredr; > > > } > > > -- > > > 2.34.1 > > > > > > > > > -- > > Luiz Augusto von Dentz > > > > Thanks and regards, > > Mahesh Vithal Talewad > > > > -- > Luiz Augusto von Dentz -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-02-09 21:07 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-24 6:34 [PATCH BlueZ v1 0/1] Support for Enhanced Accept Sync Connection Request command in BlueZ emulator Mahesh Talewad 2025-12-24 6:34 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Mahesh Talewad 2025-12-24 7:39 ` Support for Enhanced Accept Sync Connection Request command in BlueZ emulator bluez.test.bot 2026-01-14 14:24 ` [PATCH BlueZ v1 1/1] Enhanced Accept Synchronous Connection Request command is handled in emulator Luiz Augusto von Dentz 2026-01-15 12:47 ` [EXT] " Mahesh Talewad 2026-01-15 14:59 ` Luiz Augusto von Dentz 2026-01-16 15:15 ` Mahesh Talewad 2026-02-09 21:07 ` Luiz Augusto von Dentz
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.