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: 134022 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1287394lji; Mon, 23 Apr 2018 10:59:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ste1z2d/uJJE5XhrxZIXBOCsXNPPv1VfuSQRZxaC+bNgFlAe0eqY601toj3y5WQtPuaxQ X-Received: by 10.99.112.70 with SMTP id a6mr17563237pgn.294.1524506386845; Mon, 23 Apr 2018 10:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524506386; cv=none; d=google.com; s=arc-20160816; b=0EDFYibobunHtxh0YS3hpUyN9LoKnojmk8Qpa7zQVXpdOhssT7hQM2BQnbr4g6aZxO L2C1XsIqBVPgdbA01Msa+IKnEr9y5gOKFds7yTcvY086JnWhngoS9xQt64T7J6lCUYyj xQ3IH50le4BqGa4iij0sm62BSVLUKbjcCuFmGtWOuhNoP5gFgUK8EvD5HzRjJSADkeiP Ah20e/o2nNi8uIgJJZMxPiSV5Hebsdn4WnpgLCkLUdIZwKnYhvrub+IubS59j/py45da 0JG2LoGupvI4Dbbw3BAaliK1avq7P9Hz8UkC6vrmbClHVBqJjmwTa0KZw3mtbhtDHqr0 j2nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WvOr5fBei3wFbXEi3hVlUQqWKsdQ+0iFPX5Z6pZ5iII=; b=bhUCQAaXY45t/dhbRTkQq7Vi1Wt2/7QTRcn4tTqNHzuxmd2TnkgSti9CcSiRPQnwak 8tbNCndrXrBjwPliV+alsom/TcZ3Rw+fjA3PTC9wcRxdR2FOqWnc49Sxo4IhOd0Db66m 4vZr++jT7lzpbald/wvS8VWGC78bkvIfftqbckLHAf7Z/mhIrNerKPjGXSHQotm9arPP Q1B8eEV0MgSaOUS3dBoKlUfuPS6FjAdX2cdO9AVlJrQmH2JeLa8DVFSNGjOfIHNBiUb/ QZxKCw7X4mrTeO11ZZjYFCw3jaNWmVPHgKfbGZ7Ubl3h+PL8a54PqWGF6PHVZmTt11/y oUpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z72gIEZG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8-v6si12591407plz.373.2018.04.23.10.59.46; Mon, 23 Apr 2018 10:59:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Z72gIEZG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221AbeDWR7p (ORCPT + 12 others); 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-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 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(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {