From patchwork Thu Oct 11 10:52:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC, Precise, 1/2] UBUNTU: SAUCE: Bluetooth: Add a load_firmware callback to struct hci_dev Date: Thu, 11 Oct 2012 00:52:59 -0000 From: Jesse Sung X-Patchwork-Id: 190868 Message-Id: <1349952780-7793-2-git-send-email-jesse.sung@canonical.com> To: kernel-team@lists.ubuntu.com From: Wen-chien Jesse Sung 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 --- include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_core.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 3779ea3..8e86465 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -233,6 +233,7 @@ struct hci_dev { void (*destruct)(struct hci_dev *hdev); 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 857dc88..ac7b0ee 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -582,6 +582,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; }