From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>, linux-driver@qlogic.com
Cc: netdev@vger.kernel.org
Subject: [PATCH 3/3] qla3xxx: ethtool ops for controlling checksum
Date: Wed, 30 May 2007 14:23:19 -0700 [thread overview]
Message-ID: <20070530212512.267956457@linux-foundation.org> (raw)
In-Reply-To: 20070530212316.407169588@linux-foundation.org
[-- Attachment #1: qla-ethtool-ops.patch --]
[-- Type: text/plain, Size: 1670 bytes --]
Add the ability to control scatter/gather and checksumming
via ethtool.
Compile tested only, no hardware available.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
drivers/net/qla3xxx.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
--- a/drivers/net/qla3xxx.c 2007-05-30 14:10:42.000000000 -0700
+++ b/drivers/net/qla3xxx.c 2007-05-30 14:15:37.000000000 -0700
@@ -1901,6 +1901,35 @@ static void ql_get_pauseparam(struct net
pause->tx_pause = (reg & MAC_CONFIG_REG_TF) >> 1;
}
+static int ql_set_tx_csum(struct net_device *dev, u32 data)
+{
+ if (data) {
+ struct ql3_adapter *qdev = netdev_priv(ndev);
+
+ if (qdev->device_id != QL3032_DEVICE_ID)
+ return -EINVAL;
+
+ dev->features |= NETIF_F_IP_CSUM;
+ } else
+ dev->features &= ~NETIF_F_IP_CSUM;
+
+ return 0;
+}
+
+static int ql_set_sg(struct net_device *dev, u32 data)
+{
+ if (data) {
+ struct ql3_adapter *qdev = netdev_priv(ndev);
+
+ if (qdev->device_id != QL3032_DEVICE_ID)
+ return -EINVAL;
+ dev->features |= NETIF_F_SG;
+ } else
+ dev->features &= ~NETIF_F_SG;
+
+ return 0;
+}
+
static const struct ethtool_ops ql3xxx_ethtool_ops = {
.get_settings = ql_get_settings,
.get_drvinfo = ql_get_drvinfo,
@@ -1909,6 +1938,10 @@ static const struct ethtool_ops ql3xxx_e
.get_msglevel = ql_get_msglevel,
.set_msglevel = ql_set_msglevel,
.get_pauseparam = ql_get_pauseparam,
+ .get_tx_csum = ql_op_get_tx_csum,
+ .set_tx_csum = ethtool_op_set_tx_csum,
+ .get_sg = ethtool_op_get_sg,
+ .set_sg = ql_get_sg,
};
static int ql_populate_free_queue(struct ql3_adapter *qdev)
--
Stephen Hemminger <shemminger@linux-foundation.org>
prev parent reply other threads:[~2007-05-30 21:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-30 21:23 [PATCH 0/3] qla3xxx checksum related patches Stephen Hemminger
2007-05-30 21:23 ` [PATCH 1/3] qla3xxx: device doesnt do hardware checksumming Stephen Hemminger
2007-06-03 15:46 ` Jeff Garzik
2007-05-30 21:23 ` [PATCH 2/3] qla3xxx: cleanup checksum offload code Stephen Hemminger
2007-06-06 23:23 ` Ron Mercer
2007-06-13 19:43 ` Jeff Garzik
2007-06-13 19:55 ` Ron Mercer
2007-06-13 20:04 ` Jeff Garzik
2007-05-30 21:23 ` Stephen Hemminger [this message]
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=20070530212512.267956457@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=linux-driver@qlogic.com \
--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).