linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/2] test-micp: Fix endianess error
@ 2023-11-29 16:30 Luiz Augusto von Dentz
  2023-11-29 16:30 ` [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-11-29 16:30 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

On big endian the followin error can be observed:

MICP/CL/CGGIT/SER/BV-01-C - init
MICP/CL/CGGIT/SER/BV-01-C - setup
MICP/CL/CGGIT/SER/BV-01-C - setup complete
MICP/CL/CGGIT/SER/BV-01-C - run
micp_write_value handle: 3
**
ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
(memcmp(buf, iov->iov_base, len) == 0)
Bail out! ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
(memcmp(buf, iov->iov_base, len) == 0)
Aborted
---
 unit/test-micp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unit/test-micp.c b/unit/test-micp.c
index e2975c298ec5..a7fc7fb321bd 100644
--- a/unit/test-micp.c
+++ b/unit/test-micp.c
@@ -147,7 +147,7 @@ static void micp_write_value(struct bt_micp *micp, void *user_data)
 	struct bt_mics *mics = micp_get_mics(micp);
 	uint16_t	value_handle;
 	int ret;
-	const uint16_t value = 0x0001;
+	uint16_t value = cpu_to_le16(0x0001);
 
 	gatt_db_attribute_get_char_data(mics->ms, NULL, &value_handle,
 							NULL, NULL, NULL);
-- 
2.43.0


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

* [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors
  2023-11-29 16:30 [PATCH BlueZ v1 1/2] test-micp: Fix endianess error Luiz Augusto von Dentz
@ 2023-11-29 16:30 ` Luiz Augusto von Dentz
  2023-11-29 17:37 ` [BlueZ,v1,1/2] test-micp: Fix endianess error bluez.test.bot
  2023-11-29 22:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-11-29 16:30 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

On big endian the followin error can be observed:
VOCS/SR/SGGIT/CHA/BV-02-C - init
VOCS/SR/SGGIT/CHA/BV-02-C - setup
VOCS/SR/SGGIT/CHA/BV-02-C - setup complete
VOCS/SR/SGGIT/CHA/BV-02-C - run
**
ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
(memcmp(buf, iov->iov_base, len) == 0)
Bail out! ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
(memcmp(buf, iov->iov_base, len) == 0)
Aborted
---
 src/shared/vcp.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index 263da4c30c29..f2c04d184a08 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -714,7 +714,7 @@ static uint8_t vocs_set_vol_offset(struct bt_vocs *vocs, struct bt_vcp *vcp,
 		DBG(vcp, "error: Value Out of Range");
 		return BT_ATT_ERROR_VALUE_OUT_OF_RANGE;
 	}
-	vstate->vol_offset = req->set_vol_offset;
+	vstate->vol_offset = le16_to_cpu(req->set_vol_offset);
 	vstate->counter = -~vstate->counter; /*Increment Change Counter*/
 
 	gatt_db_attribute_notify(vdb->vocs->vos, (void *)vstate,
@@ -926,13 +926,13 @@ static void vocs_state_read(struct gatt_db_attribute *attrib,
 				void *user_data)
 {
 	struct bt_vocs *vocs = user_data;
-	struct iovec iov;
+	struct vol_offset_state state;
 
-	iov.iov_base = vocs->vostate;
-	iov.iov_len = sizeof(*vocs->vostate);
+	state.vol_offset = cpu_to_le16(vocs->vostate->vol_offset);
+	state.counter = vocs->vostate->counter;
 
-	gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base,
-							iov.iov_len);
+	gatt_db_attribute_read_result(attrib, id, 0, (void *)&state,
+					sizeof(state));
 }
 
 static void vcs_flag_read(struct gatt_db_attribute *attrib,
@@ -958,7 +958,7 @@ static void vocs_voal_read(struct gatt_db_attribute *attrib,
 	struct bt_vocs *vocs = user_data;
 	struct iovec iov;
 
-	iov.iov_base = &vocs->vocs_audio_loc;
+	iov.iov_base = &cpu_to_le32(vocs->vocs_audio_loc);
 	iov.iov_len = sizeof(vocs->vocs_audio_loc);
 
 	gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base,
@@ -1376,8 +1376,8 @@ static void read_vol_offset_state(struct bt_vcp *vcp, bool success,
 		return;
 	}
 
-	DBG(vcp, "Vol Set:%x", vos->vol_offset);
-	DBG(vcp, "Vol Counter:%x", vos->counter);
+	DBG(vcp, "Vol Offset: 0x%04x", le16_to_cpu(vos->vol_offset));
+	DBG(vcp, "Vol Counter: 0x%02x", vos->counter);
 }
 
 static void read_vocs_audio_location(struct bt_vcp *vcp, bool success,
@@ -1386,6 +1386,7 @@ static void read_vocs_audio_location(struct bt_vcp *vcp, bool success,
 				     void *user_data)
 {
 	uint32_t vocs_audio_loc;
+	struct iovec iov;
 
 	if (!value) {
 		DBG(vcp, "Unable to get VOCS Audio Location");
@@ -1398,9 +1399,15 @@ static void read_vocs_audio_location(struct bt_vcp *vcp, bool success,
 		return;
 	}
 
-	memcpy(&vocs_audio_loc, value, length);
+	iov.iov_base = (void *)value;
+	iov.iov_len = length;
 
-	DBG(vcp, "VOCS Audio Loc: %x", vocs_audio_loc);
+	if (!util_iov_pull_le32(&iov, &vocs_audio_loc)) {
+		DBG(vcp, "Invalid size for VOCS Audio Location");
+		return;
+	}
+
+	DBG(vcp, "VOCS Audio Loc: 0x%8x", vocs_audio_loc);
 }
 
 
-- 
2.43.0


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

* RE: [BlueZ,v1,1/2] test-micp: Fix endianess error
  2023-11-29 16:30 [PATCH BlueZ v1 1/2] test-micp: Fix endianess error Luiz Augusto von Dentz
  2023-11-29 16:30 ` [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors Luiz Augusto von Dentz
@ 2023-11-29 17:37 ` bluez.test.bot
  2023-11-29 22:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-11-29 17:37 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

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

---Test result---

Test Summary:
CheckPatch                    FAIL      1.04 seconds
GitLint                       PASS      0.57 seconds
BuildEll                      PASS      24.38 seconds
BluezMake                     PASS      558.67 seconds
MakeCheck                     PASS      10.92 seconds
MakeDistcheck                 PASS      151.97 seconds
CheckValgrind                 PASS      212.07 seconds
CheckSmatch                   PASS      319.44 seconds
bluezmakeextell               PASS      97.57 seconds
IncrementalBuild              PASS      1026.37 seconds
ScanBuild                     PASS      925.83 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v1,1/2] test-micp: Fix endianess error
WARNING:TYPO_SPELLING: 'endianess' may be misspelled - perhaps 'endianness'?
#57: 
Subject: [PATCH BlueZ v1 1/2] test-micp: Fix endianess error
                                             ^^^^^^^^^

/github/workspace/src/src/13473187.patch total: 0 errors, 1 warnings, 8 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13473187.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


[BlueZ,v1,2/2] shared/vcp: Fix endianess errors
WARNING:TYPO_SPELLING: 'endianess' may be misspelled - perhaps 'endianness'?
#59: 
Subject: [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors
                                              ^^^^^^^^^

/github/workspace/src/src/13473188.patch total: 0 errors, 1 warnings, 68 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13473188.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1 1/2] test-micp: Fix endianess error
  2023-11-29 16:30 [PATCH BlueZ v1 1/2] test-micp: Fix endianess error Luiz Augusto von Dentz
  2023-11-29 16:30 ` [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors Luiz Augusto von Dentz
  2023-11-29 17:37 ` [BlueZ,v1,1/2] test-micp: Fix endianess error bluez.test.bot
@ 2023-11-29 22:40 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2023-11-29 22:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 29 Nov 2023 11:30:39 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> On big endian the followin error can be observed:
> 
> MICP/CL/CGGIT/SER/BV-01-C - init
> MICP/CL/CGGIT/SER/BV-01-C - setup
> MICP/CL/CGGIT/SER/BV-01-C - setup complete
> MICP/CL/CGGIT/SER/BV-01-C - run
> micp_write_value handle: 3
> **
> ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
> (memcmp(buf, iov->iov_base, len) == 0)
> Bail out! ERROR:src/shared/tester.c:954:test_io_recv: assertion failed:
> (memcmp(buf, iov->iov_base, len) == 0)
> Aborted
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1,1/2] test-micp: Fix endianess error
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3a2d3b31a3b5
  - [BlueZ,v1,2/2] shared/vcp: Fix endianess errors
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4db4d5fa1c4f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-11-29 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 16:30 [PATCH BlueZ v1 1/2] test-micp: Fix endianess error Luiz Augusto von Dentz
2023-11-29 16:30 ` [PATCH BlueZ v1 2/2] shared/vcp: Fix endianess errors Luiz Augusto von Dentz
2023-11-29 17:37 ` [BlueZ,v1,1/2] test-micp: Fix endianess error bluez.test.bot
2023-11-29 22:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).