From patchwork Sat Mar 9 09:53:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Zhukov X-Patchwork-Id: 10845899 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 963D04A09 for ; Sat, 9 Mar 2019 09:54:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8029D2E127 for ; Sat, 9 Mar 2019 09:54:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74A0C2E1AE; Sat, 9 Mar 2019 09:54:39 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A0602E127 for ; Sat, 9 Mar 2019 09:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KCBLqCn61Cze8UZwveq0THq9OYRBQuSkM44MREW17lQ=; b=kAO7A2sP/1mZ7x cCeO99ZjrZZaUMn7P4wYmNp7iTr/YDVD2zcS9UGopVPz2/HLaftlxq6HKu/qCoOQhr1fC2G1vznwt 19sk5ly1q7GgqF4S4IIN8BNGwtyMw8kHkysEDZlhyYuT2g1CuPZEtd+8kAddhjhL1qiDZywiWpsR/ NUofUa5F1vrSrDCi1M1t9kTxh9fGMi2KWf/T8mIM0Eb7LMeF5Sm/zEtp10hRzw+tHCUS4nwntoG03 RsuFL+n0Dg3RNMH4Cf2DX+OeRN9R0fLbV78RyMUKCzReCA/Lvw/jCtUCLpRHN73VIhWySFv5rjDOK XI4/cdsYm7F8UQtqLfdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2YgY-0003tu-5B; Sat, 09 Mar 2019 09:54:30 +0000 Received: from mail.dlink.ru ([178.170.168.18] helo=fd.dlink.ru) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2YgW-0003sm-1D for linux-mediatek@lists.infradead.org; Sat, 09 Mar 2019 09:54:29 +0000 Received: by fd.dlink.ru (Postfix, from userid 5000) id E4F8D1B218A6; Sat, 9 Mar 2019 12:54:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru E4F8D1B218A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dlink.ru; s=mail; t=1552125261; bh=ZB+kpNUL7sfUS1P1cCsq0z8W9CajczsSspuJO2Dzhac=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qds21/pqPkmxQJC2K+3S5Y34vrBSBzLcrChiLDnP5IaZLwsHEn1avaV2qGhtrYpFB JgicufcNR0PvOOAtHzpzjzYo6lre08bNn62EkNT9YGrmBOVbuujcTBg3L+pkobOhys QL/DHAl69muyC6eMhiuQqSVeog0qwCR5KL7KUOTI= Received: from mail.rzn.dlink.ru (mail.rzn.dlink.ru [178.170.168.13]) by fd.dlink.ru (Postfix) with ESMTP id 2E09A1B21812; Sat, 9 Mar 2019 12:54:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 2E09A1B21812 Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTP id 0EA101B20755; Sat, 9 Mar 2019 12:54:17 +0300 (MSK) Received: from localhost (unknown [176.112.142.79]) by mail.rzn.dlink.ru (Postfix) with ESMTPSA; Sat, 9 Mar 2019 12:54:17 +0300 (MSK) From: Maxim Zhukov To: Matthias Brugger Subject: [PATCH 1/2] staging, mt7621-eth: fix api for linkmode bitmap Date: Sat, 9 Mar 2019 12:53:59 +0300 Message-Id: <20190309095400.26930-2-mussitantesmortem@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190309095400.26930-1-mussitantesmortem@gmail.com> References: <20190309095400.26930-1-mussitantesmortem@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190309_015428_259652_1F419641 X-CRM114-Status: UNSURE ( 7.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Maxim Zhukov , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Start using new api for linkmode bitmap Fixed build after 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode") Signed-off-by: Maxim Zhukov --- drivers/staging/mt7621-eth/mdio.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-eth/mdio.c b/drivers/staging/mt7621-eth/mdio.c index 5fea6a447eed..142d7a082dd3 100644 --- a/drivers/staging/mt7621-eth/mdio.c +++ b/drivers/staging/mt7621-eth/mdio.c @@ -89,8 +89,12 @@ int mtk_connect_phy_node(struct mtk_eth *eth, struct mtk_mac *mac, return -ENODEV; } - phydev->supported &= PHY_1000BT_FEATURES; - phydev->advertising = phydev->supported; + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, + phydev->supported); + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, + phydev->supported); + + linkmode_copy(phydev->advertising, phydev->supported); dev_info(eth->dev, "connected port %d to PHY at %s [uid=%08x, driver=%s]\n", @@ -113,7 +117,9 @@ static void phy_init(struct mtk_eth *eth, struct mtk_mac *mac, phy->speed = 0; phy->duplex = 0; phy_set_max_speed(phy, SPEED_100); - phy->advertising = phy->supported | ADVERTISED_Autoneg; + linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + phy->advertising); + phy_start_aneg(phy); }