linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Add __hci_cmd_sync_noev function
@ 2018-04-23 17:59 Loic Poulain
  2018-04-23 17:59 ` [PATCH 2/2] Bluetooth: btqca: Add AR3002 rampatch support Loic Poulain
  2018-04-24 15:10 ` [PATCH 1/2] Bluetooth: Add __hci_cmd_sync_noev function Marcel Holtmann
  0 siblings, 2 replies; 12+ messages in thread
From: Loic Poulain @ 2018-04-23 17:59 UTC (permalink / raw)
  To: marcel; +Cc: linux-bluetooth, linux-arm-msm, kkapra, Loic Poulain

This function allows to send a HCI command without expecting any
controller event/response in return.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 include/net/bluetooth/hci_core.h |  2 ++
 net/bluetooth/hci_core.c         | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index b619a19..d48a7df 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1393,6 +1393,8 @@ struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
 			       const void *param, u32 timeout);
 struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
 				  const void *param, u8 event, u32 timeout);
+int __hci_cmd_sync_noev(struct hci_dev *hdev, u16 opcode, u32 plen,
+			const void *param);
 
 int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen,
 		 const void *param);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 40d260f..2831c4e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3459,6 +3459,23 @@ struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
 }
 EXPORT_SYMBOL(hci_cmd_sync);
 
+int __hci_cmd_sync_noev(struct hci_dev *hdev, u16 opcode, u32 plen,
+			const void *param)
+{
+	struct sk_buff *skb = hci_prepare_cmd(hdev, opcode, plen, param);
+
+	if (!skb) {
+		bt_dev_err(hdev, "no memory for command (opcode 0x%4.4x)",
+			   opcode);
+		return -ENOMEM;
+	}
+
+	hci_send_frame(hdev, skb);
+
+	return 0;
+}
+EXPORT_SYMBOL(__hci_cmd_sync_noev);
+
 /* Send ACL data */
 static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags)
 {
-- 
2.7.4

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

end of thread, other threads:[~2018-04-26  6:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 17:59 [PATCH 1/2] Bluetooth: Add __hci_cmd_sync_noev function Loic Poulain
2018-04-23 17:59 ` [PATCH 2/2] Bluetooth: btqca: Add AR3002 rampatch support Loic Poulain
2018-04-24 15:13   ` Marcel Holtmann
2018-04-25  7:58     ` Loic Poulain
2018-04-25 12:16       ` bgodavar
2018-04-25 13:37         ` Loic Poulain
2018-04-25 15:19           ` bgodavar
2018-04-26  6:52             ` Loic Poulain
2018-04-24 15:10 ` [PATCH 1/2] Bluetooth: Add __hci_cmd_sync_noev function Marcel Holtmann
2018-04-25 10:00   ` Loic Poulain
2018-04-25 12:10     ` Marcel Holtmann
2018-04-25 13:34       ` Loic Poulain

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).