Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp388063ybt; Wed, 17 Jun 2020 03:43:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytPhlF1RnXtckFaGc+6PT1JZqJ50DlCSYf3nDXmDCa8qEKBkshisN3NM1gHExRbINT6+ud X-Received: by 2002:a17:907:217a:: with SMTP id rl26mr6766008ejb.209.1592390631789; Wed, 17 Jun 2020 03:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592390631; cv=none; d=google.com; s=arc-20160816; b=MG6W2TmwpXLLC7XG+wNVexBnTiW52WGW2pXHDP65aZXzZB+ZADkYxEm3er6obUO+xb 9PAKwksN4ctKyLJR1NHEn4w54twxGpI5urLvd6lOZG2Db36fjhsl/OAsrMzyXVTAsr2c +Fbew7RfIs3WhTzOfGPH6LGPb60PuECE8QkM0BrKp/wqdHGHTBY3z1zxSKstwZuyQVKP KVMZJ6PShQ0RZMylOJnLp/E2MkMDvoEJbzQ9zlm6AaV89swTU9M4IeqQZ/FClZ3kKxLR GIT9TXa1pOnILRwwafeNlLo5fQsGoCYULJg6ZWkmVD9m08SeYFSqaBi+ALZmUqXfVVk5 Aeqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=1kZLgOB7b8FjguAmn7bxR9KZxMwKJDftWgF1xYCklQc=; b=OuuMGhvXg2otHCsi+WmFltU1lJnPweyeAnzRRZPKku0XF7ylonx2k4SBfBVEYcNwVU B6IEKeLZiZJQAfVw17bHUfrkRcBR7BC2dEYm4QpyVfCS1tY2/cjOEqQnztal1mAcIKWN NJALrqAWt1PwDnoGpYlHZc80O+tfuQGMiZ3QegyG42xFLFYE4rXwCBHlsdrDqmxBSCx6 cGismdFDT5zQAV2kBz3nfQqnYpAOolsbYkc3//dhjSErkcvm3YwBne8JMAGEx/T88pfI TwoKddLhU2HwIAL873gP/MPfdl1gCkwxlJWExRo9wmpub+YXvfAyVUL0c1L0G94ZK3oC Iwxw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si12095075edq.440.2020.06.17.03.43.28; Wed, 17 Jun 2020 03:43:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgFQKmS (ORCPT + 99 others); Wed, 17 Jun 2020 06:42:18 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:52292 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbgFQKmN (ORCPT ); Wed, 17 Jun 2020 06:42:13 -0400 Received: from localhost.localdomain (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id 523FACECD8 for ; Wed, 17 Jun 2020 12:52:02 +0200 (CEST) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH 06/14] Bluetooth: Add definitions for advertisement monitor features Date: Wed, 17 Jun 2020 12:41:57 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Miao-chen Chou 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 Signed-off-by: Marcel Holtmann --- 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 8e47b0c5fe52..beae5c3980f0 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h @@ -741,6 +741,45 @@ struct mgmt_rp_set_device_flags { struct mgmt_addr_info addr; } __packed; +#define MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS BIT(0) + +#define MGMT_OP_READ_ADV_MONITOR_FEATURES 0x0051 +#define MGMT_READ_ADV_MONITOR_FEATURES_SIZE 0 +struct mgmt_rp_read_adv_monitor_features { + __le32 supported_features; + __le32 enabled_features; + __le16 max_num_handles; + __u8 max_num_patterns; + __le16 num_handles; + __le16 handles[]; +} __packed; + +struct mgmt_adv_pattern { + __u8 ad_type; + __u8 offset; + __u8 length; + __u8 value[31]; +} __packed; + +#define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x0052 +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 { + __le16 monitor_handle; +} __packed; + +#define MGMT_OP_REMOVE_ADV_MONITOR 0x0053 +struct mgmt_cp_remove_adv_monitor { + __le16 monitor_handle; +} __packed; +#define MGMT_REMOVE_ADV_MONITOR_SIZE 2 +struct mgmt_rp_remove_adv_monitor { + __le16 monitor_handle; +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { __le16 opcode; @@ -979,3 +1018,13 @@ struct mgmt_ev_device_flags_changed { __le32 supported_flags; __le32 current_flags; } __packed; + +#define MGMT_EV_ADV_MONITOR_ADDED 0x002b +struct mgmt_ev_adv_monitor_added { + __le16 monitor_handle; +} __packed; + +#define MGMT_EV_ADV_MONITOR_REMOVED 0x002c +struct mgmt_ev_adv_monitor_removed { + __le16 monitor_handle; +} __packed; -- 2.26.2