From patchwork Wed Apr 3 08:25:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen-chien Jesse Sung X-Patchwork-Id: 233303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 8CB332C0175 for ; Wed, 3 Apr 2013 19:27:19 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UNJ2E-0007Yt-Lb; Wed, 03 Apr 2013 08:27:10 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UNJ2B-0007Ya-Bu for kernel-team@lists.ubuntu.com; Wed, 03 Apr 2013 08:27:07 +0000 Received: from [112.104.99.227] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UNJ2A-0004H2-ON; Wed, 03 Apr 2013 08:27:07 +0000 From: Jesse Sung To: kernel-team@lists.ubuntu.com Subject: [Raring][PATCH 1/5] UBUNTU: SAUCE: Bluetooth: Add a load_firmware callback to struct hci_dev Date: Wed, 3 Apr 2013 16:25:22 +0800 Message-Id: <1364977526-29913-2-git-send-email-jesse.sung@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364977526-29913-1-git-send-email-jesse.sung@canonical.com> References: <1364977526-29913-1-git-send-email-jesse.sung@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@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 014a2ea..12dd4e3 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -288,6 +288,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); }; #define HCI_PHY_HANDLE(handle) (handle & 0xff) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 0f78e34..5ec456e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -777,6 +777,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; }