diff mbox series

[BlueZ,2/2] hciemu: Call btdev_receive_h4 unconditionally

Message ID 20230919162745.894828-2-arkadiusz.bokowy@gmail.com
State New
Headers show
Series [BlueZ,1/2] emulator: Skip new line when using util_debug | expand

Commit Message

Arkadiusz Bokowy Sept. 19, 2023, 4:27 p.m. UTC
Calling btdev_receive_h4 without prior logic will allow this function
to print some debug logs. E.g.: in case when the received packet type
is not supported.

> Bluetooth emulator ver 5.66
> vhci0: > ff 00 01 00                                      ....
> vhci0: Unsupported packet 0xff
---
 emulator/hciemu.c | 9 +--------
 emulator/vhci.c   | 9 +--------
 2 files changed, 2 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/emulator/hciemu.c b/emulator/hciemu.c
index 0b5847c27..25874ded5 100644
--- a/emulator/hciemu.c
+++ b/emulator/hciemu.c
@@ -190,14 +190,7 @@  static gboolean receive_btdev(GIOChannel *channel, GIOCondition condition,
 	if (len < 1)
 		return FALSE;
 
-	switch (buf[0]) {
-	case BT_H4_CMD_PKT:
-	case BT_H4_ACL_PKT:
-	case BT_H4_SCO_PKT:
-	case BT_H4_ISO_PKT:
-		btdev_receive_h4(btdev, buf, len);
-		break;
-	}
+	btdev_receive_h4(btdev, buf, len);
 
 	return TRUE;
 }
diff --git a/emulator/vhci.c b/emulator/vhci.c
index c6a5caa5e..7b363009a 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -74,14 +74,7 @@  static bool vhci_read_callback(struct io *io, void *user_data)
 	if (len < 1)
 		return false;
 
-	switch (buf[0]) {
-	case BT_H4_CMD_PKT:
-	case BT_H4_ACL_PKT:
-	case BT_H4_SCO_PKT:
-	case BT_H4_ISO_PKT:
-		btdev_receive_h4(vhci->btdev, buf, len);
-		break;
-	}
+	btdev_receive_h4(vhci->btdev, buf, len);
 
 	return true;
 }