From: frank.blaschka@de.ibm.com
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [patch 06/11] qeth: provide get ethtool settings
Date: Thu, 24 Apr 2008 10:15:23 +0200 [thread overview]
Message-ID: <20080424081905.582382000@de.ibm.com> (raw)
In-Reply-To: 20080424081517.987104000@de.ibm.com
[-- Attachment #1: 705-qeth-ethtool.diff --]
[-- Type: text/plain, Size: 5407 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
Load balancing bonding queries the speed of the slave interfaces.
To support a bond consisting of different slave speeds we have to
report the speed by ethtool settings.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core.h | 1
drivers/s390/net/qeth_core_main.c | 90 ++++++++++++++++++++++++++++++++++++++
drivers/s390/net/qeth_l2_main.c | 1
drivers/s390/net/qeth_l3_main.c | 1
4 files changed, 93 insertions(+)
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
--- linux-2.6/drivers/s390/net/qeth_core.h 2008-04-23 17:55:50.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_core.h 2008-04-23 17:55:51.000000000 +0200
@@ -880,6 +880,7 @@ void qeth_core_get_ethtool_stats(struct
void qeth_core_get_strings(struct net_device *, u32, u8 *);
void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...);
+int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *);
/* exports for OSN */
int qeth_osn_assist(struct net_device *, void *, int);
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
--- linux-2.6/drivers/s390/net/qeth_core_main.c 2008-04-23 17:55:50.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_core_main.c 2008-04-23 17:55:51.000000000 +0200
@@ -4423,6 +4423,96 @@ void qeth_core_get_drvinfo(struct net_de
}
EXPORT_SYMBOL_GPL(qeth_core_get_drvinfo);
+int qeth_core_ethtool_get_settings(struct net_device *netdev,
+ struct ethtool_cmd *ecmd)
+{
+ struct qeth_card *card = netdev_priv(netdev);
+ enum qeth_link_types link_type;
+
+ if ((card->info.type == QETH_CARD_TYPE_IQD) || (card->info.guestlan))
+ link_type = QETH_LINK_TYPE_10GBIT_ETH;
+ else
+ link_type = card->info.link_type;
+
+ ecmd->transceiver = XCVR_INTERNAL;
+ ecmd->supported = SUPPORTED_Autoneg;
+ ecmd->advertising = ADVERTISED_Autoneg;
+ ecmd->duplex = DUPLEX_FULL;
+ ecmd->autoneg = AUTONEG_ENABLE;
+
+ switch (link_type) {
+ case QETH_LINK_TYPE_FAST_ETH:
+ case QETH_LINK_TYPE_LANE_ETH100:
+ ecmd->supported |= SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_TP;
+ ecmd->advertising |= ADVERTISED_10baseT_Half |
+ ADVERTISED_10baseT_Full |
+ ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_TP;
+ ecmd->speed = SPEED_100;
+ ecmd->port = PORT_TP;
+ break;
+
+ case QETH_LINK_TYPE_GBIT_ETH:
+ case QETH_LINK_TYPE_LANE_ETH1000:
+ ecmd->supported |= SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full |
+ SUPPORTED_FIBRE;
+ ecmd->advertising |= ADVERTISED_10baseT_Half |
+ ADVERTISED_10baseT_Full |
+ ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full |
+ ADVERTISED_FIBRE;
+ ecmd->speed = SPEED_1000;
+ ecmd->port = PORT_FIBRE;
+ break;
+
+ case QETH_LINK_TYPE_10GBIT_ETH:
+ ecmd->supported |= SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full |
+ SUPPORTED_10000baseT_Full |
+ SUPPORTED_FIBRE;
+ ecmd->advertising |= ADVERTISED_10baseT_Half |
+ ADVERTISED_10baseT_Full |
+ ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full |
+ ADVERTISED_10000baseT_Full |
+ ADVERTISED_FIBRE;
+ ecmd->speed = SPEED_10000;
+ ecmd->port = PORT_FIBRE;
+ break;
+
+ default:
+ ecmd->supported |= SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_TP;
+ ecmd->advertising |= ADVERTISED_10baseT_Half |
+ ADVERTISED_10baseT_Full |
+ ADVERTISED_TP;
+ ecmd->speed = SPEED_10;
+ ecmd->port = PORT_TP;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(qeth_core_ethtool_get_settings);
+
static int __init qeth_core_init(void)
{
int rc;
diff -urpN linux-2.6/drivers/s390/net/qeth_l2_main.c linux-2.6-patched/drivers/s390/net/qeth_l2_main.c
--- linux-2.6/drivers/s390/net/qeth_l2_main.c 2008-04-23 17:55:50.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_l2_main.c 2008-04-23 17:55:51.000000000 +0200
@@ -861,6 +861,7 @@ static struct ethtool_ops qeth_l2_ethtoo
.get_ethtool_stats = qeth_core_get_ethtool_stats,
.get_stats_count = qeth_core_get_stats_count,
.get_drvinfo = qeth_core_get_drvinfo,
+ .get_settings = qeth_core_ethtool_get_settings,
};
static struct ethtool_ops qeth_l2_osn_ops = {
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
--- linux-2.6/drivers/s390/net/qeth_l3_main.c 2008-04-23 17:55:51.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_l3_main.c 2008-04-23 17:55:51.000000000 +0200
@@ -2889,6 +2889,7 @@ static struct ethtool_ops qeth_l3_ethtoo
.get_ethtool_stats = qeth_core_get_ethtool_stats,
.get_stats_count = qeth_core_get_stats_count,
.get_drvinfo = qeth_core_get_drvinfo,
+ .get_settings = qeth_core_ethtool_get_settings,
};
/*
--
next prev parent reply other threads:[~2008-04-24 8:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 8:15 [patch 00/11] s390: network device driver fixes for 2.6.26 frank.blaschka
2008-04-24 8:15 ` [patch 01/11] lcs: CCL-sequ. numbers required for protocol 802.2 only frank.blaschka
2008-04-29 5:59 ` Jeff Garzik
2008-04-24 8:15 ` [patch 02/11] netiucv: get rid of in_atomic() use frank.blaschka
2008-04-24 8:15 ` [patch 03/11] ccwgroup: Unify parsing for group attribute frank.blaschka
2008-04-24 8:15 ` [patch 04/11] qeth module size reduction frank.blaschka
2008-04-24 8:15 ` [patch 05/11] qeth: layer 3 support vlan IPv6 on hiper socket frank.blaschka
2008-04-24 8:15 ` frank.blaschka [this message]
2008-04-24 8:15 ` [patch 07/11] qeth: rework fast path frank.blaschka
2008-04-24 8:15 ` [patch 08/11] qeth: layer 3 add missing dev_open/close to ccwgroup handler frank.blaschka
2008-04-24 8:15 ` [patch 09/11] qeth: read number of ports from card frank.blaschka
2008-04-24 8:15 ` [patch 10/11] qeth: layer 2 allow ethtool to set TSO frank.blaschka
2008-04-24 8:15 ` [patch 11/11] netiucv: Fix missing driver attributes frank.blaschka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080424081905.582382000@de.ibm.com \
--to=frank.blaschka@de.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).