diff mbox series

[Bluez,v3,1/3] mgmt: Add controller suspend and resume events

Message ID 20200828180157.Bluez.v3.1.I14a96397d181666c124e1c413b834428faf3db7a@changeid (mailing list archive)
State Accepted
Headers show
Series adapter: Reconnect audio when resuming from suspend | expand

Commit Message

Abhishek Pandit-Subedi Aug. 29, 2020, 1:02 a.m. UTC
Add the controller suspend and resume events.

Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
---

Changes in v3: None
Changes in v2: None

 lib/mgmt.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Luiz Augusto von Dentz Aug. 31, 2020, 5:36 p.m. UTC | #1
Hi Abhishek,

On Fri, Aug 28, 2020 at 6:02 PM Abhishek Pandit-Subedi
<abhishekpandit@chromium.org> wrote:
>
> Add the controller suspend and resume events.
>
> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  lib/mgmt.h | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/lib/mgmt.h b/lib/mgmt.h
> index a800bcab4..46d894ae9 100644
> --- a/lib/mgmt.h
> +++ b/lib/mgmt.h
> @@ -772,6 +772,7 @@ struct mgmt_ev_device_connected {
>  #define MGMT_DEV_DISCONN_TIMEOUT       0x01
>  #define MGMT_DEV_DISCONN_LOCAL_HOST    0x02
>  #define MGMT_DEV_DISCONN_REMOTE                0x03
> +#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND    0x05
>
>  #define MGMT_EV_DEVICE_DISCONNECTED    0x000C
>  struct mgmt_ev_device_disconnected {
> @@ -959,6 +960,17 @@ struct mgmt_ev_adv_monitor_removed {
>         uint16_t monitor_handle;
>  }  __packed;
>
> +#define MGMT_EV_CONTROLLER_SUSPEND             0x002d
> +struct mgmt_ev_controller_suspend {
> +       uint8_t suspend_state;
> +} __packed;
> +
> +#define MGMT_EV_CONTROLLER_RESUME              0x002e
> +struct mgmt_ev_controller_resume {
> +       struct mgmt_addr_info addr;
> +       uint8_t wake_reason;
> +} __packed;
> +
>  static const char *mgmt_op[] = {
>         "<0x0000>",
>         "Read Version",
> @@ -1088,6 +1100,8 @@ static const char *mgmt_ev[] = {
>         "Device Flags Changed",
>         "Advertisement Monitor Added",                  /* 0x002b */
>         "Advertisement Monitor Removed",
> +       "Controller Suspend",
> +       "Controller Resume",
>  };
>
>  static const char *mgmt_status[] = {
> --
> 2.28.0.402.g5ffc5be6b7-goog

Patches 1 and 2 of this series were applied, thanks.
Abhishek Pandit-Subedi Aug. 31, 2020, 6:28 p.m. UTC | #2
Hi Luiz,

Could you also merge https://patchwork.kernel.org/patch/11663455/ that
adds this to docs/mgmt-api.txt?

Thanks
Abhishek

On Mon, Aug 31, 2020 at 10:36 AM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Abhishek,
>
> On Fri, Aug 28, 2020 at 6:02 PM Abhishek Pandit-Subedi
> <abhishekpandit@chromium.org> wrote:
> >
> > Add the controller suspend and resume events.
> >
> > Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
> > ---
> >
> > Changes in v3: None
> > Changes in v2: None
> >
> >  lib/mgmt.h | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/lib/mgmt.h b/lib/mgmt.h
> > index a800bcab4..46d894ae9 100644
> > --- a/lib/mgmt.h
> > +++ b/lib/mgmt.h
> > @@ -772,6 +772,7 @@ struct mgmt_ev_device_connected {
> >  #define MGMT_DEV_DISCONN_TIMEOUT       0x01
> >  #define MGMT_DEV_DISCONN_LOCAL_HOST    0x02
> >  #define MGMT_DEV_DISCONN_REMOTE                0x03
> > +#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND    0x05
> >
> >  #define MGMT_EV_DEVICE_DISCONNECTED    0x000C
> >  struct mgmt_ev_device_disconnected {
> > @@ -959,6 +960,17 @@ struct mgmt_ev_adv_monitor_removed {
> >         uint16_t monitor_handle;
> >  }  __packed;
> >
> > +#define MGMT_EV_CONTROLLER_SUSPEND             0x002d
> > +struct mgmt_ev_controller_suspend {
> > +       uint8_t suspend_state;
> > +} __packed;
> > +
> > +#define MGMT_EV_CONTROLLER_RESUME              0x002e
> > +struct mgmt_ev_controller_resume {
> > +       struct mgmt_addr_info addr;
> > +       uint8_t wake_reason;
> > +} __packed;
> > +
> >  static const char *mgmt_op[] = {
> >         "<0x0000>",
> >         "Read Version",
> > @@ -1088,6 +1100,8 @@ static const char *mgmt_ev[] = {
> >         "Device Flags Changed",
> >         "Advertisement Monitor Added",                  /* 0x002b */
> >         "Advertisement Monitor Removed",
> > +       "Controller Suspend",
> > +       "Controller Resume",
> >  };
> >
> >  static const char *mgmt_status[] = {
> > --
> > 2.28.0.402.g5ffc5be6b7-goog
>
> Patches 1 and 2 of this series were applied, thanks.
>
> --
> Luiz Augusto von Dentz
Luiz Augusto von Dentz Aug. 31, 2020, 8:34 p.m. UTC | #3
Hi Abhishek,

On Mon, Aug 31, 2020 at 11:28 AM Abhishek Pandit-Subedi
<abhishekpandit@chromium.org> wrote:
>
> Hi Luiz,
>
> Could you also merge https://patchwork.kernel.org/patch/11663455/ that
> adds this to docs/mgmt-api.txt?

Looks like Marcel had reviewed but decided to hold on until the kernel
parts are applied, have that been resolved?

> Thanks
> Abhishek
>
> On Mon, Aug 31, 2020 at 10:36 AM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > Hi Abhishek,
> >
> > On Fri, Aug 28, 2020 at 6:02 PM Abhishek Pandit-Subedi
> > <abhishekpandit@chromium.org> wrote:
> > >
> > > Add the controller suspend and resume events.
> > >
> > > Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
> > > ---
> > >
> > > Changes in v3: None
> > > Changes in v2: None
> > >
> > >  lib/mgmt.h | 14 ++++++++++++++
> > >  1 file changed, 14 insertions(+)
> > >
> > > diff --git a/lib/mgmt.h b/lib/mgmt.h
> > > index a800bcab4..46d894ae9 100644
> > > --- a/lib/mgmt.h
> > > +++ b/lib/mgmt.h
> > > @@ -772,6 +772,7 @@ struct mgmt_ev_device_connected {
> > >  #define MGMT_DEV_DISCONN_TIMEOUT       0x01
> > >  #define MGMT_DEV_DISCONN_LOCAL_HOST    0x02
> > >  #define MGMT_DEV_DISCONN_REMOTE                0x03
> > > +#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND    0x05
> > >
> > >  #define MGMT_EV_DEVICE_DISCONNECTED    0x000C
> > >  struct mgmt_ev_device_disconnected {
> > > @@ -959,6 +960,17 @@ struct mgmt_ev_adv_monitor_removed {
> > >         uint16_t monitor_handle;
> > >  }  __packed;
> > >
> > > +#define MGMT_EV_CONTROLLER_SUSPEND             0x002d
> > > +struct mgmt_ev_controller_suspend {
> > > +       uint8_t suspend_state;
> > > +} __packed;
> > > +
> > > +#define MGMT_EV_CONTROLLER_RESUME              0x002e
> > > +struct mgmt_ev_controller_resume {
> > > +       struct mgmt_addr_info addr;
> > > +       uint8_t wake_reason;
> > > +} __packed;
> > > +
> > >  static const char *mgmt_op[] = {
> > >         "<0x0000>",
> > >         "Read Version",
> > > @@ -1088,6 +1100,8 @@ static const char *mgmt_ev[] = {
> > >         "Device Flags Changed",
> > >         "Advertisement Monitor Added",                  /* 0x002b */
> > >         "Advertisement Monitor Removed",
> > > +       "Controller Suspend",
> > > +       "Controller Resume",
> > >  };
> > >
> > >  static const char *mgmt_status[] = {
> > > --
> > > 2.28.0.402.g5ffc5be6b7-goog
> >
> > Patches 1 and 2 of this series were applied, thanks.
> >
> > --
> > Luiz Augusto von Dentz
Abhishek Pandit-Subedi Aug. 31, 2020, 8:56 p.m. UTC | #4
They have not. The changes are still pending review at
https://patchwork.kernel.org/project/bluetooth/list/?series=325771.

If you'd like to wait for Marcel, let's revert these two patches and
land the whole series as one.

Thanks
Abhishek

On Mon, Aug 31, 2020 at 1:34 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Abhishek,
>
> On Mon, Aug 31, 2020 at 11:28 AM Abhishek Pandit-Subedi
> <abhishekpandit@chromium.org> wrote:
> >
> > Hi Luiz,
> >
> > Could you also merge https://patchwork.kernel.org/patch/11663455/ that
> > adds this to docs/mgmt-api.txt?
>
> Looks like Marcel had reviewed but decided to hold on until the kernel
> parts are applied, have that been resolved?
>
> > Thanks
> > Abhishek
> >
> > On Mon, Aug 31, 2020 at 10:36 AM Luiz Augusto von Dentz
> > <luiz.dentz@gmail.com> wrote:
> > >
> > > Hi Abhishek,
> > >
> > > On Fri, Aug 28, 2020 at 6:02 PM Abhishek Pandit-Subedi
> > > <abhishekpandit@chromium.org> wrote:
> > > >
> > > > Add the controller suspend and resume events.
> > > >
> > > > Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
> > > > ---
> > > >
> > > > Changes in v3: None
> > > > Changes in v2: None
> > > >
> > > >  lib/mgmt.h | 14 ++++++++++++++
> > > >  1 file changed, 14 insertions(+)
> > > >
> > > > diff --git a/lib/mgmt.h b/lib/mgmt.h
> > > > index a800bcab4..46d894ae9 100644
> > > > --- a/lib/mgmt.h
> > > > +++ b/lib/mgmt.h
> > > > @@ -772,6 +772,7 @@ struct mgmt_ev_device_connected {
> > > >  #define MGMT_DEV_DISCONN_TIMEOUT       0x01
> > > >  #define MGMT_DEV_DISCONN_LOCAL_HOST    0x02
> > > >  #define MGMT_DEV_DISCONN_REMOTE                0x03
> > > > +#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND    0x05
> > > >
> > > >  #define MGMT_EV_DEVICE_DISCONNECTED    0x000C
> > > >  struct mgmt_ev_device_disconnected {
> > > > @@ -959,6 +960,17 @@ struct mgmt_ev_adv_monitor_removed {
> > > >         uint16_t monitor_handle;
> > > >  }  __packed;
> > > >
> > > > +#define MGMT_EV_CONTROLLER_SUSPEND             0x002d
> > > > +struct mgmt_ev_controller_suspend {
> > > > +       uint8_t suspend_state;
> > > > +} __packed;
> > > > +
> > > > +#define MGMT_EV_CONTROLLER_RESUME              0x002e
> > > > +struct mgmt_ev_controller_resume {
> > > > +       struct mgmt_addr_info addr;
> > > > +       uint8_t wake_reason;
> > > > +} __packed;
> > > > +
> > > >  static const char *mgmt_op[] = {
> > > >         "<0x0000>",
> > > >         "Read Version",
> > > > @@ -1088,6 +1100,8 @@ static const char *mgmt_ev[] = {
> > > >         "Device Flags Changed",
> > > >         "Advertisement Monitor Added",                  /* 0x002b */
> > > >         "Advertisement Monitor Removed",
> > > > +       "Controller Suspend",
> > > > +       "Controller Resume",
> > > >  };
> > > >
> > > >  static const char *mgmt_status[] = {
> > > > --
> > > > 2.28.0.402.g5ffc5be6b7-goog
> > >
> > > Patches 1 and 2 of this series were applied, thanks.
> > >
> > > --
> > > Luiz Augusto von Dentz
>
>
>
> --
> Luiz Augusto von Dentz
diff mbox series

Patch

diff --git a/lib/mgmt.h b/lib/mgmt.h
index a800bcab4..46d894ae9 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -772,6 +772,7 @@  struct mgmt_ev_device_connected {
 #define MGMT_DEV_DISCONN_TIMEOUT	0x01
 #define MGMT_DEV_DISCONN_LOCAL_HOST	0x02
 #define MGMT_DEV_DISCONN_REMOTE		0x03
+#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND	0x05
 
 #define MGMT_EV_DEVICE_DISCONNECTED	0x000C
 struct mgmt_ev_device_disconnected {
@@ -959,6 +960,17 @@  struct mgmt_ev_adv_monitor_removed {
 	uint16_t monitor_handle;
 }  __packed;
 
+#define MGMT_EV_CONTROLLER_SUSPEND		0x002d
+struct mgmt_ev_controller_suspend {
+	uint8_t suspend_state;
+} __packed;
+
+#define MGMT_EV_CONTROLLER_RESUME		0x002e
+struct mgmt_ev_controller_resume {
+	struct mgmt_addr_info addr;
+	uint8_t wake_reason;
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",
@@ -1088,6 +1100,8 @@  static const char *mgmt_ev[] = {
 	"Device Flags Changed",
 	"Advertisement Monitor Added",			/* 0x002b */
 	"Advertisement Monitor Removed",
+	"Controller Suspend",
+	"Controller Resume",
 };
 
 static const char *mgmt_status[] = {