From patchwork Wed Nov 14 22:23:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 10683173 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 5525014DB for ; Wed, 14 Nov 2018 22:25:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 475DD2AEA2 for ; Wed, 14 Nov 2018 22:25:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 397162BEA4; Wed, 14 Nov 2018 22:25:02 +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,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 CC1632BE9E for ; Wed, 14 Nov 2018 22:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388690AbeKOI36 (ORCPT ); Thu, 15 Nov 2018 03:29:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:37086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388629AbeKOI34 (ORCPT ); Thu, 15 Nov 2018 03:29:56 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE36422527; Wed, 14 Nov 2018 22:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542234292; bh=OYwdI72nSvEeMaRKCm8f623xRMFUREu5VxKiANAzODY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cFsoyRKJkYHzJoDz3GMo8RUn4v/aUgO58IWnEL2buak/IQUrfS52beEZpJtbvAf7X n/SlHrx2xIWIF21Ygd/vuXzhu8QCwg3t6vkbVjum6FYnPl+LO9z4oFPAuBHQAVGalw smK3mobLazj+zHvXbteokbCdpvf0GO2ZPDghJZ4g= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Wahren , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 4.18 52/59] net: smsc95xx: Fix MTU range Date: Wed, 14 Nov 2018 17:23:24 -0500 Message-Id: <20181114222335.99339-52-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114222335.99339-1-sashal@kernel.org> References: <20181114222335.99339-1-sashal@kernel.org> 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 From: Stefan Wahren [ Upstream commit 85b18b0237ce9986a81a1b9534b5e2ee116f5504 ] The commit f77f0aee4da4 ("net: use core MTU range checking in USB NIC drivers") introduce a common MTU handling for usbnet. But it's missing the necessary changes for smsc95xx. So set the MTU range accordingly. This patch has been tested on a Raspberry Pi 3. Fixes: f77f0aee4da4 ("net: use core MTU range checking in USB NIC drivers") Signed-off-by: Stefan Wahren Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/smsc95xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 2d17f3b9bb16..f2d01cb6f958 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1321,6 +1321,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->ethtool_ops = &smsc95xx_ethtool_ops; dev->net->flags |= IFF_MULTICAST; dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; + dev->net->min_mtu = ETH_MIN_MTU; + dev->net->max_mtu = ETH_DATA_LEN; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; pdata->dev = dev;