All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lechner <david@lechnology.com>
To: devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org
Cc: David Lechner <david@lechnology.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Gustavo Padovan <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] bluetooth: hci_ll: add constant for vendor-specific command
Date: Sun,  3 Dec 2017 21:21:21 -0600	[thread overview]
Message-ID: <1512357682-8911-3-git-send-email-david@lechnology.com> (raw)
In-Reply-To: <1512357682-8911-1-git-send-email-david@lechnology.com>

This adds a #define for the vendor-specific HCI command to set the
baudrate instead of using the bare 0xff36 multiple times.

Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/bluetooth/hci_ll.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 447abea..974a788 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -56,6 +56,9 @@
 
 #include "hci_uart.h"
 
+/* Vendor-specific HCI commands */
+#define HCI_VS_UPDATE_UART_HCI_BAUDRATE		0xff36
+
 /* HCILL commands */
 #define HCILL_GO_TO_SLEEP_IND	0x30
 #define HCILL_GO_TO_SLEEP_ACK	0x31
@@ -620,7 +623,7 @@ static int download_firmware(struct ll_device *lldev)
 		case ACTION_SEND_COMMAND:	/* action send */
 			bt_dev_dbg(lldev->hu.hdev, "S");
 			cmd = (struct hci_command *)action_ptr;
-			if (cmd->opcode == 0xff36) {
+			if (cmd->opcode == HCI_VS_UPDATE_UART_HCI_BAUDRATE) {
 				/* ignore remote change
 				 * baud rate HCI VS command
 				 */
@@ -704,7 +707,10 @@ static int ll_setup(struct hci_uart *hu)
 		speed = 0;
 
 	if (speed) {
-		struct sk_buff *skb = __hci_cmd_sync(hu->hdev, 0xff36, sizeof(speed), &speed, HCI_INIT_TIMEOUT);
+		struct sk_buff *skb;
+
+		skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
+				     sizeof(speed), &speed, HCI_INIT_TIMEOUT);
 		if (!IS_ERR(skb)) {
 			kfree_skb(skb);
 			serdev_device_set_baudrate(serdev, speed);
-- 
2.7.4

  parent reply	other threads:[~2017-12-04  3:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04  3:21 [PATCH 0/3] bluetooth: hci_ll: Get MAC address from NVMEM David Lechner
2017-12-04  3:21 ` David Lechner
2017-12-04  3:21 ` [PATCH 1/3] dt-bindings: Add optional nvmem MAC address bindings to ti,wlink-st David Lechner
2017-12-04  6:50   ` Marcel Holtmann
2017-12-04  6:50     ` Marcel Holtmann
2017-12-04  9:54   ` Sergei Shtylyov
2017-12-04  9:54     ` Sergei Shtylyov
2017-12-04 10:09     ` Sergei Shtylyov
2017-12-04 10:09       ` Sergei Shtylyov
2017-12-04  3:21 ` David Lechner [this message]
2017-12-04  6:23   ` [PATCH 2/3] bluetooth: hci_ll: add constant for vendor-specific command Marcel Holtmann
2017-12-04  6:23     ` Marcel Holtmann
2017-12-07 21:29     ` David Lechner
2017-12-07 21:43       ` Marcel Holtmann
2017-12-04  3:21 ` [PATCH 3/3] bluetooth: hci_ll: Add optional nvmem MAC address source David Lechner
2017-12-04  6:48   ` Marcel Holtmann
2017-12-04  6:48     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512357682-8911-3-git-send-email-david@lechnology.com \
    --to=david@lechnology.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.