From patchwork Sun Sep 10 22:10:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 9946399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 682B3602C9 for ; Sun, 10 Sep 2017 22:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C57A28A54 for ; Sun, 10 Sep 2017 22:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5153D28A7E; Sun, 10 Sep 2017 22:10:50 +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=-6.9 required=2.0 tests=BAYES_00,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 2DCA928A54 for ; Sun, 10 Sep 2017 22:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbdIJWKs (ORCPT ); Sun, 10 Sep 2017 18:10:48 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:45959 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdIJWKr (ORCPT ); Sun, 10 Sep 2017 18:10:47 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id E11C44730C; Mon, 11 Sep 2017 00:10:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id tASfAh8Oepv0; Mon, 11 Sep 2017 00:10:44 +0200 (CEST) From: Hauke Mehrtens To: johannes@sipsolutions.net Cc: backports@vger.kernel.org, Hauke Mehrtens Subject: [PATCH 3/8] backport: add ethtool_convert_legacy_u32_to_link_mode() Date: Mon, 11 Sep 2017 00:10:15 +0200 Message-Id: <20170910221020.13067-4-hauke@hauke-m.de> In-Reply-To: <20170910221020.13067-1-hauke@hauke-m.de> References: <20170910221020.13067-1-hauke@hauke-m.de> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function was added in kernel 4.7 in commit 6d62b4d5fac62 ("net: ethtool: export conversion function between u32 and link mode") and is used by mii_ethtool_get_link_ksettings() in the backport-4.10.c file. Signed-off-by: Hauke Mehrtens --- backport/compat/backport-4.10.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backport/compat/backport-4.10.c b/backport/compat/backport-4.10.c index 4c8125fb..44e02dd7 100644 --- a/backport/compat/backport-4.10.c +++ b/backport/compat/backport-4.10.c @@ -36,6 +36,13 @@ static bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32, *legacy_u32 = src[0]; return retval; } + +static void ethtool_convert_legacy_u32_to_link_mode(unsigned long *dst, + u32 legacy_u32) +{ + bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS); + dst[0] = legacy_u32; +} #endif static u32 mii_get_an(struct mii_if_info *mii, u16 addr)