Patchwork [Quantal,1/3] UBUNTU: SAUCE: Bluetooth: Add a load_firmware callback to struct hci_dev

login
register
mail settings
Submitter Jesse Sung
Date Oct. 24, 2012, 10:32 a.m.
Message ID <1351074776-5182-1-git-send-email-jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/193729/
State New
Headers show

Comments

Jesse Sung - Oct. 24, 2012, 10:32 a.m.
From: Wen-chien Jesse Sung <jesse.sung@canonical.com>

BugLink: https://launchpad.net/bugs/1065400

load_firmware will be called at the end of hci_dev_open() if it
is defined. How, when, and the mutual exclusion for firmware loading
is inplemented in device driver.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_core.c         |    2 ++
 2 files changed, 3 insertions(+)
Tim Gardner - Nov. 6, 2012, 2:28 p.m.

Herton Ronaldo Krzesinski - Nov. 6, 2012, 4:08 p.m.
Ack, looks the same which was agreed and went into Precise as well.
Tim Gardner - Nov. 6, 2012, 4:14 p.m.

Patch

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 9fc7728..c278d6a 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -282,6 +282,7 @@  struct hci_dev {
 	int (*send)(struct sk_buff *skb);
 	void (*notify)(struct hci_dev *hdev, unsigned int evt);
 	int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
+	void (*load_firmware)(struct hci_dev *hdev);
 };
 
 struct hci_conn {
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 730ff46..074a842 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -744,6 +744,8 @@  int hci_dev_open(__u16 dev)
 done:
 	hci_req_unlock(hdev);
 	hci_dev_put(hdev);
+	if (!ret && hdev->load_firmware)
+		hdev->load_firmware(hdev);
 	return ret;
 }