From patchwork Fri Sep 28 23:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620549 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 90A46112B for ; Fri, 28 Sep 2018 23:20:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7899B2BAEE for ; Fri, 28 Sep 2018 23:20:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BBF62BB16; Fri, 28 Sep 2018 23:20:21 +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 B12A52BAEE for ; Fri, 28 Sep 2018 23:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbeI2FpR (ORCPT ); Sat, 29 Sep 2018 01:45:17 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46208 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2FpQ (ORCPT ); Sat, 29 Sep 2018 01:45:16 -0400 Received: by mail-wr1-f66.google.com with SMTP id z3-v6so7923368wrr.13; Fri, 28 Sep 2018 16:19:15 -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=aJeOchJBN+qfSsXZfvjCOs2l/bBNh+k/RTSHbCWKnXRbBBh+r/rriq0kwiVELmpvyL tFgyZYNRzTc+RJyAfnLkTUH6AzS23qiHPd/VZQYGhATzDjZHPN9CesrArKq9CrPtZ0FY WstMvIaIjQuHBC9w+LoGICW//+w2tKYhu0jQI5OssFMaBlO5tRRH1V1IP2fi3VACfc9i Oi9YN/hoDqwJFaXpfZBsJbQjmrPQuLqpQt9reNmeSj69SIrqdzUqKdC62JUTA6iQEGko wKB+n1EhfnkJD5UtEGgdxr1xMxHL88LGcGJaqWmRsXgxkLjG9snSLMV4cUMJy7tdxGCE V1MA== 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=a/yv01ZE3cN/lC47ei9UB3gw2vnQRQVcMTwxUXgUhG9HgnJyyA0BlZgalxnLp85ro3 TK39L1iITI3WbRZlOmKlXO5n2795vWwpJrpZ+Y22NiZcIkergj5xCTkmO6Nh8Dgbm7ol BxlMNNPV8f40pT9Qs1voO68sZVaeB1VC8Pgv1dBF3Z/UjJa+QwbMc15lF340me/cUnT6 CvV6wnw0YGEStEioiKL538NhetyHsXWuRiTG8X+7+rCMePu681miuBrfqrEaPDRn63tV 0DRAubiocLoPylBvqRXIbMbmu7lra9epRaCjaYOBPsXSwU9zcd49Qm0IVdun8+USvlk3 nN4Q== X-Gm-Message-State: ABuFfohkdDBf03mRkLgNl9T/Du9VeJqiu8+X1uKZH4pcYUK5p1LywvNe mijxJHBDVbvYBmtVVy0e9ioJikha X-Google-Smtp-Source: ACcGV617jKXuU86Tk7xQEPEtpy8bP9Q5X5Gs/mHsR2U3NS8zkJSgAkyiNKY7exvcSGyjE1z+KMw1sQ== X-Received: by 2002:adf:9367:: with SMTP id 94-v6mr468849wro.211.1538176754240; Fri, 28 Sep 2018 16:19:14 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19:13 -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 v2 1/7] asix: Check for supported Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:50 -0700 Message-Id: <20180928231856.3587-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Fri Sep 28 23:18:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620537 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 446A0112B for ; Fri, 28 Sep 2018 23:19:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 326372BAEE for ; Fri, 28 Sep 2018 23:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 220C02BB12; Fri, 28 Sep 2018 23:19:24 +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 C705B2BAEE for ; Fri, 28 Sep 2018 23:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727536AbeI2FpV (ORCPT ); Sat, 29 Sep 2018 01:45:21 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50548 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2FpV (ORCPT ); Sat, 29 Sep 2018 01:45:21 -0400 Received: by mail-wm1-f66.google.com with SMTP id s12-v6so3683982wmc.0; Fri, 28 Sep 2018 16:19: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=4RYTqH0+Cakyvsu2OEu5e9Sb/xNwG7fIaEa14Pt55MU=; b=GnlzDIGYCE//BEkyYe4CeB+EgCz/AAWc97vG9M0kzdrHNxu75vqL9R8zkdP9WZu19v j4G0akkkxYTsM/1Fsp6nkeVB3WVEB0P0pt4QGzK/bb+y/7+n4NkwfsPYc2TGtIhB0r+z LJLlaCnzlguS0r08zoeMfkg93C6nazxzKWzEVRivlf1+Q9iYJW0VPiY9d1LYevsmdrne 7LbqdC4nAH90gJCWfIfYW9XfW0P15vQ/IZhoWVz+jiZO3yT3g66WQm4D1XIH/DFsym6j eg2MQY0/7FfqLsOr+5HA3zVK7UG3YnUKtvGQyMFjZi4XOEkOXeWuMmEO9T5dYxrQQPY3 VUHQ== 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=HL7yGYLQxGzvz5alralHKvC1xuMGVRgJ+LK2w/ZY2G0tG1GaXefyB7WUeSV1Oi5nwc VgQVMQEKa0U7KbcQ97kDOpOSvboU0dNV4GiBcKqqKrFnkM3xFQc0Iy/lYziaecadDW4B 8rG704WOCAsw2Q8uvPAM3qp2NMbLomX4HjSJwit/OAZQaxqUCEDU02fRmq9BE24BH87r 9gLUVCHPeDbE8+V2T3TMI42zpFLqFs1WK1I3OaFHFMQlr9qkm56yO9bdCsWhjb4Q2p5E su+zcdNQewe1AGiK22Yg14fqAHCnmEROijF1waJAmdD8rAXJmyz0gn3/+Wc2rmbk9nht mDqg== X-Gm-Message-State: ABuFfohk+DNeOlIn31zOQ+VzsjgqRzNVcpDtIaqIQdHpdjwIL1XqyZjg Y/elxp7afAnc2+6Eh2koIYup0yRr X-Google-Smtp-Source: ACcGV624f5QkKGHEKC4c+xYlf7ZNkkIwwIteX/Gcua6T9deTj1RVm0O01ilqvPcm35gb80N3ecZ1Ig== X-Received: by 2002:a1c:7212:: with SMTP id n18-v6mr3253483wmc.33.1538176758505; Fri, 28 Sep 2018 16:19:18 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19:17 -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 v2 2/7] ax88179_178a: Check for supported Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:51 -0700 Message-Id: <20180928231856.3587-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Fri Sep 28 23:18:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620539 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 C387A6CB for ; Fri, 28 Sep 2018 23:19:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B36E02BAEE for ; Fri, 28 Sep 2018 23:19:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A745D2BB12; Fri, 28 Sep 2018 23:19:31 +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 5A7122BAEE for ; Fri, 28 Sep 2018 23:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727562AbeI2Fp0 (ORCPT ); Sat, 29 Sep 2018 01:45:26 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51684 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2FpZ (ORCPT ); Sat, 29 Sep 2018 01:45:25 -0400 Received: by mail-wm1-f66.google.com with SMTP id y25-v6so3655894wmi.1; Fri, 28 Sep 2018 16:19: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=7DMULJ6++X4SoASj0cUX2/pBG4ZpMIdbQPejFRKpgBQ=; b=tGKugrIR9UczoQu0W5tIwwr8sW5Df249EI+3pe/95ZkxcdHjkWZGreyApigkv4GkVl dE6er9Z3GfsyadYyr1KknnIuGR6YNwUQG4YJGoE8H3SkZ5TrmYrrU8fhGnoOnDwkc1Xb tWv+G+jl8cHlHR2vYS0P75QlHuaJfCJRhUCrt5YZi7UNu+g4MSjjevX6G1XTh/gFqfzN PEM2VOMIt2oO5q80I9nvWEH+GwNXXjfVduI6ScPSZePwlXyCpoxUJ4HBrMWnFB2Kh5Eq i04PxaYm0OZgSMKqrUXuFiLPhLfqwJvg41KgaggLafs6EYrriJSsgrI1+58KqmneKkE3 PIHQ== 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=7DMULJ6++X4SoASj0cUX2/pBG4ZpMIdbQPejFRKpgBQ=; b=ezzyzjIcHMx3AQHn2nXvfvy+68M8CJmBf25+8sh+/k5X70+swzXS+soQA/8EeVbDMF DnjnoLwZDln2lirkgabxsvkh4cNOsF2nm+9m5MfWZVQalKQFKhLv+ybXBro14WcaPDhx Olk7p0lwu2qLVC0ELHkg4YmEJxsPQ3DdHMkEoN1UEjEwruvQBuyPeow1kfPsEilnabk5 dbqvg4n0Q29te9nCwLxl+yv7gg2uWBk2JMvNtvs6b18oAlNiNKBsUmum+1e8diqvrU5s 96ee+XnBwwfEJdN8+UMAl4/ZXBeMml8hOVTopJVSyj+TnJ2UvG53lHY97y/TqPuuJ98F 7anw== X-Gm-Message-State: ABuFfohjXftdDU7+9pY1psBwuHoHrke9KqFe/g3AlE2VsWVj6deSKtE3 vVllAXv8cKAUGdrhT+sc3h4h3wck X-Google-Smtp-Source: ACcGV60+iv/4+1C59oJNOqe5AJ+1FNnvwZjBEXbvX82AqaSAvXwmQp0yB6u7+21YLHF/we4kYhFNoQ== X-Received: by 2002:a1c:3ec3:: with SMTP id l186-v6mr3041711wma.84.1538176762691; Fri, 28 Sep 2018 16:19:22 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19: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 v2 3/7] lan78xx: Check for supported Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:52 -0700 Message-Id: <20180928231856.3587-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Reviewed-by: Woojung Huh --- drivers/net/usb/lan78xx.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index a9991c5f4736..c3c9ba44e2a1 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1401,19 +1401,10 @@ static int lan78xx_set_wol(struct net_device *netdev, if (ret < 0) return ret; - pdata->wol = 0; - if (wol->wolopts & WAKE_UCAST) - pdata->wol |= WAKE_UCAST; - if (wol->wolopts & WAKE_MCAST) - pdata->wol |= WAKE_MCAST; - if (wol->wolopts & WAKE_BCAST) - pdata->wol |= WAKE_BCAST; - if (wol->wolopts & WAKE_MAGIC) - pdata->wol |= WAKE_MAGIC; - if (wol->wolopts & WAKE_PHY) - pdata->wol |= WAKE_PHY; - if (wol->wolopts & WAKE_ARP) - pdata->wol |= WAKE_ARP; + if (wol->wolopts & ~WAKE_ALL) + return -EINVAL; + + pdata->wol = wol->wolopts; device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts); From patchwork Fri Sep 28 23:18:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620541 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 2B679112B for ; Fri, 28 Sep 2018 23:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1212BAEE for ; Fri, 28 Sep 2018 23:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 106972BB12; Fri, 28 Sep 2018 23:19:34 +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 BDF452BAEE for ; Fri, 28 Sep 2018 23:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727606AbeI2Fpa (ORCPT ); Sat, 29 Sep 2018 01:45:30 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54211 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2Fp3 (ORCPT ); Sat, 29 Sep 2018 01:45:29 -0400 Received: by mail-wm1-f67.google.com with SMTP id b19-v6so3666517wme.3; Fri, 28 Sep 2018 16:19: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=TKgRBdcbaLjCLYFNNphXO7D7Dwz80ZmX3ouxX2MzgvY=; b=fiyMGjACH7SDcTB1+tZSz1L/V932cPSByVOm0f2zm8CTItuiNIkj4wf9QHAysl9AMi BRUwV0+aeBbx1IxlNpScSyvD7hhOvQgbl5X5cYTGRZ/QZsB1pZbIOVC8lMeJA1L0/YDT /6K8geMWbG6PHy+zdqyUwZ9oQOdyY2t06QMYYC31/utc7HNov3HwsPZeiEyjTx2AHPNz 4a7do1UivlHnUstIO7wXhvdhxo6KmkWgMu4dTEQalAsEonjRYVtMb39y7+3R1PatJT+J CIl1g/K3Md7J/kIRxikemAhx9HX0Z8vIlRohaNIAOzaHhGXk8V/WEsRw79FSy193hByL pvIA== 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=CbWV7jAVHQ4W1nmVSyrn6KPj6G8vjbRxqKDX4gR8M7qzr2U8ODT8SRIhHHzt9jzoEz F0VHwrPfD/qij/4EKtVFT7HDcUtyhKqAu5oo++AwE8XgXQzYk3wXJNFlIU+7ftjlLWWe i/5QeRmNEjHSyLeBLZKjiOXIRVBXtEw7gLtiW+8SY5esWLm6wNHWEX+B5z7VQaHLY32I tBzZKYZPWeE/Y2hOKbsOOpZnM93WCvFC8KZyB2ymmxou8LxqohQJl2ayVMVlDdZUXzeQ ldKOLmh/xumcISqYBatMGvAOIio6XpZyKc5EnBSPRm4aagmEtZt8a99T4tCJHPyuZgSN j0Tg== X-Gm-Message-State: ABuFfojO2HJH9YYZz8pZOJVYzor8V4IB9tAx+gtYAOnhAuLwmgDd7O3Q yziwKJnW5NQE7HUVQCaG7LH1SW0Y X-Google-Smtp-Source: ACcGV61v4IEyTEZbBPwvjqt2GWiqrJr+dpLxY2/ZGphzfLHgKdZNncn7I5aKOhL1HllqGjzpNA0R8g== X-Received: by 2002:a1c:d785:: with SMTP id o127-v6mr3036028wmg.67.1538176766877; Fri, 28 Sep 2018 16:19:26 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19:25 -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 v2 4/7] sr9800: Check for supported Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:53 -0700 Message-Id: <20180928231856.3587-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Fri Sep 28 23:18:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620547 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 2D79E112B for ; Fri, 28 Sep 2018 23:20:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CD462BAEE for ; Fri, 28 Sep 2018 23:20:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10B162BB12; Fri, 28 Sep 2018 23:20:01 +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 B895B2BAEE for ; Fri, 28 Sep 2018 23:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727502AbeI2Fpe (ORCPT ); Sat, 29 Sep 2018 01:45:34 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51693 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2Fpe (ORCPT ); Sat, 29 Sep 2018 01:45:34 -0400 Received: by mail-wm1-f67.google.com with SMTP id y25-v6so3656059wmi.1; Fri, 28 Sep 2018 16:19: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=Piwc98Rhl39Hpiu2GJne8FYMrIF9jD8b1cwLP656bic=; b=Pcnr75rbfu9HIrsQjIdfBEU0vz34OCgUeX23DJPcTiLGUSiRJVoZc9lz9qGkjIiOcC wUYjRi69QbfRWo/LL1L96+WJ4BikKAqz3TTVF19v6OIzEsKwA3gsuv2waroe90NEOxk1 p+pmy0cWVilRS29EChc2DzNASvA6zWRxD3oCkja5yMCZzDSdhfM2IlQJ7oL7G32jnH2c BWyWWzjmt0R1xWtNYLcMHZOhzICEEc3qSdXBXQ0ssVQtTrGrt16IQJhSzR/LoyoXT656 CPUnsCjv4pgJxrnrf6TvGBLQrKHrIMqEDIFmjhwBVfrDPUIF2xoR2R8gOLgcEiLR3fQX PjBg== 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=OPglw/my4fPZEFQJi3Kao8l5uBjWJS1o50c6XTXKENw97PeRWGLTC2839ftEy2sh7q EbcMLqRHWH+PCXKd0xGGe7rzkLvibSD1ao79V8SiH0gMS/XkhncdsV9BrK0ERzJmA4k4 8DNRD3GpIdhc2lEgaHMOm+bXAb/9p7qXjlLfm+YKcRekGlwt80unNK8V3bayOl9z/B/W uZv9hTYz+RyUhaxcJhUSnZDjw1+hjwV0vdggSSC7tWhWzp1qclKNT5ZQLuhOTUJ3ddVn hbjEdbcIItMTrzlYVUPIzjhjbsa9+z943ssNVplQG/U2/kQfjSDJiHnuWLPZFaiWf9JZ PGoA== X-Gm-Message-State: ABuFfohqHaxc6dgz1N5Zvr7TN50tvY8PG+nma/l9NxP+Dk8nr1RFyht+ 8YxV/LosAPp5ml+o8e0Wep5icgNm X-Google-Smtp-Source: ACcGV626wKqCBnh03Bs22JMEHG+vOVREBV/JLZnFnvKyUfAbCiUERuUFsaSAuGsdXen2JbOulXbDPw== X-Received: by 2002:a1c:d712:: with SMTP id o18-v6mr3307394wmg.54.1538176771071; Fri, 28 Sep 2018 16:19:31 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19: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 v2 5/7] r8152: Check for supported Wake-on-LAN Modes Date: Fri, 28 Sep 2018 16:18:54 -0700 Message-Id: <20180928231856.3587-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Fri Sep 28 23:18:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620545 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 8614B6CB for ; Fri, 28 Sep 2018 23:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76A722BAEE for ; Fri, 28 Sep 2018 23:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB522BB12; Fri, 28 Sep 2018 23:19:55 +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 11BBD2BAEE for ; Fri, 28 Sep 2018 23:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbeI2Fpi (ORCPT ); Sat, 29 Sep 2018 01:45:38 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44490 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2Fpi (ORCPT ); Sat, 29 Sep 2018 01:45:38 -0400 Received: by mail-wr1-f68.google.com with SMTP id 63-v6so681453wra.11; Fri, 28 Sep 2018 16:19:36 -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=FraKfHsbjCznufPl+GjcFxF42gdCWAnPnycn7Qp3Wp0yXNheuHDhwrk3REqTWWf7uA YRdWsQwemyBTV+DhjG2IdD3q1lFW019SL1vOSvpMmljB6hNJwrB2lwbYFYcuCvBOpDmj mYE4HVh4oge6q4U7+QtBw0B3AvNNyCWkKhTKDLuzfuDjSDAxt557rxclBZb/cEAOq+uT kqrj6JLGjT0/LPye0X67o/wxU/jO/4P7/D++ZkvXp0dAXiLTe10mT2tTndMlBXAbLn6E vUE1AI9HhqwWLID8MOv7fCAJke6yvjkTqiGQqnsrePS9CkAId5G82dtLLoWEP6sWFagv r6+w== 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=VgcdQ6wSxfz5gzB6Jmk1elfNomIYh18G4y2B1aSUE5FYWU1rqlC/UxxSAomYfPWUlx IfRAPhO9vOX/iDoku6/AuVPwlbL1QIS0GWIWn9xnolXgdhV30INJbXMJQcE25h5YeTtW 8cxhaNx1+S3ysWLt4xIgcMl1dHWdh585GMm2Tp6eJi09pi4cdnIozcH43umHQbkG9G6Y OQpcu2lR2pkuEOq53qC+3EaPstSMKgMBdszUK4vvV0+RXJX2Ftl+CNZD/FPek/0qkyRU YHy3Ksa7gFSWufDwCDjiVMMZAYhBaRTx+vlP+6Vuzr3UMZNcrS42rfAQcjDOKKek5IRs C2AA== X-Gm-Message-State: ABuFfoiWTPkwcdsv0C+Cx3kZkzoK6U3WsxYiEd312thkwshgGpRv7WPx 9ZlJoI+RK5r90ok0duUBzR0Mxg0X X-Google-Smtp-Source: ACcGV62lnsy5BggsiCDEQQjXeI0HlkoqAEuzXneAWCeQoSR4A3KOsCktBsl8JguDrMc2rWz1M98dHQ== X-Received: by 2002:adf:de8c:: with SMTP id w12-v6mr471105wrl.270.1538176775253; Fri, 28 Sep 2018 16:19:35 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19:34 -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 v2 6/7] smsc75xx: Check for Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:55 -0700 Message-Id: <20180928231856.3587-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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 Fri Sep 28 23:18:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10620543 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 8B2F2112B for ; Fri, 28 Sep 2018 23:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A54A2BB0E for ; Fri, 28 Sep 2018 23:19:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2352BB16; Fri, 28 Sep 2018 23:19:51 +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 22B442BB0E for ; Fri, 28 Sep 2018 23:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727721AbeI2Fpn (ORCPT ); Sat, 29 Sep 2018 01:45:43 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36670 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeI2Fpm (ORCPT ); Sat, 29 Sep 2018 01:45:42 -0400 Received: by mail-wm1-f65.google.com with SMTP id n23-v6so3641169wmc.1; Fri, 28 Sep 2018 16:19:40 -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=VQq08hTNz9D1I2y2uKcuIOdXti6LnGuCqF319oJTs5LyDBAa2SG3bLbEwj23aBoqsY QL2efI+MdzCSUmjSH8CsYxQzh1ubmkyKdOX0JmgWFG6Zw8atOUjDIqBgVOfIX6t4rERj XjKlC8xM0iACIIugay8SqOkU0+IWazIxeXw4V7kEFddtjFN/2hRj293Ss/fuqfsILC2W zaf7mnOcibqEpvI3WkydmQcoYSVTd2LGgAtf4PrgvXYB7a052zSIO5gQ9AT4/IJYBlD0 1yb1p+qbhCCHc+6N17H/JmQebfhcct8nh7HKnGYwa9SXjwiqR5SZHytNm+TYJyA7hgxD rfEQ== 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=DEsn+Vuik+T0EiHiq9VhG8DPfV7H1eInknWD9GHqKDnULNHTstsOtWJyVx4Q0Obk1O 5oUlHPxjThmcLT91khXdg3R3Kwayhfq9V/AgK7djxBU1DFUZ3W9F8eA+l3EobDNOzUln vegSp8hK4AWvDRnAeNp3ue7twQ56Do+sFpntRUE8SXAjv0tdt5EcSu2JaPhoypGhSA/A feqBVWOeAFKP3LaaQP6+n1PMJhxjmSUlL30PGqp71r5/n5khcbGgVuTz3nF4ei8kxBSn jysCC+mA2XsDs8Tp19CQu2X4pTmS9aGluXVXo2P6EaSN1eC5pORPEv0jAjconv4I4NeQ vf8w== X-Gm-Message-State: ABuFfoj2+6OBYClF1RZWmS0ISefph3/bX8aIDuAda1LV20Hko03EKvXZ +nSEPrLkkYPbniPPNThwVQ5T2FWN X-Google-Smtp-Source: ACcGV63XAKq6n9nar3nclIwQfJecn37KLHcgeuCjccwcwACHP9zeLw+FvqvpYucwdJeSOgbMbO5r1w== X-Received: by 2002:a1c:a401:: with SMTP id n1-v6mr3036890wme.125.1538176779409; Fri, 28 Sep 2018 16:19:39 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 11-v6sm8590730wrb.95.2018.09.28.16.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 16:19:38 -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 v2 7/7] smsc95xx: Check for Wake-on-LAN modes Date: Fri, 28 Sep 2018 16:18:56 -0700 Message-Id: <20180928231856.3587-8-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928231856.3587-1-f.fainelli@gmail.com> References: <20180928231856.3587-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);