From patchwork Wed Jun 3 23:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao-chen Chou X-Patchwork-Id: 11586605 X-Patchwork-Delegate: marcel@holtmann.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9253E92A for ; Wed, 3 Jun 2020 23:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A7D12225F for ; Wed, 3 Jun 2020 23:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ElHgxlfy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbgFCXDV (ORCPT ); Wed, 3 Jun 2020 19:03:21 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40024 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgFCXDU (ORCPT ); Wed, 3 Jun 2020 19:03:20 -0400 Received: by mail-pg1-f195.google.com with SMTP id o8so2625311pgm.7 for ; Wed, 03 Jun 2020 16:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ez/bvlepDduVIxHglwNwBFWJmOXjR008iaFnpJzBvrU=; b=ElHgxlfyjmI7NpucOINNAzsvZ5SNoxnKGKnesGMsgq+IQV/BDLWGnfmdpJzmimiXXu ZvbjRqNFBCupDLSbotVaavThprfaI9hOeZQFEefs91YYMupST4hZ86HLrYoqd/Wi7Brt HKq8EBzLAbHemO26c3THGoxqcIuMiXxhsmFMk= 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:mime-version :content-transfer-encoding; bh=ez/bvlepDduVIxHglwNwBFWJmOXjR008iaFnpJzBvrU=; b=VW19QaVrVqBX7VccyLcvJROc6DqFXZHH7l1LYtSvvyZblV2CeB/p6wuf6FyElMxZVu mGIZwom0gRhJKv6l77j9bIqQoFGYGqfEk2ABzJbhMx0yPiWaNqMdMoA8UViXUYK16sNK jPyA3HanidVlbaDc7MbMFQ1N4b/2o638Cp45+5L755dvk28pt1dgbnABc6eG2WFt/wpe v0/wt93fsfSqTcSF/vynciKjOfusHEXlArNwqLtb2sf7sp7L5NYG3LAlKw7s1SIUgJqE XHrue8kjRK/qx0WU08w/WyX5KALz+lTtbnG1+Ugfl2F2Z0Ra8NQ9a7gvOb25rdWQ6Zaw Zzzw== X-Gm-Message-State: AOAM532kvyf9Q60umDPSMQA28Txo9bXWhi3ZLnUYZf3yvIHH5opkXxue Q5ri1vLQPKHGfSEAgtDVg+zyet7KEH8= X-Google-Smtp-Source: ABdhPJzXfRYYgZFvZFZg1PG4JNnOp9p91vozXqd+fMmZBzV1SkYLmbUgwhnlA3AHb8tArt7NlPxYOg== X-Received: by 2002:a65:5206:: with SMTP id o6mr1568522pgp.16.1591225332425; Wed, 03 Jun 2020 16:02:12 -0700 (PDT) Received: from mcchou0.mtv.corp.google.com ([2620:15c:202:201:b46:ac84:1014:9555]) by smtp.gmail.com with ESMTPSA id b11sm2715999pfd.178.2020.06.03.16.02.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2020 16:02:11 -0700 (PDT) From: Miao-chen Chou To: Bluetooth Kernel Mailing List Cc: Alain Michaud , Luiz Augusto von Dentz , Manish Mandlik , Michael Sun , Marcel Holtmann , Yoni Shavit , Miao-chen Chou , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 1/7] Bluetooth: Add definitions for advertisement monitor features Date: Wed, 3 Jun 2020 16:01:44 -0700 Message-Id: <20200603160058.v2.1.I636f906bf8122855dfd2ba636352bbdcb50c35ed@changeid> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds support for Advertisement Monitor API. Here are the commands and events added. - Read Advertisement Monitor Feature command - Add Advertisement Pattern Monitor command - Remove Advertisement Monitor command - Advertisement Monitor Added event - Advertisement Monitor Removed event Signed-off-by: Miao-chen Chou --- Changes in v2: None include/net/bluetooth/mgmt.h | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 16e0d87bd8fae..df36c50d15f53 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h @@ -702,6 +702,45 @@ struct mgmt_rp_set_exp_feature { __le32 flags; } __packed; +#define MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS BIT(0) + +#define MGMT_OP_READ_ADV_MONITOR_FEATURES 0x004B +#define MGMT_READ_ADV_MONITOR_FEATURES_SIZE 0 +struct mgmt_rp_read_adv_monitor_features { + __u32 supported_features; + __u32 enabled_features; + __u16 max_num_handles; + __u8 max_num_patterns; + __u16 num_handles; + __u16 handles[]; +} __packed; + +struct mgmt_adv_pattern { + __u8 ad_type; + __u8 offset; + __u8 length; + __u8 value[31]; +} __packed; + +#define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x004C +struct mgmt_cp_add_adv_patterns_monitor { + __u8 pattern_count; + struct mgmt_adv_pattern patterns[]; +} __packed; +#define MGMT_ADD_ADV_PATTERNS_MONITOR_SIZE 1 +struct mgmt_rp_add_adv_patterns_monitor { + __u16 monitor_handle; +} __packed; + +#define MGMT_OP_REMOVE_ADV_MONITOR 0x004D +struct mgmt_cp_remove_adv_monitor { + __u16 monitor_handle; +} __packed; +#define MGMT_REMOVE_ADV_MONITOR_SIZE 2 +struct mgmt_rp_remove_adv_monitor { + __u16 monitor_handle; +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { __le16 opcode; @@ -933,3 +972,13 @@ struct mgmt_ev_exp_feature_changed { __u8 uuid[16]; __le32 flags; } __packed; + +#define MGMT_EV_ADV_MONITOR_ADDED 0x0028 +struct mgmt_ev_adv_monitor_added { + __u16 monitor_handle; +} __packed; + +#define MGMT_EV_ADV_MONITOR_REMOVED 0x0029 +struct mgmt_ev_adv_monitor_removed { + __u16 monitor_handle; +} __packed;