From patchwork Mon Apr 23 17:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10357901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30A6860209 for ; Mon, 23 Apr 2018 17:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21E9B28BF6 for ; Mon, 23 Apr 2018 17:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15F5028BF5; Mon, 23 Apr 2018 17:59:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86B1F28BF1 for ; Mon, 23 Apr 2018 17:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221AbeDWR7p (ORCPT ); Mon, 23 Apr 2018 13:59:45 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34884 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148AbeDWR7o (ORCPT ); Mon, 23 Apr 2018 13:59:44 -0400 Received: by mail-wr0-f194.google.com with SMTP id w3-v6so43683814wrg.2 for ; Mon, 23 Apr 2018 10:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0LUuHzytuNBwLAcEJjEA+xVBKzJ/Pv/x6YrfevpMyis=; b=Z72gIEZGTcIB2gewZesQllx5/Wdy9YGRc30bpXrx5hcUMG5aoRAQeBysb/vV90x0Yb wDjD0GgOgyo2/RDrYor12OpzTF7DnjpbZjEUKUfZVkn/y0jMBJWCs00h6KGOP3owgIiQ 5bbd4cllH3JovxACT4znHD8IDuIi8AMVd4Ulw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0LUuHzytuNBwLAcEJjEA+xVBKzJ/Pv/x6YrfevpMyis=; b=pf0qtgASeF3GgHErpD46tvJw2gcUo47Fm6dv5YVjGSaufctXwQsMcmc5B+4eud3OMZ oE0klHJq8YkfTbOvR5WyfQkORig1n4l/TVTZCju4stLtnomfys+ec8CUTKVxLOzgug2B vSJDeJDZXKW+TcZi218zMvNOD278G3nY9xkTmFE02tnbyQBDWAbaejwCUwl4PBrhuK2P uJa05014Y/wRyPx2814oHcQSNjI1wn3hcaO/byplm7WDffiBv0Edi++MajjmAd7s2X3G /7aR0mm+hqRgk8NrUrxEnriwnZ8ktCfKAUVhbUgYmOdllM/mJ46gj7BfgXpf8K7Kd3aV gz2g== X-Gm-Message-State: ALQs6tC7vbp69bXxJEKHMz1eQvaAaIibwJ3dbpdC6gTZEheyg2ceMV8Y HB3ekQVpddpg22Yx9U0S9DlMPQ== X-Google-Smtp-Source: AIpwx4/px5oBIeUFg9M5MjhFa58wPqvr0gikHQ/3xM0CsHJW/NXiaJrgUi6fNnTNPqrjCuiO1QzLiA== X-Received: by 10.28.45.9 with SMTP id t9mr10091389wmt.161.1524506383431; Mon, 23 Apr 2018 10:59:43 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home ([2a01:cb19:8349:a800:146c:6b52:c2d0:e9e7]) by smtp.gmail.com with ESMTPSA id o133sm8005139wmo.15.2018.04.23.10.59.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Apr 2018 10:59:42 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org Cc: linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, kkapra@codeaurora.org, Loic Poulain Subject: [PATCH 1/2] Bluetooth: Add __hci_cmd_sync_noev function Date: Mon, 23 Apr 2018 19:59:39 +0200 Message-Id: <1524506380-7417-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function allows to send a HCI command without expecting any controller event/response in return. Signed-off-by: Loic Poulain --- 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) {