monitor: Add page information to print_features_subpage
Luiz Augusto von Dentz
maintainerPATCH 1/2 monitor: Add page information to print_features_subpage
From: Luiz Augusto von Dentz <[email protected]>
This makes print_features_subpage print the page they belong:
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 253
LE Read All Local Features (0x08|0x0087) ncmd 1
Status: Success (0x00)
Page: 10
Features[0/0][8]: 403900f301000080
LL Privacy
LE 2M PHY
LE Coded PHY
LE Extended Advertising
LE Periodic Advertising
Periodic Advertising Sync Transfer - Sender
Periodic Advertising Sync Transfer - Recipient
Connected Isochronous Stream - Central
Connected Isochronous Stream - Peripheral
Isochronous Broadcaster
Synchronized Receiver
Connected Isochronous Stream (Host Support)
LL Extended Feature Set
Features[1/0][8]: 0000000000000000
Features[1/1][8]: 0000000000000000
Features[1/2][8]: 0000000000000000
Features[2/0][8]: 0000000000000000
Features[2/1][8]: 0000000000000000
Features[2/2][8]: 0000000000000000
Features[3/0][8]: 0000000000000000
Features[3/1][8]: 0000000000000000
Features[3/2][8]: 0000000000000000
Features[4/0][8]: 0000000000000000
Features[4/1][8]: 0000000000000000
Features[4/2][8]: 0000000000000000
Features[5/0][8]: 0000000000000000
Features[5/1][8]: 0000000000000000
Features[5/2][8]: 0000000000000000
Features[6/0][8]: 0000000000000000
Features[6/1][8]: 0000000000000000
Features[6/2][8]: 0000000000000000
Features[7/0][8]: 0000000000000000
Features[7/1][8]: 0000000000000000
Features[7/2][8]: 0000000000000000
Features[8/0][8]: 0000000000000000
Features[8/1][8]: 0000000000000000
Features[8/2][8]: 0000000000000000
Features[9/0][8]: 0000000000000000
Features[9/1][8]: 0000000000000000
Features[9/2][8]: 0000000000000000
Features[10/0][8]: 0000000000000000
Features[10/1][8]: 0000000000000000
Features[10/2][8]: 0000000000000000
---
monitor/packet.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)monitor/packet.c +4 -4
@@ -2837,18 +2837,18 @@ static const struct bitfield_data features_msft[] = { { } }; -static void print_features_subpage (uint8_t subpages, +static void print_features_subpage (uint8_t page,uint8_t subpages,const uint8_t *features_array,uint64_t *features) {int i, j; -char str[16 ]; +char str[18 ];for (i =0 ; i < subpages; i++) {for (j =0 ; j <8 ; j++) features[i] |= ((uint64_t ) features_array[i *8 + j]) << (j *8 ); -sprintf (str,"Features[%u]" , i); +sprintf (str,"Features[%u/%u]" , page, i);print_hex_field (str, &features_array[i *8 ],8 ); } }
@@ -2865,7 +2865,7 @@ static void print_features(uint8_t page, const uint8_t *features_array,if (type ==0x01 && page) subpages =3 ; -print_features_subpage (subpages, features_array, features); +print_features_subpage (page, subpages, features_array, features);switch (type) {case 0x00 :
Signature · 1 line
2.51.1
Luiz Augusto von Dentz
maintainerPATCH 2/2 btdev: Fix set_bredrle_commands
From: Luiz Augusto von Dentz <[email protected]>
This fixes set_bredrle_commands which was overriding the list of commands previously set, so instead of setting the extra command after the command list of the specific version this is now merged together with each version that requires the extra commands.
--- emulator/btdev.c | 258 +++++++++++++++++++++++++---------------------- 1 file changed, 136 insertions(+), 122 deletions(-)
emulator/btdev.c +136 -122
@@ -3267,6 +3267,103 @@ static int cmd_get_mws_transport_config(struct btdev *dev, const void *data,CMD (BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN , cmd_enhanced_setup_sync_conn, \ cmd_enhanced_setup_sync_conn_complete) +static int cmd_set_event_mask_2 (struct btdev *dev,const void *data, +uint8_t len) +{ +const struct bt_hci_cmd_set_event_mask_page2 *cmd = data; +uint8_t status =BT_HCI_ERR_SUCCESS ; + +memcpy (dev->event_mask_page2, cmd->mask,8 ); +cmd_complete (dev,BT_HCI_CMD_SET_EVENT_MASK_PAGE2 , &status, +sizeof (status)); + +return 0 ; +} + +static int cmd_read_sync_train_params (struct btdev *dev,const void *data, +uint8_t len) +{ +struct bt_hci_rsp_read_sync_train_params rsp; + +memset (&rsp,0 ,sizeof (rsp)); + + rsp.status =BT_HCI_ERR_SUCCESS ; + rsp.interval =cpu_to_le16 (dev->sync_train_interval); + rsp.timeout =cpu_to_le32 (dev->sync_train_timeout); + rsp.service_data = dev->sync_train_service_data; +cmd_complete (dev,BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS , &rsp,sizeof (rsp)); + +return 0 ; +} + +static int cmd_read_sc_support (struct btdev *dev,const void *data,uint8_t len) +{ +struct bt_hci_rsp_read_secure_conn_support rsp; + +memset (&rsp,0 ,sizeof (rsp)); + + rsp.status =BT_HCI_ERR_SUCCESS ; + rsp.support = dev->secure_conn_support; +cmd_complete (dev,BT_HCI_CMD_READ_SECURE_CONN_SUPPORT , &rsp, +sizeof (rsp)); + +return 0 ; +} + +static int cmd_write_sc_support (struct btdev *dev,const void *data, +uint8_t len) +{ +const struct bt_hci_cmd_write_secure_conn_support *cmd = data; +uint8_t status =BT_HCI_ERR_SUCCESS ; + + dev->secure_conn_support = cmd->support; +cmd_complete (dev,BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT , &status, +sizeof (status)); + +return 0 ; +} + +static int cmd_read_auth_payload_timeout (struct btdev *dev,const void *data, +uint8_t len) +{ +/* TODO */ +return -ENOTSUP ; +} + +static int cmd_write_auth_payload_timeout (struct btdev *dev,const void *data, +uint8_t len) +{ +/* TODO */ +return -ENOTSUP ; +} + +static int cmd_read_local_oob_ext_data (struct btdev *dev,const void *data, +uint8_t len) +{ +struct bt_hci_rsp_read_local_oob_ext_data rsp; + +memset (&rsp,0 ,sizeof (rsp)); + + rsp.status =BT_HCI_ERR_SUCCESS ; +cmd_complete (dev,BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA , &rsp, +sizeof (rsp)); + +return 0 ; +} + +#define CMD_COMMON_BREDR_LE_40 \ + CMD(BT_HCI_CMD_SET_EVENT_MASK_PAGE2, cmd_set_event_mask_2, NULL), \ + CMD(BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS, cmd_read_sync_train_params, \ + NULL), \ + CMD(BT_HCI_CMD_READ_SECURE_CONN_SUPPORT, cmd_read_sc_support, NULL), \ + CMD(BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT, cmd_write_sc_support, NULL), \ + CMD(BT_HCI_CMD_READ_AUTH_PAYLOAD_TIMEOUT, \ + cmd_read_auth_payload_timeout, NULL), \ + CMD(BT_HCI_CMD_WRITE_AUTH_PAYLOAD_TIMEOUT, \ + cmd_write_auth_payload_timeout, NULL), \ + CMD(BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA, \ + cmd_read_local_oob_ext_data, NULL) +static const struct btdev_cmd cmd_bredr[] = {CMD_COMMON_ALL ,CMD_COMMON_BREDR_LE ,
@@ -4732,6 +4829,31 @@ static int cmd_gen_dhkey(struct btdev *dev, const void *data, uint8_t len)CMD (BT_HCI_CMD_LE_SET_RESOLV_ENABLE , cmd_set_rl_enable,NULL ), \ CMD(BT_HCI_CMD_LE_SET_RESOLV_TIMEOUT, cmd_set_rl_timeout, NULL) +static const struct btdev_cmd cmd_bredr_le[] = { +CMD_COMMON_ALL , +CMD_COMMON_BREDR_LE , +CMD_COMMON_BREDR_20 , +CMD_COMMON_BREDR_LE_40 , +CMD_BREDR , +CMD_LE , + {} +}; + +static void set_bredrle_40_commands (struct btdev *btdev) +{ +/* Extra BR/EDR commands we want to only support for >= 4.0 +* adapters. +*/ + btdev->commands[22 ] |=0x04 ;/* Set Event Mask Page 2 */ + btdev->commands[31 ] |=0x80 ;/* Read Sync Train Parameters */ + btdev->commands[32 ] |=0x04 ;/* Read Secure Connections Support */ + btdev->commands[32 ] |=0x08 ;/* Write Secure Connections Support */ + btdev->commands[32 ] |=0x10 ;/* Read Auth Payload Timeout */ + btdev->commands[32 ] |=0x20 ;/* Write Auth Payload Timeout */ + btdev->commands[32 ] |=0x40 ;/* Read Local OOB Extended Data */ + btdev->cmds = cmd_bredr_le; +} +static int cmd_set_default_phy (struct btdev *dev,const void *data,uint8_t len) {
@@ -6041,6 +6163,9 @@ done:static const struct btdev_cmd cmd_le_5_0[] = {CMD_COMMON_ALL ,CMD_COMMON_BREDR_LE , +CMD_COMMON_BREDR_20 , +CMD_COMMON_BREDR_LE_40 , +CMD_BREDR ,CMD_LE ,CMD_LE_50 , {}
@@ -7345,6 +7470,9 @@ static int cmd_config_data_path(struct btdev *dev, const void *data,static const struct btdev_cmd cmd_le_5_2[] = {CMD_COMMON_ALL ,CMD_COMMON_BREDR_LE , +CMD_COMMON_BREDR_20 , +CMD_COMMON_BREDR_LE_40 , +CMD_BREDR ,CMD_LE ,CMD_LE_50 ,CMD_LE_52 ,
@@ -7398,6 +7526,7 @@ static int cmd_le_read_all_local_features(struct btdev *dev, const void *data,memset (&rsp,0 ,sizeof (rsp)); rsp.status =BT_HCI_ERR_SUCCESS ; + rsp.page =10 ;memcpy (rsp.features, dev->le_features,248 ); cmd_complete(dev, BT_HCI_CMD_LE_READ_ALL_LOCAL_FEATURES, &rsp,
@@ -7446,6 +7575,9 @@ static int cmd_le_read_all_remote_features(struct btdev *dev, const void *data,static const struct btdev_cmd cmd_le_6_0[] = {CMD_COMMON_ALL ,CMD_COMMON_BREDR_LE , +CMD_COMMON_BREDR_20 , +CMD_COMMON_BREDR_LE_40 , +CMD_BREDR ,CMD_LE ,CMD_LE_50 ,CMD_LE_52 ,
@@ -7514,6 +7646,9 @@ static void set_le_commands(struct btdev *btdev) btdev->cmds = cmd_le; +if (btdev->type >=BTDEV_TYPE_BREDRLE ) +set_bredrle_40_commands (btdev); +/* Extra LE commands for >= 5.0 adapters */ if (btdev->type >=BTDEV_TYPE_BREDRLE50 ) {set_le_50_commands (btdev);
@@ -7527,137 +7662,16 @@ static void set_le_commands(struct btdev *btdev) }/* Extra LE commands for >= 6.0 adapters */ -if (btdev->type >=BTDEV_TYPE_BREDRLE52 ) { +if (btdev->type >=BTDEV_TYPE_BREDRLE60 ) {set_le_60_commands (btdev); btdev->cmds = cmd_le_6_0; } } -static int cmd_set_event_mask_2 (struct btdev *dev,const void *data, -uint8_t len) -{ -const struct bt_hci_cmd_set_event_mask_page2 *cmd = data; -uint8_t status =BT_HCI_ERR_SUCCESS ; - -memcpy (dev->event_mask_page2, cmd->mask,8 ); -cmd_complete (dev,BT_HCI_CMD_SET_EVENT_MASK_PAGE2 , &status, -sizeof (status)); - -return 0 ; -} - -static int cmd_read_sync_train_params (struct btdev *dev,const void *data, -uint8_t len) -{ -struct bt_hci_rsp_read_sync_train_params rsp; - -memset (&rsp,0 ,sizeof (rsp)); - - rsp.status =BT_HCI_ERR_SUCCESS ; - rsp.interval =cpu_to_le16 (dev->sync_train_interval); - rsp.timeout =cpu_to_le32 (dev->sync_train_timeout); - rsp.service_data = dev->sync_train_service_data; -cmd_complete (dev,BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS , &rsp,sizeof (rsp)); - -return 0 ; -} - -static int cmd_read_sc_support (struct btdev *dev,const void *data,uint8_t len) -{ -struct bt_hci_rsp_read_secure_conn_support rsp; - -memset (&rsp,0 ,sizeof (rsp)); - - rsp.status =BT_HCI_ERR_SUCCESS ; - rsp.support = dev->secure_conn_support; -cmd_complete (dev,BT_HCI_CMD_READ_SECURE_CONN_SUPPORT , &rsp, -sizeof (rsp)); - -return 0 ; -} - -static int cmd_write_sc_support (struct btdev *dev,const void *data, -uint8_t len) -{ -const struct bt_hci_cmd_write_secure_conn_support *cmd = data; -uint8_t status =BT_HCI_ERR_SUCCESS ; - - dev->secure_conn_support = cmd->support; -cmd_complete (dev,BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT , &status, -sizeof (status)); - -return 0 ; -} - -static int cmd_read_auth_payload_timeout (struct btdev *dev,const void *data, -uint8_t len) -{ -/* TODO */ -return -ENOTSUP ; -} - -static int cmd_write_auth_payload_timeout (struct btdev *dev,const void *data, -uint8_t len) -{ -/* TODO */ -return -ENOTSUP ; -} - -static int cmd_read_local_oob_ext_data (struct btdev *dev,const void *data, -uint8_t len) -{ -struct bt_hci_rsp_read_local_oob_ext_data rsp; - -memset (&rsp,0 ,sizeof (rsp)); - - rsp.status =BT_HCI_ERR_SUCCESS ; -cmd_complete (dev,BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA , &rsp, -sizeof (rsp)); - -return 0 ; -} - -#define BT_BREDR_LE \ - CMD(BT_HCI_CMD_SET_EVENT_MASK_PAGE2, cmd_set_event_mask_2, NULL), \ - CMD(BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS, cmd_read_sync_train_params, \ - NULL), \ - CMD(BT_HCI_CMD_READ_SECURE_CONN_SUPPORT, cmd_read_sc_support, NULL), \ - CMD(BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT, cmd_write_sc_support, NULL), \ - CMD(BT_HCI_CMD_READ_AUTH_PAYLOAD_TIMEOUT, \ - cmd_read_auth_payload_timeout, NULL), \ - CMD(BT_HCI_CMD_WRITE_AUTH_PAYLOAD_TIMEOUT, \ - cmd_write_auth_payload_timeout, NULL), \ - CMD(BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA, \ - cmd_read_local_oob_ext_data, NULL) - -static const struct btdev_cmd cmd_bredr_le[] = { -CMD_COMMON_ALL , -CMD_COMMON_BREDR_LE , -CMD_COMMON_BREDR_20 , -CMD_BREDR , -CMD_LE , -CMD_LE_50 , -CMD_LE_52 , -BT_BREDR_LE , - {} -}; -static void set_bredrle_commands (struct btdev *btdev) {set_bredr_commands (btdev);set_le_commands (btdev); - -/* Extra BR/EDR commands we want to only support for >= 4.0 -* adapters. -*/ - btdev->commands[22 ] |=0x04 ;/* Set Event Mask Page 2 */ - btdev->commands[31 ] |=0x80 ;/* Read Sync Train Parameters */ - btdev->commands[32 ] |=0x04 ;/* Read Secure Connections Support */ - btdev->commands[32 ] |=0x08 ;/* Write Secure Connections Support */ - btdev->commands[32 ] |=0x10 ;/* Read Auth Payload Timeout */ - btdev->commands[32 ] |=0x20 ;/* Write Auth Payload Timeout */ - btdev->commands[32 ] |=0x40 ;/* Read Local OOB Extended Data */ - btdev->cmds = cmd_bredr_le; }static void set_amp_commands (struct btdev *btdev)
Signature · 1 line
2.51.1
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=1023061
---Test result---
Test Summary:
CheckPatch PENDING 0.32 seconds GitLint PENDING 0.32 seconds BuildEll PASS 19.91 seconds BluezMake PASS 2632.97 seconds MakeCheck PASS 19.94 seconds MakeDistcheck PASS 185.32 seconds CheckValgrind PASS 237.67 seconds CheckSmatch WARNING 312.46 seconds bluezmakeextell PASS 128.61 seconds IncrementalBuild PENDING 0.30 seconds ScanBuild PASS 924.97 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:monitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1931:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3866:52: warning: array of flexible structuresmonitor/bt.h:3854:40: warning: array of flexible structuresemulator/btdev.c:461:29: warning: Variable length array is used.
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 53 lines · On Thu, 13 Nov 2025 10:58:17 -0500 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
This makes
print_features_subpageprint the page they belong:Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 253LE Read All Local Features (0x08|0x0087) ncmd 1 Status: Success (0x00) Page: 10 Features[0/0][8]: 403900f301000080 LL Privacy LE 2M PHY LE Coded PHY LE Extended Advertising LE Periodic Advertising Periodic Advertising Sync Transfer - Sender Periodic Advertising Sync Transfer - Recipient Connected Isochronous Stream - Central Connected Isochronous Stream - Peripheral Isochronous Broadcaster Synchronized Receiver Connected Isochronous Stream (Host Support) LL Extended Feature Set Features[1/0][8]: 0000000000000000 Features[1/1][8]: 0000000000000000 Features[1/2][8]: 0000000000000000 Features[2/0][8]: 0000000000000000 Features[2/1][8]: 0000000000000000 Features[2/2][8]: 0000000000000000 Features[3/0][8]: 0000000000000000 Features[3/1][8]: 0000000000000000 Features[3/2][8]: 0000000000000000 Features[4/0][8]: 0000000000000000 Features[4/1][8]: 0000000000000000 Features[4/2][8]: 0000000000000000 Features[5/0][8]: 0000000000000000 Features[5/1][8]: 0000000000000000 Features[5/2][8]: 0000000000000000 Features[6/0][8]: 0000000000000000 Features[6/1][8]: 0000000000000000 Features[6/2][8]: 0000000000000000 Features[7/0][8]: 0000000000000000 Features[7/1][8]: 0000000000000000 Features[7/2][8]: 0000000000000000 Features[8/0][8]: 0000000000000000 Features[8/1][8]: 0000000000000000 Features[8/2][8]: 0000000000000000 Features[9/0][8]: 0000000000000000 Features[9/1][8]: 0000000000000000 Features[9/2][8]: 0000000000000000 Features[10/0][8]: 0000000000000000 Features[10/1][8]: 0000000000000000 Features[10/2][8]: 0000000000000000
Quoted 1 line
[...]
Here is the summary with links:
- [BlueZ,v1,1/2] monitor: Add page information to print_features_subpage
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f67b72b4cc39 - [BlueZ,v1,2/2] btdev: Fix set_bredrle_commands https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4bf47f880d06
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html