From patchwork Thu Oct 9 03:54:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 5056281 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 82F6AC11AB for ; Thu, 9 Oct 2014 03:57:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A91BD20155 for ; Thu, 9 Oct 2014 03:57:42 +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 CFAD220158 for ; Thu, 9 Oct 2014 03:57:41 +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 1Xc4pA-0007n4-BY; Thu, 09 Oct 2014 03:55:32 +0000 Received: from exprod5og117.obsmtp.com ([64.18.0.149]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xc4oJ-0006G8-M7 for linux-arm-kernel@lists.infradead.org; Thu, 09 Oct 2014 03:54:40 +0000 Received: from mail-ig0-f177.google.com ([209.85.213.177]) (using TLSv1) by exprod5ob117.postini.com ([64.18.4.12]) with SMTP ID DSNKVDYG7vmIF7adozIJAgQ0k4eATs3hCMtR@postini.com; Wed, 08 Oct 2014 20:54:39 PDT Received: by mail-ig0-f177.google.com with SMTP id a13so1818755igq.10 for ; Wed, 08 Oct 2014 20:54:22 -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=KyvVioetQQokiIuQyy7WwtoiwSONVejwVvXfBJYSdj/eeHPziag1+tCSownX3bT9rP vEFiAd9NcofbgmyABffHvKo2UktXDTJHF7PKTFDKp8UFDcsNlp0Qdx/lkFib1eV1cJV9 W0fMOgN3p8CLsBGfb9TbpPKcVFbYEiTWPMhjns5Cv6qZ+0HUmz3krLaY6I6XZhyjHh9M Dkh1AWh+jOw0uz+o53ky40S7BEbMxnTqdASotCAKPEW+EUSWKVMJitwLtDi48FybrBIg GT+fqnDxNpvBAGHwn4ET4z7o6b5PUVNwQqyIRbOU4gLCcB5lCu0WDVwohX0NBimfEg5A 78oQ== X-Gm-Message-State: ALoCoQlXLd0KkLbua4g6xipg+36scJXRezah1iw+4WUQgwj6C9XjK1nnFKRDP2L99bspZ2NFnchnqrt29Vf+WbrKGhLxRmmhRiAybHO1RPwTSG0f5LXGFgxfVHF8/39MFFdROQI5WtZqcs6nNJAmxmauQB9gzJ1AXF9Y01wdBmalvd3VeNNM6Oc= X-Received: by 10.42.84.9 with SMTP id j9mr3664176icl.60.1412826862046; Wed, 08 Oct 2014 20:54:22 -0700 (PDT) X-Received: by 10.42.84.9 with SMTP id j9mr3664167icl.60.1412826861970; Wed, 08 Oct 2014 20:54:21 -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 p5sm4325958iga.5.2014.10.08.20.54.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Oct 2014 20:54:21 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 6/6] drivers: net: xgene: Add 10GbE ethtool support Date: Wed, 8 Oct 2014 20:54:21 -0700 Message-Id: <1412826861-32208-7-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412826861-32208-1-git-send-email-isubramanian@apm.com> References: <1412826861-32208-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141008_205439_782074_B24D6205 X-CRM114-Status: GOOD ( 12.25 ) 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_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)