From patchwork Mon Sep 24 20:54:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59BEA15A6 for ; Mon, 24 Sep 2018 20:55:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DF9A29858 for ; Mon, 24 Sep 2018 20:55:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43EAF2A44B; Mon, 24 Sep 2018 20:55:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8BE029858 for ; Mon, 24 Sep 2018 20:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726227AbeIYC7Y (ORCPT ); Mon, 24 Sep 2018 22:59:24 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40836 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbeIYC7X (ORCPT ); Mon, 24 Sep 2018 22:59:23 -0400 Received: by mail-pg1-f193.google.com with SMTP id n31-v6so2914591pgm.7; Mon, 24 Sep 2018 13:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pN80Rw0L9zuyYJtcOwbG8AKZcMeKTKgEirKbEwnLrKo=; b=gmgvZsrnuze9Ru26SAsu0AEE901fIv799RwKgsiRmJNBOc0KlayeoFYBKAaBjNn2ET n6T9XX6pna18QTGW6IBEIoVRR56PuPdLRcEi25oL6eGaToVxQp74AUpMsPIXpBlg6Gim O9zVWgwIRDQ0ANB4/+hJni1xEOA0bHYL47VOF1vXIqs1XLuPxnOZyBQs5/APOfuxl2tO d0P6Sr23x3EXl7ugzNOv0XcHGVVK3lFoKa5Vh6/QYitDYLOkJ56ZlKvCL0C1MfhhGMWb 93yw8yB/h0FwbD6xVQ/2tbUc3b/HvgSP/lX/bLUf2WiFHxHoZ3LGSnolJL6aBO/RxGWx ousQ== 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; bh=pN80Rw0L9zuyYJtcOwbG8AKZcMeKTKgEirKbEwnLrKo=; b=DQUHMZO6d9fMN8W89ZjsCO5rjydo1zncG2K7VmXrCgREK0ftxdKrv5NZF+/g+5GS9/ Wc3iXd9Xo3Q+J5NLqw7NCCUs1LPxR7f/IujizQP91CZHKxPs/3bsbcJZY9GaJunPvHHi l6istwQeGskyueWN0lUc/cPD7bxijITNh/IcF3Qr45vWLtVLggELR1PcpQAKp4yr/kfo ZRkreG1uTNARXX7HsIy2H9m83nBIEw92d5hJTFULxLS0ytZxgl2gYrDleHgFAmetp+tJ 0jDdhOjKI/dzMatU02ByTVooZtibo/disdpKE72HfQg9hbY0rYU3E0L2VRhvvnS2WzpV 4t6g== X-Gm-Message-State: ABuFfogYHlCYOWd+or4JOT3P/mgYeZ/VQ09hsZHQGPpZS3fW4t4x/Lg0 Z8xP0JK/eH61yra5V0ErLk8ccjTt X-Google-Smtp-Source: ACcGV63W++Arw5ncF0ufnHSgiB11lPBFRcBT9wQbQdl2gcJJkAj0uy5QCMa68iobdPtuE0rej/8Q7A== X-Received: by 2002:a63:9c19:: with SMTP id f25-v6mr408522pge.447.1537822519083; Mon, 24 Sep 2018 13:55:19 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:18 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 1/7] asix: Check for supported Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:14 -0700 Message-Id: <20180924205420.31309-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Signed-off-by: Florian Fainelli --- drivers/net/usb/asix_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c index e95dd12edec4..023b8d0bf175 100644 --- a/drivers/net/usb/asix_common.c +++ b/drivers/net/usb/asix_common.c @@ -607,6 +607,9 @@ int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= AX_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC) From patchwork Mon Sep 24 20:54:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E57C96CB for ; Mon, 24 Sep 2018 20:56:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA3662978A for ; Mon, 24 Sep 2018 20:56:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D857929858; Mon, 24 Sep 2018 20:56:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9074B2A15C for ; Mon, 24 Sep 2018 20:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728386AbeIYC71 (ORCPT ); Mon, 24 Sep 2018 22:59:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38755 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbeIYC7Z (ORCPT ); Mon, 24 Sep 2018 22:59:25 -0400 Received: by mail-pg1-f195.google.com with SMTP id r77-v6so4672666pgr.5; Mon, 24 Sep 2018 13:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4RYTqH0+Cakyvsu2OEu5e9Sb/xNwG7fIaEa14Pt55MU=; b=kTNRsf6y128e+KV3L86iWgqiMsbzxhwc1+Jw2kGTstMw0TIvMbVpVviyOF4DRDMFck BRR+/hHinJG1THjDLntRP2//kCzpev73euaN/3tq+xnYJU8VFNBeF0vKjylq8IWKGgmj YvNQF1pvBGY/c+ucU02mHTfUsi+U0o08cEsHG/R3DsH84ChhANESmHm0qAyBgxFJWFdz c/mW+lkYLc3Pvi0s7KSNn30n0cNagM6YosTHwfuXpJqMvCsYGtWrDnf2/SKYUIx20Jaf aQsiR2hIitNlVyWbO1QNF4bT8alWH99rcBWDgDUKJb8eD5LreGcc6VCAX+XMl4vADfcI t4Dw== 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; bh=4RYTqH0+Cakyvsu2OEu5e9Sb/xNwG7fIaEa14Pt55MU=; b=OrvMfLfRR67ZJvK6ro8fjMKSWj4uYwrywpUNViyUavPwFxh0XqJ1iLFUpGwlGWkA0Z l9q8+v22f3kJak1LRoGBwXHadtFkpsuqzDGJhFkw3F7oN8SI6Djna86nb59LQy6qat8N Zp9EKuksgt9lLqzVSsD/Rkom4fecuFT9JtQPO0JxOLNEiTekKtQvRMRN9Fyq2v4ax4O8 Td9zFKSZBSRzLH7naDDdUg/9dk9sKSgoGsNEe+/WPl5WnNiglCAAJ+1o7eSz4Ycd0pe7 SgxXIs/03PRCRY/zDkLT++t+hY9DXV7YDO3C6O2xYUqm3bJDQM7alVM3jhg+u/E15fLf LQyg== X-Gm-Message-State: ABuFfogo2a6xlDdbXzH5VLttGTvXE17C5E8So0IukYmWHH56tItDAyFF 8ODJG8UndTE7I6HKIkJCozGICEK+ X-Google-Smtp-Source: ACcGV62dby03YwQr1oT39eMMwnuRdVDWprvqUXHXuuETe/OHqgUJuNIQrNJN6tEcACZxLJ6kIZW30A== X-Received: by 2002:a63:9619:: with SMTP id c25-v6mr445784pge.23.1537822521052; Mon, 24 Sep 2018 13:55:21 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:19 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 2/7] ax88179_178a: Check for supported Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:15 -0700 Message-Id: <20180924205420.31309-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Florian Fainelli --- drivers/net/usb/ax88179_178a.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 9e8ad372f419..2207f7a7d1ff 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -566,6 +566,9 @@ ax88179_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= AX_MONITOR_MODE_RWLC; if (wolinfo->wolopts & WAKE_MAGIC) From patchwork Mon Sep 24 20:54:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5052215A6 for ; Mon, 24 Sep 2018 20:56:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 449C229807 for ; Mon, 24 Sep 2018 20:56:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42B3F2A5AB; Mon, 24 Sep 2018 20:56:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F304829807 for ; Mon, 24 Sep 2018 20:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbeIYDAI (ORCPT ); Mon, 24 Sep 2018 23:00:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34288 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbeIYC71 (ORCPT ); Mon, 24 Sep 2018 22:59:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id d19-v6so9812744pgv.1; Mon, 24 Sep 2018 13:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=haEHP1Iz78Fw98J7Yy0wNUApgo7Zm5Zh0aJ5xbSU/Us=; b=Qmt7huEA0NbU+qF3631L2DlKQw8yU2+4ANxgNG2MF0n0dslJV4c5DHAdmVenA8XjKW gHBDYg7DJgOXzMW2rNXjbHDrA95132ijtMpzLDJCxTYgBBTZPeZz2NQebAJ5CPjtShtJ NysVk0iHut7VoHiTsIfuQySJ4sT4C/VEqr5aWHfVoBj2iVKUaQPLqlBM8dgndrwvCKxQ aubSAPaFY9vC6D1SFhQQrQBI9+ZPC0deSV64BzZLmYWqzsmBJM/p4r7iuxNQC0Ax38Gv UNzJ64NBdmJi2ZjEhvxLua+lEbVLOAOoQ3H4wJYRj1EOWQ50yjaH1Tu7iACgz9eFAsMF Vl6g== 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; bh=haEHP1Iz78Fw98J7Yy0wNUApgo7Zm5Zh0aJ5xbSU/Us=; b=Ov0/4HGNKf6xWL3MQIth5ad1YdzTG8sbVQ/0HiisBiZDuHOKIduz4C2kFk4I4zq8yW 4mGOY7P690ciwURXm+qNxD2WDU423Sjj80cM+8vwz35E8LRcBp9tOJh27MjJS3i+/ab5 eLI/1EsNewLMn19V0EMCyzOs4o72OJXTGw1dOHsIx2S2pwqa5rKfG5aPUP/rkwJLKZXI W+icNUu1D6aM/j1SHNQqv8yR9QUTHMqhpeKb3tdS92D8K+eUFEX3Z/0qRRj03S52L6aS kAu8sD0HfiRTCjqts/NPEoLjtkSb0RgssvN3TWpfzKqzrpJxDC8pCbrijd08hCR0QY0d eyMg== X-Gm-Message-State: ABuFfoi6itKZdpdvq7yKuBU3w+b/yLrE7hvEBaeAw2JKSRFSmGjUF6bJ frGUZibTYamMkh5UMklEHJKbGD4a X-Google-Smtp-Source: ACcGV61Sdk6257xCESRmPgZt97TacEp/Q/7WzzuKqe3Lgg1O+eW/+cnHx5RqykijDf1vCbuyg7lUKA== X-Received: by 2002:a63:24c:: with SMTP id 73-v6mr466823pgc.252.1537822523099; Mon, 24 Sep 2018 13:55:23 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:21 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 3/7] lan78xx: Check for supported Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:16 -0700 Message-Id: <20180924205420.31309-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver supports a fair amount of Wake-on-LAN modes, but is not checking that the user specified one that is supported. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Florian Fainelli --- drivers/net/usb/lan78xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index a9991c5f4736..e0a588d1b8e6 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1415,6 +1415,9 @@ static int lan78xx_set_wol(struct net_device *netdev, if (wol->wolopts & WAKE_ARP) pdata->wol |= WAKE_ARP; + if (pdata->wol == 0) + return -EINVAL; + device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts); phy_ethtool_set_wol(netdev->phydev, wol); From patchwork Mon Sep 24 20:54:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D3B015A6 for ; Mon, 24 Sep 2018 20:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 211E929858 for ; Mon, 24 Sep 2018 20:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15350285E3; Mon, 24 Sep 2018 20:55:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3B8285E3 for ; Mon, 24 Sep 2018 20:55:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbeIYC7b (ORCPT ); Mon, 24 Sep 2018 22:59:31 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40655 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbeIYC73 (ORCPT ); Mon, 24 Sep 2018 22:59:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id s5-v6so1841143pfj.7; Mon, 24 Sep 2018 13:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TKgRBdcbaLjCLYFNNphXO7D7Dwz80ZmX3ouxX2MzgvY=; b=YUEBuRPQTzT8CGzg7GgPki5xla5ibOAm1oSIOW5aQ5a5A8WXdhAHyxsj6Wc1nYrknc ntJUvNH7yTsTxVNGNkvt/rNqe/T0bj9ooS+Wxvx3nn8LW0Vop+7g1c7LyqGJ/8OoDBkY +gyo/EPUmpd9TKYvvEekob2zGM6dGvjX+eU/xMXEwWA/Df6UQk/OMlR6RfdIh2Shxt0D GaUKBPgNW1H0SOQ85dSxq8lLLk8tLX/bM46fYxlpAU5P92vwFST06jEvTSmjFFO1AHgV QeUTPIpR45Msh34k7biTNkYaCgYDCzEmTLLs/1IWDFfbzSuMbre8OofgSgMyoySWDqrn mBdg== 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; bh=TKgRBdcbaLjCLYFNNphXO7D7Dwz80ZmX3ouxX2MzgvY=; b=kzsYrSjaaTO2ybeTmk8FwTwK73s0N5Tbtu1kE6+fQV0SJd6QJaiF7FWTCnAmbjo9cE bzGVAjKEt0CaoyO7i6dEe+WhhN2Z0DZIqv0bgD9YKPKFRt/N1bz0bRTFC5rCzOTrwW8Y UcIXVuSkTBZpdsinw5xVmoq5WBsXwWbNJ1BeWt0PRXZnGn1JUHed1XoMYoD4Rg7WoO1/ QC7HSG6c4M3SLCiYA8X0U1S1gXhLxx5bXnPsTMWkWAl2tU9JibpdXx0NvxAk1wRyYFB6 NDb/ywY83b58tZ8TPWC1/4VGhVvOqj0HPYlfmcYYMocY0+OrUVmYWOTSe60uRmTOHjJ0 5jHw== X-Gm-Message-State: ABuFfoieAXVoPoIb8eh7MUbTUPp4hS+kyn2F8bnHw3UZJGuD0Vcn5QI2 3s+08l10IWzZn/7wF2+GuZ+j2ZcJ X-Google-Smtp-Source: ACcGV60GkNZoQMsF2MNudIlwOdzYk0OxJ4zfUt4x2txWNL5Q3Fa/6a/HSmDIUPwO7stfpgh6tppArA== X-Received: by 2002:a63:ff1f:: with SMTP id k31-v6mr463132pgi.20.1537822525156; Mon, 24 Sep 2018 13:55:25 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:23 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 4/7] sr9800: Check for supported Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:17 -0700 Message-Id: <20180924205420.31309-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 19a38d8e0aa3 ("USB2NET : SR9800 : One chip USB2.0 USB2NET SR9800 Device Driver Support") Signed-off-by: Florian Fainelli --- drivers/net/usb/sr9800.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c index 9277a0f228df..35f39f23d881 100644 --- a/drivers/net/usb/sr9800.c +++ b/drivers/net/usb/sr9800.c @@ -421,6 +421,9 @@ sr_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) struct usbnet *dev = netdev_priv(net); u8 opt = 0; + if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC)) + return -EINVAL; + if (wolinfo->wolopts & WAKE_PHY) opt |= SR_MONITOR_LINK; if (wolinfo->wolopts & WAKE_MAGIC) From patchwork Mon Sep 24 20:54:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CBE615A6 for ; Mon, 24 Sep 2018 20:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5187929858 for ; Mon, 24 Sep 2018 20:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F3D829663; Mon, 24 Sep 2018 20:55:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB4CD29663 for ; Mon, 24 Sep 2018 20:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbeIYC7c (ORCPT ); Mon, 24 Sep 2018 22:59:32 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36099 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbeIYC7b (ORCPT ); Mon, 24 Sep 2018 22:59:31 -0400 Received: by mail-pg1-f195.google.com with SMTP id d1-v6so9801082pgo.3; Mon, 24 Sep 2018 13:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Piwc98Rhl39Hpiu2GJne8FYMrIF9jD8b1cwLP656bic=; b=sxRmJh2Wl4KakVXyJ4PMqjeSHQ2qIcAWEk4+0/48Hsk6XaXC9BEjsZ4YIrShVnUwI2 egIUGhBScdyDzIkexGvlpRCTONxEkK3w1XDeaQ+hIx83qCViM2nGFJA/S7CrKyNooDiW E/s0p3s6O/luaPGpY7oePYr8jqRhoqlWw+F3HgodmUMkf1V5EpJNGDEISmx2GjWKuA0W QItWDRm0K3rKAl4ZKTPAZ8o/Y930ybWOdTZ87UEDiSImFRPxrUDBvsSHV6fEU/pD4PNC YTiBOPJ76VQXa97lK7+11ZCqwIyPeFNKJVZGRTdv76IMRb24su8UKlUsJz60SjQ1J1+t Eh/Q== 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; bh=Piwc98Rhl39Hpiu2GJne8FYMrIF9jD8b1cwLP656bic=; b=UT3dvPbNlUh0jloRbpAyN6mlqhh4OzRhblUtLyiVp9/8t/GmWSnbw3DOK35OyfSifx pWVAjeZVgnwqdyY70ozlMluGURhgA8zsjmYHHTQ3i4/2v0Iv8WrIZ4dlaxWxqVMOsYWk 94c1xZuKr+R4aOtFDaaG12+rkEtMMDFnhCw+5nfASyAyn2uYxPPGCV30JwE7Y4XY27oB 0HfiN2vP3QjeUR/leCPFIa93RAoyNi4P190fEbeI8md54oVADRl42SW+qPYtPLxbcZau UKGyKF65ruFtvLZBLw+9VHYwvgi4fKN0M8nj8ru4NvcBvhmqGN5o8tEOYvt1AorYEYox Q1dg== X-Gm-Message-State: ABuFfogsV2Mip//RkyhVbjpC+3XEA9Fpkn/6YrIKj/nmKT4zs9351L7D 8djEY7hIfre+WBvwxxdcMZCcUugo X-Google-Smtp-Source: ACcGV62HJSV6sInIbq4xhDOZ8aYmkM3/fMR+ZDTcr7K2Su4H85lGkzViNqQkbvYyMgLrCYU9bdf7MA== X-Received: by 2002:a63:5726:: with SMTP id l38-v6mr486601pgb.118.1537822527166; Mon, 24 Sep 2018 13:55:27 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:26 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 5/7] r8152: Check for supported Wake-on-LAN Modes Date: Mon, 24 Sep 2018 13:54:18 -0700 Message-Id: <20180924205420.31309-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: 21ff2e8976b1 ("r8152: support WOL") Signed-off-by: Florian Fainelli --- drivers/net/usb/r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2cd71bdb6484..f1b5201cc320 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -4506,6 +4506,9 @@ static int rtl8152_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) if (!rtl_can_wakeup(tp)) return -EOPNOTSUPP; + if (wol->wolopts & ~WAKE_ANY) + return -EINVAL; + ret = usb_autopm_get_interface(tp->intf); if (ret < 0) goto out_set_wol; From patchwork Mon Sep 24 20:54:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 032E96CB for ; Mon, 24 Sep 2018 20:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBB0029807 for ; Mon, 24 Sep 2018 20:55:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9B8E2A15C; Mon, 24 Sep 2018 20:55:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AAA0298D4 for ; Mon, 24 Sep 2018 20:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728522AbeIYC7e (ORCPT ); Mon, 24 Sep 2018 22:59:34 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46406 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbeIYC7d (ORCPT ); Mon, 24 Sep 2018 22:59:33 -0400 Received: by mail-pf1-f195.google.com with SMTP id d8-v6so2660628pfo.13; Mon, 24 Sep 2018 13:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bm4Acqb3XB9RGJLIiUYLiFJb5kSpjfsIqMMRV0ygrNA=; b=CpgXq3W82U9O8s+GZihcSFFx0W29OCK6WVO9K6HpFehs/GevgOobio2OCJ+zcTvOjg Fx69fWOaeAVQu2i38Jk49hheNloU0Aut/UUneBNWPs3aEP0oYj3W97Ja+WbhGwq4C6hy 2cw3UIXgabEL7ko0YtbfHbxEEKd2Z+/Ey5sV68ewoyI4FrN6ed+FJLlK373oM6mEDPVf IIEYEYWe+DxgHvpTpombpSMSS1rNh4qu+TnJvSUdXKhFH1FVGhiHtsodxe8rPA/nFhJQ F/sF2yZU5qgYkPNgL7fl3n6zV+YissnHqawVDQ+096xb0UFOpRr+o2buSePNYfy3srsm HPgQ== 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; bh=Bm4Acqb3XB9RGJLIiUYLiFJb5kSpjfsIqMMRV0ygrNA=; b=L6lAZRm9Vh4pGKw/XV+qHSFIBt/JgoplfOJkBfJF3en2l5iVY2y5pqvFFec/aiOkUb 4khAME6GXNwC78iaEowQ9H7EFsuUGdgpGmOQVjbTyHc4d1KmkRlnUPqjirGKIgazQZw4 7DCAM+UEKBpVsLIeqXnCKA+OPWW14CEKUt8TZcee87YtozPo4ugBkp3BSWBgc5asoAXY mwuWJV3A2biC28imGSMl7mKzCSeiJSNH6gfIV/LpzRwrcwEcomjTMVwg71Kk6tEqHosJ QotUzZyNVLlUWIJMbC/Mq/P996bVLVGc4Y6PgDV+Y0qZff0AUGHfFMUy/gxS1BW6L8wy N0cA== X-Gm-Message-State: ABuFfogC8dLN9cedfm00Pqs2HUBLF7uML0AoRNGeXB8g7UHhaX17zNRY W3m8smPS+C6HNzhcgueD/nrQuSt2 X-Google-Smtp-Source: ACcGV63znkDVhcAN29Tx1BY5c4Dbl4N0uO4EC7txAglJikLk1t3eDDm+Kjen+DbSSRB31Ch/3yybrA== X-Received: by 2002:a63:fa0c:: with SMTP id y12-v6mr435916pgh.177.1537822529193; Mon, 24 Sep 2018 13:55:29 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:28 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 6/7] smsc75xx: Check for Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:19 -0700 Message-Id: <20180924205420.31309-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: 6c636503260d ("smsc75xx: add wol magic packet support") Signed-off-by: Florian Fainelli --- drivers/net/usb/smsc75xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 05553d252446..e5a4cbb366dc 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -731,6 +731,9 @@ static int smsc75xx_ethtool_set_wol(struct net_device *net, struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); int ret; + if (wolinfo->wolopts & ~SUPPORTED_WAKE) + return -EINVAL; + pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE; ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts); From patchwork Mon Sep 24 20:54:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10612839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7C236CB for ; Mon, 24 Sep 2018 20:55:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACEA22A3D0 for ; Mon, 24 Sep 2018 20:55:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB1202A44B; Mon, 24 Sep 2018 20:55:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E0922A5F6 for ; Mon, 24 Sep 2018 20:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbeIYC7g (ORCPT ); Mon, 24 Sep 2018 22:59:36 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36155 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbeIYC7f (ORCPT ); Mon, 24 Sep 2018 22:59:35 -0400 Received: by mail-pf1-f195.google.com with SMTP id b7-v6so2207179pfo.3; Mon, 24 Sep 2018 13:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7EjcO8AOqi6wmrlm1Wfclavax7VPrDQSsrxmfbBlQM4=; b=BMNhHGfjyMpfPnVB4NPMxPMfq8GyUSyf7K9S2IVIfJWHKkLDfT6/3g8/It8txQHNqH gaMlzShryDVNtVZolNa3ba4Xk+pAJxWcrGM8/MiRk+bqkmFJM5ONnX6O560lIJ+zeo4A 4iVLEJIm7AsAZrZEym1PgE8AmNIEkyrDi78VHBq3U9Y2cRwCwBuJv1yaP9Up1/talU4z uOUN1ZYpxv+FtGtYjffdBTJg6UP3wp9wXwlx4baF0ltD3ySXJ1Ai0kiC6HUXIW19PjvQ aEThn6BaCRu6URkejr4K733GkD18DFODNWdonbXBB21135Cy0D+L+mMIxw3oaXwAKlhH FAfA== 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; bh=7EjcO8AOqi6wmrlm1Wfclavax7VPrDQSsrxmfbBlQM4=; b=oXntBmuVfCyzqS8wTK2y3UgSG/t65t61J6szr2lvHRHnUS28oQiK9ZY+Dd/OXuUaSL PdOfq+2KEFFE/W6UZEPKnrzK97OvDR4tbo3sjkoME31nftBjVSx0vUAK60TbLvgU4XpT Dw3TrJdAERkR/tH/EU9i3ZVr9lpF1DeOLJReSeuYLSgZdQ9H0YZw844tY9PD9Qn9jVCG +nhER3jKMWXC7NPjEHhElTSQ/PfbwS/Sf0NbuQhGi4RRDFjJZNYSVWptZIqK6o/POt8G GdRK0OvdQMfxFhUbfnO+FCp/AluR/CIbiiumMcXEZ4FyytJLjM5ZJq287P5wwjNaZU2p oLXw== X-Gm-Message-State: ABuFfogHzr9DVn3VJMefhKojSymx/8T0KH7H//nHo530XJZqKmYqDob3 Pdtl/eXLmbcNzJV1mq61EA6ODL+k X-Google-Smtp-Source: ACcGV62fD592iKwpKQILluMfsD84ON8edF1sn5LMDlHekRMme+Vqj1WCJCbzveo7HxJgidAVWp9xNg== X-Received: by 2002:a62:9586:: with SMTP id c6-v6mr481404pfk.234.1537822531245; Mon, 24 Sep 2018 13:55:31 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id b62-v6sm260160pfm.183.2018.09.24.13.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 13:55:30 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Woojung Huh , Microchip Linux Driver Support , Steve Glendinning , Kees Cook , Alexander Kurz , Hayes Wang , Kai-Heng Feng , Grant Grundler , zhong jiang , Sebastian Andrzej Siewior , Ran Wang , Eric Dumazet , linux-usb@vger.kernel.org (open list:USB NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net 7/7] smsc95xx: Check for Wake-on-LAN modes Date: Mon, 24 Sep 2018 13:54:20 -0700 Message-Id: <20180924205420.31309-8-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924205420.31309-1-f.fainelli@gmail.com> References: <20180924205420.31309-1-f.fainelli@gmail.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver does not check for Wake-on-LAN modes specified by an user, but will conditionally set the device as wake-up enabled or not based on that, which could be a very confusing user experience. Fixes: e0e474a83c18 ("smsc95xx: add wol magic packet support") Signed-off-by: Florian Fainelli --- drivers/net/usb/smsc95xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 06b4d290784d..262e7a3c23cb 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -774,6 +774,9 @@ static int smsc95xx_ethtool_set_wol(struct net_device *net, struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); int ret; + if (wolinfo->wolopts & ~SUPPORTED_WAKE) + return -EINVAL; + pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE; ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);