diff mbox series

[v2,1/7] Bluetooth: Add definitions for advertisement monitor features

Message ID 20200603160058.v2.1.I636f906bf8122855dfd2ba636352bbdcb50c35ed@changeid (mailing list archive)
State Superseded
Delegated to: Marcel Holtmann
Headers show
Series [v2,1/7] Bluetooth: Add definitions for advertisement monitor features | expand

Commit Message

Miao-chen Chou June 3, 2020, 11:01 p.m. UTC
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 <mcchou@chromium.org>
---

Changes in v2: None

 include/net/bluetooth/mgmt.h | 49 ++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Comments

Marcel Holtmann June 10, 2020, 5:57 p.m. UTC | #1
Hi Miao-chen,

> 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 <mcchou@chromium.org>
> ---
> 
> Changes in v2: None
> 
> include/net/bluetooth/mgmt.h | 49 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)

all 7 patches look good to me. I just need them be adjusted for the actual assigned command and event opcodes.

Regards

Marcel
Miao-chen Chou June 12, 2020, 6:19 a.m. UTC | #2
Hi Marcel,

Thanks for reviewing. Please see v3 for the update.
I am trying to settle down the name of Add Advertisement Pattern
Monitor command with Luiz on the other thread. I will post the update
here once it is sorted out.

Regards,
Miao

On Wed, Jun 10, 2020 at 10:57 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Miao-chen,
>
> > 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 <mcchou@chromium.org>
> > ---
> >
> > Changes in v2: None
> >
> > include/net/bluetooth/mgmt.h | 49 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 49 insertions(+)
>
> all 7 patches look good to me. I just need them be adjusted for the actual assigned command and event opcodes.
>
> Regards
>
> Marcel
>
Marcel Holtmann June 12, 2020, 1:21 p.m. UTC | #3
Hi Miao-chen,

> Thanks for reviewing. Please see v3 for the update.
> I am trying to settle down the name of Add Advertisement Pattern
> Monitor command with Luiz on the other thread. I will post the update
> here once it is sorted out.

I thought the name was just fine. Especially in the discussed context that we might add another “Add” command for future vendors, but keep a single “Remove” command.

Regards

Marcel
Miao-chen Chou June 12, 2020, 10:19 p.m. UTC | #4
Hi Marcel,

The name in the mgmt-api.txt doc is "Add Advertisement Patterns
Monitor Command", and Luiz changed the name from
MGMT_OP_ADD_ADV_PATTERNS_MONITOR to MGMT_OP_ADD_ADV_MONITOR before
applied. So we either change the doc or change the header file to
match. Based on the outcome I may need to change the name in mgmt.h in
the kernel patch.

Regards,
Miao

On Fri, Jun 12, 2020 at 6:21 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Miao-chen,
>
> > Thanks for reviewing. Please see v3 for the update.
> > I am trying to settle down the name of Add Advertisement Pattern
> > Monitor command with Luiz on the other thread. I will post the update
> > here once it is sorted out.
>
> I thought the name was just fine. Especially in the discussed context that we might add another “Add” command for future vendors, but keep a single “Remove” command.
>
> Regards
>
> Marcel
>
Marcel Holtmann June 13, 2020, 6:17 a.m. UTC | #5
Hi Miao-chen,

> The name in the mgmt-api.txt doc is "Add Advertisement Patterns
> Monitor Command", and Luiz changed the name from
> MGMT_OP_ADD_ADV_PATTERNS_MONITOR to MGMT_OP_ADD_ADV_MONITOR before
> applied. So we either change the doc or change the header file to
> match. Based on the outcome I may need to change the name in mgmt.h in
> the kernel patch.

we change the mgmt.h to match the documentation.

Regards

Marcel
Miao-chen Chou June 16, 2020, 5:59 a.m. UTC | #6
Hi Marcel,

https://patchwork.kernel.org/patch/11606491/ was uploaded for review.

Thanks,
Miao

On Fri, Jun 12, 2020 at 11:17 PM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Miao-chen,
>
> > The name in the mgmt-api.txt doc is "Add Advertisement Patterns
> > Monitor Command", and Luiz changed the name from
> > MGMT_OP_ADD_ADV_PATTERNS_MONITOR to MGMT_OP_ADD_ADV_MONITOR before
> > applied. So we either change the doc or change the header file to
> > match. Based on the outcome I may need to change the name in mgmt.h in
> > the kernel patch.
>
> we change the mgmt.h to match the documentation.
>
> Regards
>
> Marcel
>
diff mbox series

Patch

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;