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: 398422 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 09EF414010F for ; Fri, 10 Oct 2014 12:32:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751369AbaJJBc2 (ORCPT ); Thu, 9 Oct 2014 21:32:28 -0400 Received: from exprod5og112.obsmtp.com ([64.18.0.24]:48251 "HELO exprod5og112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751287AbaJJBcK (ORCPT ); Thu, 9 Oct 2014 21:32:10 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]) (using TLSv1) by exprod5ob112.postini.com ([64.18.4.12]) with SMTP ID DSNKVDc3GkcGGKFQp81oNLaIo9wsKDWABdzM@postini.com; Thu, 09 Oct 2014 18:32:10 PDT Received: by mail-pa0-f43.google.com with SMTP id lf10so739174pab.30 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=ALzUioi6AfmKsGFFB1AJKvhL3qQ7+4F9v67Y3461acEAUUbGpg2JP+razmFwFgnF2f VQ2ZMEfhcI5f7IWXZahV6XvftiPN4EnJPk3dSQ2Jxpme/MVRgLbIywIJIPNuoXY3mDtg bNP1wqpctmvguOB8/jmrCkxD//87RrUNvrMKO3JzdYdxehKuT7HBoNwna2usCia14sdh Hv+Vzi7fKvPWWDWgzrbXI/krq18sxDt0Ffk2vcgr3VFJRQ6xHuX8hsyNLUsYEbsF7eAL QmoCurHzJCpyzO1QPWVq47Si3jRyAHpIUi5kcEDj1Hpa+ioS0OYN90y9hLI/DHYMbw2Z ktaw== X-Gm-Message-State: ALoCoQkJ6xUMumTGyk93xQdqwUbUfpS5hpnER/hc3H06cMUNWQ21PlSvcUx/t5pVIlMUR230wqSNsEFxtVu7EoaOFzQVm5XSx52XRpk/C0tmc+GRhHkqHO+QUr1IOJiG09+Vh6MevyNcq7Z/hcsQDofGG8ut3v/3SQ== X-Received: by 10.70.48.238 with SMTP id p14mr1754190pdn.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 Cc: linux-arm-kernel@lists.infradead.org, patches@apm.com, kchudgar@apm.com, Iyappan Subramanian 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> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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)