From patchwork Fri Oct 10 01:32:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 5063211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A6C3A9F295 for ; Fri, 10 Oct 2014 01:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B32B20364 for ; Fri, 10 Oct 2014 01:36:07 +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 6A2D120204 for ; Fri, 10 Oct 2014 01:36:03 +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 1XcP5e-0005pQ-RY; Fri, 10 Oct 2014 01:33:54 +0000 Received: from exprod5og120.obsmtp.com ([64.18.0.137]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcP4K-0004sS-Dp for linux-arm-kernel@lists.infradead.org; Fri, 10 Oct 2014 01:32:33 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) (using TLSv1) by exprod5ob120.postini.com ([64.18.4.12]) with SMTP ID DSNKVDc3GkcGGKFQp81oNLaIo9wsKDWABdzM@postini.com; Thu, 09 Oct 2014 18:32:32 PDT Received: by mail-pa0-f52.google.com with SMTP id fb1so748236pad.11 for ; Thu, 09 Oct 2014 18:32:10 -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=jU227wjoja/sOwCo0VR/9XLOJ61CXMQ5FgbBn7mBolxq4oKOuOh+Ux2oLm3ZTD0XRg 9tMczrsFQ75xwOmOydMlSnk7kF82MIBi8kjNIfa16JVQdUEdEO2GJwwfAS4TSc1RzEps jsy0mIZq+OBZeCdIvi902Y8kzTiWnC6TMUO3m3Yt51h9svtaS6aCHNwXaKuxV8iYUzdP nl5rdtekorfnUmkRZg5ZsppL4R3wEzgiwXYZS9yPuK0rvXHbttqxFwcL4wNCwd2ZvjqX wvHDcknQ2IYv1QCcwtB1XZMd+GzbmuMDkZkTtvHBFUBme4AJM2wu38mTTgKzEYyymsPx +6RQ== X-Gm-Message-State: ALoCoQn643wEv834uYzDoSGzAN6IHfGOQ3/4FO7rXhKCT8qJE2VaCuyr1uIyhViJETDiDJcUQ1g74kUSHiohy62PXMm2vuEMr2Sxda/jijUBpdaPk2ja91TjSv+BBpO1S/+AJqvo1QByI3NLKbHNxcq3JBmfz0RkjPe6GVLIPfC50B4HdC8yCQw= X-Received: by 10.70.48.238 with SMTP id p14mr1754191pdn.88.1412904729998; Thu, 09 Oct 2014 18:32:09 -0700 (PDT) X-Received: by 10.70.48.238 with SMTP id p14mr1754181pdn.88.1412904729918; Thu, 09 Oct 2014 18:32:09 -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 a1sm1686537pdc.68.2014.10.09.18.32.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Oct 2014 18:32:08 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 6/6] drivers: net: xgene: Add 10GbE ethtool support Date: Thu, 9 Oct 2014 18:32:07 -0700 Message-Id: <1412904727-23485-7-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412904727-23485-1-git-send-email-isubramanian@apm.com> References: <1412904727-23485-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141009_183232_506434_F0727F09 X-CRM114-Status: GOOD ( 12.69 ) 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)