summaryrefslogtreecommitdiff
path: root/drivers/s390/net/qeth_l3_sys.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-04-19 00:43:20 +0000
committerDavid S. Miller <davem@davemloft.net>2011-04-20 01:30:42 -0700
commit6204b47ec4394f7e472885c8d05d9cda96d97a25 (patch)
tree887f57b02c53cc2cf0f7c6365978747474133bbe /drivers/s390/net/qeth_l3_sys.c
parentdd6f6d024906b8f05a0832c78c16a1e818958321 (diff)
net: s390: convert to hw_features
options.large_send was easy to get rid of. options.checksum_type has deeper roots so is left for later cleanup. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l3_sys.c')
-rw-r--r--drivers/s390/net/qeth_l3_sys.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 67cfa68dcf1b..bf9f003e3a97 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -410,39 +410,42 @@ static ssize_t qeth_l3_dev_large_send_show(struct device *dev,
if (!card)
return -EINVAL;
- switch (card->options.large_send) {
- case QETH_LARGE_SEND_NO:
+ if (!(card->dev->features & NETIF_F_TSO))
return sprintf(buf, "%s\n", "no");
- case QETH_LARGE_SEND_TSO:
+ else
return sprintf(buf, "%s\n", "TSO");
- default:
- return sprintf(buf, "%s\n", "N/A");
- }
}
static ssize_t qeth_l3_dev_large_send_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- struct qeth_card *card = dev_get_drvdata(dev);
- enum qeth_large_send_types type;
- int rc = 0;
+ struct qeth_card *card;
char *tmp;
+ int enable;
if (!card)
return -EINVAL;
tmp = strsep((char **) &buf, "\n");
if (!strcmp(tmp, "no"))
- type = QETH_LARGE_SEND_NO;
+ enable = 0;
else if (!strcmp(tmp, "TSO"))
- type = QETH_LARGE_SEND_TSO;
+ enable = 1;
else
return -EINVAL;
- mutex_lock(&card->conf_mutex);
- if (card->options.large_send != type)
- rc = qeth_l3_set_large_send(card, type);
- mutex_unlock(&card->conf_mutex);
- return rc ? rc : count;
+ rtnl_lock();
+
+ card = dev_get_drvdata(dev);
+
+ if (enable)
+ card->dev->wanted_features |= NETIF_F_TSO;
+ else
+ card->dev->wanted_features &= ~NETIF_F_TSO;
+ netdev_update_features(card->dev);
+
+ rtnl_unlock();
+
+ return count;
}
static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show,