From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C9CC1975A for ; Sun, 8 Mar 2020 08:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A90B120828 for ; Sun, 8 Mar 2020 08:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726339AbgCHI2v convert rfc822-to-8bit (ORCPT ); Sun, 8 Mar 2020 04:28:51 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:60270 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbgCHI2u (ORCPT ); Sun, 8 Mar 2020 04:28:50 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id B9FE9CED15; Sun, 8 Mar 2020 09:38:16 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [RFC PATCH v4 1/5] Bluetooth: Add mgmt op set_wake_capable From: Marcel Holtmann In-Reply-To: <20200303170610.RFC.v4.1.I797e2f4cb824299043e771f3ab9cef86ee09f4db@changeid> Date: Sun, 8 Mar 2020 09:28:48 +0100 Cc: Luiz Augusto von Dentz , Alain Michaud , linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Transfer-Encoding: 8BIT Message-Id: <417309A5-3C77-4EC3-BEA9-B0136C64625C@holtmann.org> References: <20200304010650.259961-1-abhishekpandit@chromium.org> <20200303170610.RFC.v4.1.I797e2f4cb824299043e771f3ab9cef86ee09f4db@changeid> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abhishek, > When the system is suspended, only some connected Bluetooth devices > cause user input that should wake the system (mostly HID devices). Add > a list to keep track of devices that can wake the system and add > a management API to let userspace tell the kernel whether a device is > wake capable or not. For LE devices, the wakeable property is added to > the connection parameter and can only be modified after calling > add_device. > > Signed-off-by: Abhishek Pandit-Subedi > --- > > Changes in v4: None > Changes in v3: > * Added wakeable property to le_conn_param > * Use wakeable list for BR/EDR and wakeable property for LE > > Changes in v2: None > > include/net/bluetooth/hci_core.h | 2 ++ > include/net/bluetooth/mgmt.h | 7 +++++ > net/bluetooth/hci_core.c | 1 + > net/bluetooth/mgmt.c | 51 ++++++++++++++++++++++++++++++++ > 4 files changed, 61 insertions(+) > > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > index dcc0dc6e2624..9d9ada5bc9d4 100644 > --- a/include/net/bluetooth/hci_core.h > +++ b/include/net/bluetooth/hci_core.h > @@ -394,6 +394,7 @@ struct hci_dev { > struct list_head mgmt_pending; > struct list_head blacklist; > struct list_head whitelist; > + struct list_head wakeable; > struct list_head uuids; > struct list_head link_keys; > struct list_head long_term_keys; > @@ -575,6 +576,7 @@ struct hci_conn_params { > > struct hci_conn *conn; > bool explicit_connect; > + bool wakeable; > }; I do not want to commit to the mgmt API just yet. So I would prefer that the two changes above go into the respective BR/EDR and LE patches to enable this feature. And that the mgmt command comes last in this series. Then I can start applying the initial patches and we just have to discuss on how we want to expose this for blueoothd to use. Regards Marcel