Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3995974pxu; Mon, 30 Nov 2020 15:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvp4l5cORQf97SPuTgnZpWyxzZJLSS0R6KzeNA/fCN8jrgkJt4zpfrpFLdXUVUDk/PfPMi X-Received: by 2002:a17:907:720e:: with SMTP id dr14mr117977ejc.303.1606777989715; Mon, 30 Nov 2020 15:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606777989; cv=none; d=google.com; s=arc-20160816; b=BWf4gqwIy2tM36xfnYEAIsl7vGzjLXbeGC9M6dTkf2JZTuEAZm5lFnbob/gfWGk+ll RB+OVUrnHZh2P3fEiTs4kN59aNKb/PlSG3Gs1jM26t41/KiaMCdVbf/r+g8jQ6kQN8uy 6eh3c2wpGqz9wo5lYnJHqosipkyo4WwStowQF5APySI8K5l718p4dXR4lurdh9hFpROX B64eSeTFyY/8cJoD+hOY/zOaWbjnru38rGsmQeJosUxwL8M+vAWx4Dm2YARISsni9/iM 6QHaNeA21UPh8XCl7Ac9MByOlivM9Wzg824cGT1E0eDJ2071eiZ/L70IKKSxqAPWUkxT Ax0A== 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=Dy6XabYltzDFFz13ChKYqu9T0LvhtUKRAOX7IwyjQ7E=; b=LzciZdJnVI6W5Amu8IqQzFIU8cAxxPwwv82JjPsGBjoiUO/y6FCZrUvvv0cmGSphAe KTJrAlriXKVmmFSZJuBZsdWMQsAK2XYLTK5EV8qbNL4eE5tta7ixIef8JcB0bMRu3eJ8 548eETfKut/E0Tz0ZLRCpq6nPeFJE321GBhL9tV7LbxH3joCd74EQuOQNUp/XbIOTz4i jKGu+cvDETQm2kMfGNfVisa7X4prV1z1m2tMojmxi6HMjqM5AJga46x3t4p3dXWwtxcE B+wP9GEOvxEYiUq6TX9MCDACWrd1oknNZ+FTMVb4EHnIY2TNQ48GLepnCUvco558xZ+K kCbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dEc5VvYi; 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 u21si247741edx.350.2020.11.30.15.12.45; Mon, 30 Nov 2020 15:13:09 -0800 (PST) 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=dEc5VvYi; 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 S2388771AbgK3W6w (ORCPT + 99 others); Mon, 30 Nov 2020 17:58:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388705AbgK3W6w (ORCPT ); Mon, 30 Nov 2020 17:58:52 -0500 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5010AC061A48 for ; Mon, 30 Nov 2020 14:57:51 -0800 (PST) Received: by mail-qt1-x84a.google.com with SMTP id f29so7713459qtv.23 for ; Mon, 30 Nov 2020 14:57:51 -0800 (PST) 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=Dy6XabYltzDFFz13ChKYqu9T0LvhtUKRAOX7IwyjQ7E=; b=dEc5VvYi5t+NBouAT/ZIGYMPddy8e3Yra8lkPDcyvSZ55Ml9hS3zvkynvCqSstBTfM Bbc8CoLSfd0I9i/UpAZ9T9xUIvMpnEgKUsJbkSjDkAMC87QVrPDQ3vmgdQJrOzGE5iJe tIJXIiLdE6SL+tFD+GLUKW9lXLrCiHSR+cBHerY3jMbmQo06ynOSLzUJ83Lre4ni0DFx 4Dzh9c64K26+7KJmkmJmMWY92x2Gf9yJiFVynBYPXmAv+oresiLxFn4FVSjewzVW5kZN O3XhQ/DokyrqDpeJ67Nf2z8hIWxPfdJ3hHSAXwzCOqlRfdkdHWtUoxLHduAwENnj1t39 HdSg== 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=Dy6XabYltzDFFz13ChKYqu9T0LvhtUKRAOX7IwyjQ7E=; b=XlTMHXhc72e/Q+BS+QfjJG2v4fWEspoUJDmvc4UTSw+Y5Tc6JZDLJuigcZRz6Gdy+I Pmg5f3Oxe+dUDit+huBd0cYEIAQHiEARO/Y2jMso6biY0z3dVbXfHsTXfdOO7iNMDBsV iQuV0c8EPqzJeF2k1HvV+vLbvEnRlWHtkUuTozZPZccxhFCpRwFa7jNR/JqIW+ELqm8U 4gKMIUad0Co0Pnr1NEAxrDs5I13B41tt4j14+ZEq5XGLBRcwwGZThiU+txwsfBk8o6hJ QH5xM0207O5t58zTXDyoSK0AqDzaCICIY/mfKqnMrjlBbRBqz4CYCS62mR+9Ct408xKj 7bUQ== X-Gm-Message-State: AOAM532+Wof7+H/YQOdwGwNLnHnmGWw5AWJwNdCFDlPllEU0FL/zYNgN jkv44MvU1HL91FkXdq2up7AABZzvk6/fHdT8VVFU 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:a0c:be02:: with SMTP id k2mr25630951qvg.49.1606777070464; Mon, 30 Nov 2020 14:57:50 -0800 (PST) Date: Mon, 30 Nov 2020 14:57:39 -0800 Message-Id: <20201130225744.3793244-1-danielwinkler@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH v6 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 to set advertising parameters, the selected transmission power will be propagated in the reponse to alert userspace to the actual power used. 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 v6: - Only populate LE tx power range if controller reports it Changes in v5: - Ensure data/scan rsp length is returned for non-ext adv 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 | 430 +++++++++++++++++++++++++++++-- 7 files changed, 548 insertions(+), 45 deletions(-) -- 2.29.2.454.gaff20da3a2-goog