From patchwork Fri Oct 3 00:02:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 5020731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F156AC11AB for ; Fri, 3 Oct 2014 00:06:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DB65201F5 for ; Fri, 3 Oct 2014 00:06:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5974E201EF for ; Fri, 3 Oct 2014 00:06:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZqM7-0001GL-C7; Fri, 03 Oct 2014 00:04:19 +0000 Received: from exprod5og115.obsmtp.com ([64.18.0.246]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZqLb-0000vM-Ey for linux-arm-kernel@lists.infradead.org; Fri, 03 Oct 2014 00:03:47 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) (using TLSv1) by exprod5ob115.postini.com ([64.18.4.12]) with SMTP ID DSNKVC3nzk0JelC8I6ndI+yWfdv2LM10uxwp@postini.com; Thu, 02 Oct 2014 17:03:47 PDT Received: by mail-pa0-f43.google.com with SMTP id lf10so295643pab.30 for ; Thu, 02 Oct 2014 17:03:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GRJ5cuDafecXT6p4CaUeLVux4YMFl0o5BGEsf9Zk7GQ=; b=aJQ9nRHYcDKoqunaxb8oNZNZPmPW5O6cltJldY7uk1sP/USNw8ZpJ2SlqImc/oqRuF w7dpzo8sP4Jq2VWAj/bhjV1C0WaINgjiDqhtaJzMyGd7QOenyFM2Y+GjcWuJ6+ZRIpiY PpcwEbJmcE9hFQsOFjsf0GL/B8+kMzx1ecmfvZ1Tip/Fft2lTxXiQdS+73zZgQWrHkF5 kAkW6hw/OAQvOvQFuisU16UGSsy1QlWBKXtnJjhMSjd4n+sKxHJfRASnv5k7s5Edb2nX YD1Ylh6caMYEj5YT16zsjfQ1lLWjuwjMuP1zdTTE5riH3+XZO98xxEV4BztbTyb+Ieb2 YJWw== X-Gm-Message-State: ALoCoQkb0M4rfB7Gru5EbUrGj0/MxgceWq1YpDZmVsZ7yq2wtVWsvz6wLL9+x3uiggHi/cnhDdEHyOx0AVQ+2dT1VZ4SyVRLHIVtOZyrlDXPEDaCcVFVE77qh1BHjVRlasN/k/PlviuqLBxIVGPcPgRrOVSRb8h/N+xW0t9L/6gDxUZ43VReyNI= X-Received: by 10.66.245.140 with SMTP id xo12mr2703417pac.38.1412294606350; Thu, 02 Oct 2014 17:03:26 -0700 (PDT) X-Received: by 10.66.245.140 with SMTP id xo12mr2703408pac.38.1412294606295; Thu, 02 Oct 2014 17:03:26 -0700 (PDT) Received: from svdclab-13-11.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id pp2sm4966591pbc.66.2014.10.02.17.03.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Oct 2014 17:03:25 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 6/6] drivers: net: xgene: Add 10GbE ethtool support Date: Thu, 2 Oct 2014 17:02:48 -0700 Message-Id: <1412294568-26747-7-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412294568-26747-1-git-send-email-isubramanian@apm.com> References: <1412294568-26747-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141002_170347_532223_2D2A152C X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.3 (--) Cc: kchudgar@apm.com, patches@apm.com, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Iyappan Subramanian Signed-off-by: Keyur Chudgar --- .../net/ethernet/apm/xgene/xgene_enet_ethtool.c | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c index 63f2aa5..c1c997b 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c @@ -59,10 +59,22 @@ static int xgene_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd) struct xgene_enet_pdata *pdata = netdev_priv(ndev); struct phy_device *phydev = pdata->phy_dev; - if (phydev == NULL) - return -ENODEV; + if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) { + if (phydev == NULL) + return -ENODEV; - return phy_ethtool_gset(phydev, cmd); + return phy_ethtool_gset(phydev, cmd); + } + + cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE; + cmd->advertising = cmd->supported; + ethtool_cmd_speed_set(cmd, SPEED_10000); + cmd->duplex = DUPLEX_FULL; + cmd->port = PORT_FIBRE; + cmd->transceiver = XCVR_EXTERNAL; + cmd->autoneg = AUTONEG_DISABLE; + + return 0; } static int xgene_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd) @@ -70,10 +82,14 @@ static int xgene_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd) struct xgene_enet_pdata *pdata = netdev_priv(ndev); struct phy_device *phydev = pdata->phy_dev; - if (phydev == NULL) - return -ENODEV; + if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) { + if (phydev == NULL) + return -ENODEV; + + return phy_ethtool_sset(phydev, cmd); + } - return phy_ethtool_sset(phydev, cmd); + return -EINVAL; } static void xgene_get_strings(struct net_device *ndev, u32 stringset, u8 *data)