Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c30b93ea authored by David Lechner's avatar David Lechner Committed by Marcel Holtmann
Browse files

Bluetooth: hci_ll: Add endianness conversion when setting baudrate



This adds an endianness conversion when setting the baudrate using a
vendor-specific command. Otherwise, bad things might happen on a big-
endian system.

Suggested-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 7c6ca120
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -707,10 +707,12 @@ static int ll_setup(struct hci_uart *hu)
		speed = 0;

	if (speed) {
		__le32 speed_le = cpu_to_le32(speed);
		struct sk_buff *skb;

		skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
				     sizeof(speed), &speed, HCI_INIT_TIMEOUT);
				     sizeof(speed_le), &speed_le,
				     HCI_INIT_TIMEOUT);
		if (!IS_ERR(skb)) {
			kfree_skb(skb);
			serdev_device_set_baudrate(serdev, speed);