Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp859198pxk; Thu, 1 Oct 2020 16:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNyT4xan73nGKF184iLtQogj1ypNPgn154PWYStuLpfa/B5mFaNGJTfANFaa941uvqTo1T X-Received: by 2002:a17:906:441:: with SMTP id e1mr10197757eja.396.1601593477424; Thu, 01 Oct 2020 16:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601593477; cv=none; d=google.com; s=arc-20160816; b=tpnE4iumnp72KYn5wDi1YOWv8aWHGBtAzYu49RkzQfNle2TKH+HqshaKcxKHTKUukh OTbGiDmsUMJN1Qz7hcfPgmGUX7s/D+n7h5pyER2mmGpp3fDiYiEiYnVfp10LBWMC9MYo HVDnrj1ccceC4MZSIrQpWCUCqOBbPr2nCJWkAFSDFhIEC9GHFok++37X7wzPqBzmRJga CBVDGHBnnbzsVmluT+D8BQWC3ysK52B+f+5D+XJ/gjNn52cElQQacY5f21+cPXHWjyeQ JunDuuqlORF6K8Al3t1/H3I/AifSHPzE9mBHEr9kFqFqypA1pLt5dzO2PyMQsG3lR+lM UIfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=SYkjzmHFW92g1u0iAj/d9/R1oxk7yMhLalzdQrXLW6g=; b=GmQS2/l3mjawYG20sqdAQjSKtr0f5x8Xv2Bl4Ni2Rrqc9iF+5MjtSWrefGSfw/sSIy 4oW+tiYmYci9oR+DjWEYobhVruyPKUd1MBJ5NKSWVLxUQVolnYPcY56Q5Wo4zQeWz5ez SxlPdjTLvPt3JTgmVXfIebp58J4JG5OZ2v0HMJEu4+jaNVdkL3idVAwzPrJfhKfDqeil N1tvUB2SF7xv9rCMjfTqVW/74Po/TPbwEeHCegfmIfRD2iJuYmFy/8ZsoVRFqDtCIOnl ieU6CLdCtP5eiZYLVaUcews0u5nh4GjBjbO+plcKKp9gComiG5x2DL/LGubyQ+Zm2PNE ImtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iotYm0s3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si4503091ejb.225.2020.10.01.16.04.12; Thu, 01 Oct 2020 16:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iotYm0s3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727713AbgJAXEJ (ORCPT + 99 others); Thu, 1 Oct 2020 19:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbgJAXEI (ORCPT ); Thu, 1 Oct 2020 19:04:08 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98912C0613D0 for ; Thu, 1 Oct 2020 16:04:08 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id f9so2639241pjp.1 for ; Thu, 01 Oct 2020 16:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=SYkjzmHFW92g1u0iAj/d9/R1oxk7yMhLalzdQrXLW6g=; b=iotYm0s3V+JzsFWofE3lKyuM/DHCsQ9dJ7zW2qpHPzLNEJy5rqPTV2RhxquNhkLR6g nVWf7yStU6Z4j0Q5MMgw99hbFZPz8c0LcXTnvvGC45xd39i/KunaHmgiQsV7rJjlItSR Y/fihW2NOuK2qJPMj6Be3UTdNNhpEd1zoNGMD/bMd/3OiMaEWZZZQanMqqHGZowCma1X X97yg3YwuEgtvaC9wOhETEevyztu58TQMISZjFR4CrqdzibqlCN1zilgmRxm/U5Le8TM NkAbe7A/nwd1x69LIxS+lD8WjzH0JP6/frVJiCWROUukO600PVT0PLYY//y+KUL2mhhG 9cmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=SYkjzmHFW92g1u0iAj/d9/R1oxk7yMhLalzdQrXLW6g=; b=ULE/axyhqkq2z602aSp4DU/A5a6akBmp7pyEDTieelY42v1VaSdt1JDJXA2ukbRRPD G6H/j0bE+0TOJCoy91SakIP4rs9jAvEcDJFcU0mkzlfQZt2a03t46NkqzzF9iEvP0s9g kNmFGNWQR0WTqGBTAwAddg1K+wQ0DDzKNSa6uHRHFoW7t99sm5T1kPqMQCbZq/Wqxnz+ yOdCwC79SP3Snxgy2B9fsCWVAVFaoFs4syzilo+2sDFfvP33ysxmcLCd9zFa219XJPxX Y055AvyrTwbEtxcOHxKSl0Jdu9IwPLQX4PxxJVb3e90gXYjKB080qoCe4WL8GRUm81oW EUQw== X-Gm-Message-State: AOAM5337OtAHpVsRj+NrveJ6sJfoICphBRl8skFCLvGojzENi5pozArk CEOEXuzf0ykFo1wt2vh/wnTJw2sZau3Bbc4ja0OM Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:a65:42c2:: with SMTP id l2mr8310670pgp.61.1601593448059; Thu, 01 Oct 2020 16:04:08 -0700 (PDT) Date: Thu, 1 Oct 2020 16:03:58 -0700 Message-Id: <20201001230403.2445035-1-danielwinkler@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH v4 0/5] Bluetooth: Add new MGMT interface for advertising add From: Daniel Winkler To: marcel@holtmann.org Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Maintainers, This patch series defines the new two-call MGMT interface for adding new advertising instances. Similarly to the hci advertising commands, a mgmt call to set parameters is expected to be first, followed by a mgmt call to set advertising data/scan response. The members of the parameters request are optional; the caller defines a "params" bitfield in the structure that indicates which parameters were intentionally set, and others are set to defaults. The main feature here is the introduction of min/max parameters and tx power that can be requested by the client. Min/max parameters will be used both with and without extended advertising support, and tx power will be used with extended advertising support. After a call for hci advertising parameters, a new TX_POWER_SELECTED event will be emitted to alert userspace to the actual chosen tx power. Additionally, to inform userspace of the controller LE Tx power capabilities for the client's benefit, this series also changes the security info MGMT command to more flexibly contain other capabilities, such as LE min and max tx power. All changes have been tested on hatch (extended advertising) and kukui (no extended advertising) chromebooks with manual testing verifying correctness of parameters/data in btmon traces, and our automated test suite of 25 single- and multi-advertising usage scenarios. A separate patch series will add support in bluetoothd. Thanks in advance for your feedback! Daniel Winkler Changes in v4: - Add remaining data and scan response length to MGMT params response - Moving optional params into 'flags' field of MGMT command - Combine LE tx range into a single EIR field for MGMT capabilities cmd Changes in v3: - Adding selected tx power to adv params mgmt response, removing event - Re-using security info MGMT command to carry controller capabilities Changes in v2: - Fixed sparse error in Capabilities MGMT command Daniel Winkler (5): Bluetooth: Add helper to set adv data Bluetooth: Break add adv into two mgmt commands Bluetooth: Use intervals and tx power from mgmt cmds Bluetooth: Query LE tx power on startup Bluetooth: Change MGMT security info CMD to be more generic include/net/bluetooth/hci.h | 7 + include/net/bluetooth/hci_core.h | 12 +- include/net/bluetooth/mgmt.h | 49 +++- net/bluetooth/hci_core.c | 47 +++- net/bluetooth/hci_event.c | 19 ++ net/bluetooth/hci_request.c | 29 ++- net/bluetooth/mgmt.c | 424 +++++++++++++++++++++++++++++-- 7 files changed, 542 insertions(+), 45 deletions(-) -- 2.28.0.709.gb0816b6eb0-goog