From patchwork Mon Jun 29 23:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Pandit-Subedi X-Patchwork-Id: 196805 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=-4.3 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT 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 70E45C433DF for ; Mon, 29 Jun 2020 23:02:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 519A9206C3 for ; Mon, 29 Jun 2020 23:02:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="J9bGodhi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728735AbgF2XCe (ORCPT ); Mon, 29 Jun 2020 19:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728591AbgF2XCd (ORCPT ); Mon, 29 Jun 2020 19:02:33 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69484C061755 for ; Mon, 29 Jun 2020 16:02:32 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id q17so8532449pfu.8 for ; Mon, 29 Jun 2020 16:02:32 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=/eYZRfxdDdMGipjAIlkGFO2L4zxv1b9ptR+ecHNecQA=; b=J9bGodhi+7K3mo8IPL4ZT9svT7SGLDZT4cXeFjogMReqFVKUqxplPzP3qm74OtYUTh /tXugW3W8W6MSipYrsz526U9pAUu0gDIfvnIA5cxtfa8KBfnmPk68nTh+3468xD2oTw8 BLzi7gMP4ZCMJJWbzbTgeGO9EdF84XENXBPjY= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=/eYZRfxdDdMGipjAIlkGFO2L4zxv1b9ptR+ecHNecQA=; b=CZ7WAVvFRbamidf5SqO/4K51dXByK64iUk59cF7wWhyjWmm40Gl3oDbU4eyYShqqS2 V+JOSnJH+EZPOnWwYdGrKmZvKMD4CX/MAxdggwIBq9PJPESi9iQmjsACXUEojc2/GV7S GKOeQccJVrNn346EqM+ajxWyIzOGPnc61NI883+dPWxK4I149pNdl3cOETVAekKOj91t sw1kuBRmsOzbRxgXkUk0HReNzZ0Gx9neraqhTLfnhedielwAZbe6sQWM+4DcMOURBUF2 JhlcgSuUdvuJSdnTKv5l/uJsbFq2kgrfFrGohWiIj2SqefTDv8++Q5aD7RLBF1qVDzAM 9Ebg== X-Gm-Message-State: AOAM530COP7uD/3UntaPFLjgHeKnLqUB159YSpetKXDcD4zmKlBGAS6y 6xEZssmN4ob+DAcXUTya1jDVWw== X-Google-Smtp-Source: ABdhPJx81U/vQt54qQTLwVG+bJJiZs5g5XxOn3ghCVjjdBOcEDWmcftjxxZVZIqUUXBPOfEwOnWt9Q== X-Received: by 2002:a05:6a00:f:: with SMTP id h15mr16272889pfk.193.1593471751555; Mon, 29 Jun 2020 16:02:31 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id i13sm467275pjd.33.2020.06.29.16.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 16:02:30 -0700 (PDT) From: Abhishek Pandit-Subedi To: luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org Cc: alainm@chromium.org, marcel@holtmann.org, chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi Subject: [BlueZ PATCH v6 2/6] monitor: Decode device flags mgmt ops and event Date: Mon, 29 Jun 2020 16:02:19 -0700 Message-Id: <20200629160206.BlueZ.v6.2.Ieac700ddea68a19e8c3dc53528f686482076a77a@changeid> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog In-Reply-To: <20200629230223.3538949-1-abhishekpandit@chromium.org> References: <20200629230223.3538949-1-abhishekpandit@chromium.org> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add support for Get Device Flags and Set Device Flags mgmt operations and Device Flags Changed mgmt event. Sample trace: @ MGMT Command: Set Device Flags (0x0050) plen 11 {0x0002} [hci0] LE Address: CD:F3:CD:13:C5:91 (Static) Current Flags: 0x00000000 @ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0001} [hci0] LE Address: CD:F3:CD:13:C5:91 (Static) Supported Flags: 0x00000001 Remote Wakeup Current Flags: 0x00000000 @ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0004} [hci0] LE Address: CD:F3:CD:13:C5:91 (Static) Supported Flags: 0x00000001 Remote Wakeup Current Flags: 0x00000000 @ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0003} [hci0] LE Address: CD:F3:CD:13:C5:91 (Static) Supported Flags: 0x00000001 Remote Wakeup Current Flags: 0x00000000 @ MGMT Event: Command Complete (0x0001) plen 10 {0x0002} [hci0] Set Device Flags (0x0050) plen 7 Status: Success (0x00) LE Address: CD:F3:CD:13:C5:91 (Static) --- Changes in v6: * Fix up some build issues reported by bluez.test.bot Changes in v5: * Decode device flags Changes in v4: None Changes in v3: None Changes in v2: None monitor/packet.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index 3b9c06512..431a39b66 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -100,6 +100,7 @@ #define COLOR_UNKNOWN_EXP_FEATURE_FLAG COLOR_WHITE_BG #define COLOR_UNKNOWN_ADV_FLAG COLOR_WHITE_BG #define COLOR_UNKNOWN_PHY COLOR_WHITE_BG +#define COLOR_UNKNOWN_ADDED_DEVICE_FLAG COLOR_WHITE_BG #define COLOR_PHY_PACKET COLOR_BLUE @@ -13099,6 +13100,56 @@ static void mgmt_set_exp_feature_rsp(const void *data, uint16_t size) mgmt_print_exp_feature(data); } +static const struct bitfield_data mgmt_added_device_flags_table[] = { + { 0, "Remote Wakeup" }, + { } +}; + +static void mgmt_print_added_device_flags(char *label, uint32_t flags) +{ + uint32_t mask; + + print_field("%s: 0x%8.8x", label, flags); + mask = print_bitfield(2, flags, mgmt_added_device_flags_table); + if (mask) + print_text(COLOR_UNKNOWN_ADDED_DEVICE_FLAG, + " Unknown Flags (0x%8.8x)", mask); +} + +static void mgmt_get_device_flags_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data + 6); + + mgmt_print_address(data, type); +} + +static void mgmt_get_device_flags_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data + 6); + uint32_t supported_flags = get_le32(data + 7); + uint32_t current_flags = get_le32(data + 11); + + mgmt_print_address(data, type); + mgmt_print_added_device_flags("Supported Flags", supported_flags); + mgmt_print_added_device_flags("Current Flags", current_flags); +} + +static void mgmt_set_device_flags_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data + 6); + uint32_t current_flags = get_le32(data + 7); + + mgmt_print_address(data, type); + mgmt_print_added_device_flags("Current Flags", current_flags); +} + +static void mgmt_set_device_flags_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data + 6); + + mgmt_print_address(data, type); +} + struct mgmt_data { uint16_t opcode; const char *str; @@ -13324,6 +13375,12 @@ static const struct mgmt_data mgmt_command_table[] = { { 0x004a, "Set Experimental Feature", mgmt_set_exp_feature_cmd, 17, true, mgmt_set_exp_feature_rsp, 20, true }, + { 0x004f, "Get Device Flags", + mgmt_get_device_flags_cmd, 7, true, + mgmt_get_device_flags_rsp, 15, true}, + { 0x0050, "Set Device Flags", + mgmt_set_device_flags_cmd, 11, true, + mgmt_set_device_flags_rsp, 7, true}, { } }; @@ -13714,6 +13771,17 @@ static void mgmt_exp_feature_changed_evt(const void *data, uint16_t size) mgmt_print_exp_feature(data); } +static void mgmt_device_flags_changed_evt(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data + 6); + uint32_t supported_flags = get_le32(data + 7); + uint32_t current_flags = get_le32(data + 11); + + mgmt_print_address(data, type); + mgmt_print_added_device_flags("Supported Flags", supported_flags); + mgmt_print_added_device_flags("Current Flags", current_flags); +} + static const struct mgmt_data mgmt_event_table[] = { { 0x0001, "Command Complete", mgmt_command_complete_evt, 3, false }, @@ -13793,6 +13861,8 @@ static const struct mgmt_data mgmt_event_table[] = { mgmt_phy_changed_evt, 4, true }, { 0x0027, "Experimental Feature Changed", mgmt_exp_feature_changed_evt, 20, true }, + { 0x002a, "Device Flags Changed", + mgmt_device_flags_changed_evt, 15, true }, { } }; From patchwork Mon Jun 29 23:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Pandit-Subedi X-Patchwork-Id: 196804 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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 453FBC433E0 for ; Mon, 29 Jun 2020 23:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21B8C206C3 for ; Mon, 29 Jun 2020 23:02:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lTJW6YCM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728842AbgF2XCf (ORCPT ); Mon, 29 Jun 2020 19:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728782AbgF2XCe (ORCPT ); Mon, 29 Jun 2020 19:02:34 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E00D4C061755 for ; Mon, 29 Jun 2020 16:02:34 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id d4so9005832pgk.4 for ; Mon, 29 Jun 2020 16:02:34 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=r/3TX1GMSyX3TTscRoWjCKEmSjIsfk15HaizZFDaaBE=; b=lTJW6YCM5+pShACNr8EEFsMa3SNagZUkm2LSLPPyu4neBqCjEa11U5k/msctTp75T3 gaFYlEIabatzaok7X3Cr3UwRyeAdvCYDJdq2VTwaD2riGd4XQBuZnNQ9Et4rbaf2Q5wC RS7ZcF4vN7Pd1VjCVaM0W5iEETRzHbxs9uikQ= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=r/3TX1GMSyX3TTscRoWjCKEmSjIsfk15HaizZFDaaBE=; b=ti8U/8/8B57MSCGkH8LIOovo6Lk4YOEfLKhEbPoIS1oVwyicZaLIlpG6yBRMzuug/u 1TIERBVSeJnhRAFManOWPE9jtXj2DU2Ly7BEP761md1oxme5DXlo63+P1SH0Dizga2+2 BfPFOsziz6rcu7fOIS0DDsITVdylHWuH3BW/5Jj6nD19hd63dauR5sJ+Oe1tGCcZKiVo /uZ0m517bX2oXm8kSUFysv85eRIQJ1VW7xbZHWJyqM0i28Svcst4lnayDWSESqo5dZUV g3sVJvT1eD3Q3GFI0ocEqTWiUVgijgUjOGxjseDFwKBcc0OzZAcx98JGlA5MAogUg3TA ih2Q== X-Gm-Message-State: AOAM533XunWPlgyKpo/4jpuwIlUtf5SIIupqcg6MIQ+jbL2no1QlqQs7 +iAvhaOSi4l3QSBu7yoGaq06Zw== X-Google-Smtp-Source: ABdhPJwdCt/7ZNtZCdGixklixX9Az48KALTznFLeHTndARzZcL92dOJjSx/TZ8gI3H7fzj4nxnypDw== X-Received: by 2002:a62:7712:: with SMTP id s18mr16684110pfc.145.1593471753544; Mon, 29 Jun 2020 16:02:33 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id i13sm467275pjd.33.2020.06.29.16.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 16:02:33 -0700 (PDT) From: Abhishek Pandit-Subedi To: luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org Cc: alainm@chromium.org, marcel@holtmann.org, chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi Subject: [BlueZ PATCH v6 4/6] client: Display wake allowed property with info Date: Mon, 29 Jun 2020 16:02:21 -0700 Message-Id: <20200629160206.BlueZ.v6.4.I45dbf8ee15dff6c9346dc9754574a0be9bee1fa1@changeid> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog In-Reply-To: <20200629230223.3538949-1-abhishekpandit@chromium.org> References: <20200629230223.3538949-1-abhishekpandit@chromium.org> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Display whether the device is configured as wake allowed when queried with cmd_info. --- Changes in v6: None Changes in v5: None Changes in v4: * Renamed WakeCapable to WakeAllowed Changes in v3: None Changes in v2: * Newly added to show whether device is wake capable * Removed automatically setting wake capable for HID devices client/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.c b/client/main.c index 422da5593..4953f50f0 100644 --- a/client/main.c +++ b/client/main.c @@ -1637,6 +1637,7 @@ static void cmd_info(int argc, char *argv[]) print_property(proxy, "Trusted"); print_property(proxy, "Blocked"); print_property(proxy, "Connected"); + print_property(proxy, "WakeAllowed"); print_property(proxy, "LegacyPairing"); print_uuids(proxy); print_property(proxy, "Modalias"); From patchwork Mon Jun 29 23:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Pandit-Subedi X-Patchwork-Id: 196803 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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 1A58AC433DF for ; Mon, 29 Jun 2020 23:02:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC3CE206E9 for ; Mon, 29 Jun 2020 23:02:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JxvkC+kr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728870AbgF2XCi (ORCPT ); Mon, 29 Jun 2020 19:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728855AbgF2XCh (ORCPT ); Mon, 29 Jun 2020 19:02:37 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE509C061755 for ; Mon, 29 Jun 2020 16:02:36 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 67so4469107pfg.5 for ; Mon, 29 Jun 2020 16:02:36 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=agMkRPFhgMe1f/hFXF9SjRTi2sxyZRnC9GuMfZzTrjc=; b=JxvkC+krK9jVF8aauUPT4a0+JgM9VTquGgkwnEGJBAGNw5+ivq6qIE9T21xD96F+mI y5qMrOldan0EA0MkPEX9qgehcibNmU7v3TvKKFUjKpSOBvcu/SZRBWrdLng3ZiAmqFJH A9VdLr+fHCJWS9fTftRERv9/dQk6KcRFJioCk= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=agMkRPFhgMe1f/hFXF9SjRTi2sxyZRnC9GuMfZzTrjc=; b=YnQmykZVKGsFkdChw1rkEDpo+iqulaOhYS4b36g1V+zJrvhgZyIZFz/7s2T5qVVPOq R+ktMAAd6HpYzy+NKIWyJz2YXPJVTETEp1fS2/X8ORNDJupoCnEREOwPyZpmPb6ZMXO1 6Bm3kcVtby/a/9h7w/SHfVjEXPzJXDp/4b8lqd1m36NC9DBuNb+w1bJAbHSbkzMc8yO1 qK3PNfIp06obLuHZ8R9+x196qNP8qO85yRLdQt6SiASIfuaab4iypog4A5f5WKhLMzmp 23gk4fvibcNnkygE5yYi+ksR8dlmoAd+n3hqK5VrNR//XiMXx3zA5L6wLR1dcwvI1JkJ GnhA== X-Gm-Message-State: AOAM5300mXdkEz5ewLxb5DAYXKDPbuSMURW8kZAK6bCWFLY1aJiWhsZY 1JQeZs2aINrbejD2M9RBGPbcWw== X-Google-Smtp-Source: ABdhPJyihaBDtBDoNLeXy0/ngiL8p0sO2snTgxoepPvvnBczq7OX2koloKiIPgHYt2v6ecWBf69QgQ== X-Received: by 2002:aa7:8ad9:: with SMTP id b25mr16484227pfd.248.1593471756268; Mon, 29 Jun 2020 16:02:36 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id i13sm467275pjd.33.2020.06.29.16.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 16:02:35 -0700 (PDT) From: Abhishek Pandit-Subedi To: luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org Cc: alainm@chromium.org, marcel@holtmann.org, chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi Subject: [BlueZ PATCH v6 6/6] input: Make HID devices support wake Date: Mon, 29 Jun 2020 16:02:23 -0700 Message-Id: <20200629160206.BlueZ.v6.6.I3290604153369ff32013f3dcadda4df3f2eb0f36@changeid> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog In-Reply-To: <20200629230223.3538949-1-abhishekpandit@chromium.org> References: <20200629230223.3538949-1-abhishekpandit@chromium.org> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org HID devices can wake the host from a suspended state. Mark the profiles to support wake when they are accepted. If the device hasn't already been configured with a Wake Allowed configuration, it will default to yes when the profile is accepted. --- Changes in v6: None Changes in v5: * Only call device_set_wake_support Changes in v4: * Renamed device_set_profile_wake_support to just device_set_wake_support Changes in v3: * Mark HID device to support wake from suspend Changes in v2: None profiles/input/device.c | 1 + profiles/input/hog.c | 1 + 2 files changed, 2 insertions(+) diff --git a/profiles/input/device.c b/profiles/input/device.c index d3724ed54..2dc2ecab2 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -1409,6 +1409,7 @@ int input_device_register(struct btd_service *service) } btd_service_set_user_data(service, idev); + device_set_wake_support(device, true); return 0; } diff --git a/profiles/input/hog.c b/profiles/input/hog.c index 9335b7e8b..130f696a9 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -166,6 +166,7 @@ static int hog_probe(struct btd_service *service) return -EINVAL; btd_service_set_user_data(service, dev); + device_set_wake_support(device, true); return 0; }