All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH 1/3] emulator/btdev: Add missing commands
@ 2021-04-23 23:53 Tedd Ho-Jeong An
  2021-04-23 23:53 ` [BlueZ PATCH 2/3] tools/tester-runner: enable enhanced credit flow control mode Tedd Ho-Jeong An
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tedd Ho-Jeong An @ 2021-04-23 23:53 UTC (permalink / raw)
  To: linux-bluetooth

From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch adds missing commands HCI_Read_RSSI and
HCI_Read_Transmit_Power_Level commands.
---
 emulator/btdev.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index b4ed0e909..b21d5ca75 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -2013,6 +2013,24 @@ static int cmd_write_voice(struct btdev *dev, const void *data, uint8_t len)
 	return 0;
 }
 
+static int cmd_read_tx_power_level(struct btdev *dev, const void *data,
+				   uint8_t len)
+{
+	const struct bt_hci_cmd_read_tx_power *cmd = data;
+	struct bt_hci_rsp_read_tx_power rsp;
+
+	memset(&rsp, 0, sizeof(rsp));
+	rsp.handle = le16_to_cpu(cmd->handle);
+	rsp.status = BT_HCI_ERR_SUCCESS;
+	if (cmd->type)
+		rsp.level = 4;
+	else
+		rsp.level = -1;
+	cmd_complete(dev, BT_HCI_CMD_READ_TX_POWER, &rsp, sizeof(rsp));
+
+	return 0;
+}
+
 static int cmd_read_num_iac(struct btdev *dev, const void *data, uint8_t len)
 {
 	struct bt_hci_rsp_read_num_supported_iac rsp;
@@ -2182,6 +2200,21 @@ static int cmd_read_country_code(struct btdev *dev, const void *data,
 	return 0;
 }
 
+static int cmd_read_rssi(struct btdev *dev, const void *data,
+							uint8_t len)
+{
+	const struct bt_hci_cmd_read_rssi *cmd = data;
+	struct bt_hci_rsp_read_rssi rsp;
+
+	memset(&rsp, 0, sizeof(rsp));
+	rsp.status = BT_HCI_ERR_SUCCESS;
+	rsp.handle = le16_to_cpu(cmd->handle);
+	rsp.rssi = -1;
+	cmd_complete(dev, BT_HCI_CMD_READ_RSSI, &rsp, sizeof(rsp));
+
+	return 0;
+}
+
 static int cmd_enable_dut_mode(struct btdev *dev, const void *data,
 							uint8_t len)
 {
@@ -2259,6 +2292,7 @@ static int cmd_enable_dut_mode(struct btdev *dev, const void *data,
 	CMD(BT_HCI_CMD_WRITE_CLASS_OF_DEV, cmd_write_class, NULL), \
 	CMD(BT_HCI_CMD_READ_VOICE_SETTING, cmd_read_voice, NULL), \
 	CMD(BT_HCI_CMD_WRITE_VOICE_SETTING, cmd_write_voice, NULL), \
+	CMD(BT_HCI_CMD_READ_TX_POWER, cmd_read_tx_power_level, NULL), \
 	CMD(BT_HCI_CMD_READ_NUM_SUPPORTED_IAC, cmd_read_num_iac, NULL), \
 	CMD(BT_HCI_CMD_READ_CURRENT_IAC_LAP, cmd_read_current_iac_lap, \
 					NULL), \
@@ -2273,6 +2307,7 @@ static int cmd_enable_dut_mode(struct btdev *dev, const void *data,
 	CMD(BT_HCI_CMD_READ_LOCAL_EXT_FEATURES, cmd_read_local_ext_features, \
 					NULL), \
 	CMD(BT_HCI_CMD_READ_COUNTRY_CODE, cmd_read_country_code, NULL), \
+	CMD(BT_HCI_CMD_READ_RSSI, cmd_read_rssi, NULL), \
 	CMD(BT_HCI_CMD_ENABLE_DUT_MODE, cmd_enable_dut_mode, NULL)
 
 static void set_common_commands_bredr20(struct btdev *btdev)
@@ -2319,6 +2354,7 @@ static void set_common_commands_bredr20(struct btdev *btdev)
 	btdev->commands[9]  |= 0x02;	/* Write Class Of Device */
 	btdev->commands[9]  |= 0x04;	/* Read Voice Setting */
 	btdev->commands[9]  |= 0x08;	/* Write Voice Setting */
+	btdev->commands[10] |= 0x04;	/* Read TX Power Level */
 	btdev->commands[11] |= 0x04;	/* Read Number of Supported IAC */
 	btdev->commands[11] |= 0x08;	/* Read Current IAC LAP */
 	btdev->commands[11] |= 0x10;	/* Write Current IAC LAP */
@@ -2330,6 +2366,7 @@ static void set_common_commands_bredr20(struct btdev *btdev)
 	btdev->commands[13] |= 0x08;	/* Write AFH Assess Mode */
 	btdev->commands[14] |= 0x40;	/* Read Local Extended Features */
 	btdev->commands[15] |= 0x01;	/* Read Country Code */
+	btdev->commands[15] |= 0x20;	/* Read RSSI */
 	btdev->commands[16] |= 0x04;	/* Enable Device Under Test Mode */
 }
 
-- 
2.25.1


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

* [BlueZ PATCH 2/3] tools/tester-runner: enable enhanced credit flow control mode
  2021-04-23 23:53 [BlueZ PATCH 1/3] emulator/btdev: Add missing commands Tedd Ho-Jeong An
@ 2021-04-23 23:53 ` Tedd Ho-Jeong An
  2021-04-23 23:53 ` [BlueZ PATCH 3/3] tools/mgmt-tester: Fix to support emulator spec 5.2 Tedd Ho-Jeong An
  2021-04-24  1:33 ` [BlueZ,1/3] emulator/btdev: Add missing commands bluez.test.bot
  2 siblings, 0 replies; 5+ messages in thread
From: Tedd Ho-Jeong An @ 2021-04-23 23:53 UTC (permalink / raw)
  To: linux-bluetooth

From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch enables enhanced credit flow control mode for l2cap.
---
 tools/test-runner.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index a17ec594a..96de7034e 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -247,6 +247,7 @@ static void start_qemu(void)
 				"rootfstype=9p "
 				"rootflags=trans=virtio,version=9p2000.L "
 				"acpi=off pci=noacpi noapic quiet ro init=%s "
+				"bluetooth.enable_ecred=1"
 				"TESTHOME=%s TESTDBUS=%u TESTMONITOR=%u "
 				"TESTDEVS=%d TESTAUTO=%u TESTARGS=\'%s\'",
 				initcmd, cwd, start_dbus, start_monitor,
-- 
2.25.1


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

* [BlueZ PATCH 3/3] tools/mgmt-tester: Fix to support emulator spec 5.2
  2021-04-23 23:53 [BlueZ PATCH 1/3] emulator/btdev: Add missing commands Tedd Ho-Jeong An
  2021-04-23 23:53 ` [BlueZ PATCH 2/3] tools/tester-runner: enable enhanced credit flow control mode Tedd Ho-Jeong An
@ 2021-04-23 23:53 ` Tedd Ho-Jeong An
  2021-04-24  1:33 ` [BlueZ,1/3] emulator/btdev: Add missing commands bluez.test.bot
  2 siblings, 0 replies; 5+ messages in thread
From: Tedd Ho-Jeong An @ 2021-04-23 23:53 UTC (permalink / raw)
  To: linux-bluetooth

From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch updates the check for supported spec by the BT emulator to
support HCI spec 5.2
---
 tools/mgmt-tester.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index b05ae4f27..de35008ad 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -5552,7 +5552,7 @@ static void setup_bthost(void)
 
 	if (data->hciemu_type == HCIEMU_TYPE_LE ||
 		test->client_enable_adv) {
-		if (data->hciemu_type == HCIEMU_TYPE_BREDRLE50)
+		if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50)
 			bthost_set_ext_adv_enable(bthost, 0x01);
 		else
 			bthost_set_adv_enable(bthost, 0x01);
@@ -8887,7 +8887,7 @@ static void trigger_device_found(void *user_data)
 							test->adv_data_len);
 
 		bthost_set_adv_enable(bthost, 0x01);
-	} else if (data->hciemu_type == HCIEMU_TYPE_BREDRLE50) {
+	} else if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50) {
 		if (test->set_adv)
 			bthost_set_ext_adv_data(bthost, test->adv_data,
 							test->adv_data_len);
@@ -9054,7 +9054,7 @@ static void le_connected_event(uint16_t index, uint16_t length,
 
 	test_add_condition(data);
 
-	if (data->hciemu_type == HCIEMU_TYPE_BREDRLE50)
+	if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50)
 		hciemu_add_hook(data->hciemu, HCIEMU_HOOK_POST_CMD,
 					BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE,
 					test_adv_enable_hook, data);
@@ -9101,7 +9101,7 @@ static void add_device_callback(uint8_t status, uint16_t len, const void *param,
 	}
 
 	bthost = hciemu_client_get_host(data->hciemu);
-	if (data->hciemu_type == HCIEMU_TYPE_BREDRLE50)
+	if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50)
 		bthost_hci_ext_connect(bthost, master_bdaddr, BDADDR_LE_PUBLIC);
 	else
 		bthost_hci_connect(bthost, master_bdaddr, BDADDR_LE_PUBLIC);
-- 
2.25.1


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

* RE: [BlueZ,1/3] emulator/btdev: Add missing commands
  2021-04-23 23:53 [BlueZ PATCH 1/3] emulator/btdev: Add missing commands Tedd Ho-Jeong An
  2021-04-23 23:53 ` [BlueZ PATCH 2/3] tools/tester-runner: enable enhanced credit flow control mode Tedd Ho-Jeong An
  2021-04-23 23:53 ` [BlueZ PATCH 3/3] tools/mgmt-tester: Fix to support emulator spec 5.2 Tedd Ho-Jeong An
@ 2021-04-24  1:33 ` bluez.test.bot
  2021-04-26 17:01   ` Luiz Augusto von Dentz
  2 siblings, 1 reply; 5+ messages in thread
From: bluez.test.bot @ 2021-04-24  1:33 UTC (permalink / raw)
  To: linux-bluetooth, hj.tedd.an

[-- Attachment #1: Type: text/plain, Size: 2296 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=472555

---Test result---

Test Summary:
CheckPatch                    PASS      0.85 seconds
GitLint                       PASS      0.34 seconds
Prep - Setup ELL              PASS      47.31 seconds
Build - Prep                  PASS      0.14 seconds
Build - Configure             PASS      8.24 seconds
Build - Make                  PASS      201.85 seconds
Make Check                    PASS      8.79 seconds
Make Dist                     PASS      11.57 seconds
Make Dist - Configure         PASS      5.02 seconds
Make Dist - Make              PASS      82.43 seconds
Build w/ext ELL - Configure   PASS      8.09 seconds
Build w/ext ELL - Make        PASS      188.41 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Dist - PASS
Desc: Run 'make dist' and build the distribution tarball

##############################
Test: Make Dist - Configure - PASS
Desc: Configure the source from distribution tarball

##############################
Test: Make Dist - Make - PASS
Desc: Build the source from distribution tarball

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


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

* Re: [BlueZ,1/3] emulator/btdev: Add missing commands
  2021-04-24  1:33 ` [BlueZ,1/3] emulator/btdev: Add missing commands bluez.test.bot
@ 2021-04-26 17:01   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2021-04-26 17:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Tedd Ho-Jeong An

Hi Tedd,

On Fri, Apr 23, 2021 at 6:36 PM <bluez.test.bot@gmail.com> wrote:
>
> 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=472555
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.85 seconds
> GitLint                       PASS      0.34 seconds
> Prep - Setup ELL              PASS      47.31 seconds
> Build - Prep                  PASS      0.14 seconds
> Build - Configure             PASS      8.24 seconds
> Build - Make                  PASS      201.85 seconds
> Make Check                    PASS      8.79 seconds
> Make Dist                     PASS      11.57 seconds
> Make Dist - Configure         PASS      5.02 seconds
> Make Dist - Make              PASS      82.43 seconds
> Build w/ext ELL - Configure   PASS      8.09 seconds
> Build w/ext ELL - Make        PASS      188.41 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Dist - PASS
> Desc: Run 'make dist' and build the distribution tarball
>
> ##############################
> Test: Make Dist - Configure - PASS
> Desc: Configure the source from distribution tarball
>
> ##############################
> Test: Make Dist - Make - PASS
> Desc: Build the source from distribution tarball
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2021-04-26 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 23:53 [BlueZ PATCH 1/3] emulator/btdev: Add missing commands Tedd Ho-Jeong An
2021-04-23 23:53 ` [BlueZ PATCH 2/3] tools/tester-runner: enable enhanced credit flow control mode Tedd Ho-Jeong An
2021-04-23 23:53 ` [BlueZ PATCH 3/3] tools/mgmt-tester: Fix to support emulator spec 5.2 Tedd Ho-Jeong An
2021-04-24  1:33 ` [BlueZ,1/3] emulator/btdev: Add missing commands bluez.test.bot
2021-04-26 17:01   ` 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.