aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l3_sys.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-04-18 20:43:20 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-20 04:30:42 -0400
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,
410 if (!card) 410 if (!card)
411 return -EINVAL; 411 return -EINVAL;
412 412
413 switch (card->options.large_send) { 413 if (!(card->dev->features & NETIF_F_TSO))
414 case QETH_LARGE_SEND_NO:
415 return sprintf(buf, "%s\n", "no"); 414 return sprintf(buf, "%s\n", "no");
416 case QETH_LARGE_SEND_TSO: 415 else
417 return sprintf(buf, "%s\n", "TSO"); 416 return sprintf(buf, "%s\n", "TSO");
418 default:
419 return sprintf(buf, "%s\n", "N/A");
420 }
421} 417}
422 418
423static ssize_t qeth_l3_dev_large_send_store(struct device *dev, 419static ssize_t qeth_l3_dev_large_send_store(struct device *dev,
424 struct device_attribute *attr, const char *buf, size_t count) 420 struct device_attribute *attr, const char *buf, size_t count)
425{ 421{
426 struct qeth_card *card = dev_get_drvdata(dev); 422 struct qeth_card *card;
427 enum qeth_large_send_types type;
428 int rc = 0;
429 char *tmp; 423 char *tmp;
424 int enable;
430 425
431 if (!card) 426 if (!card)
432 return -EINVAL; 427 return -EINVAL;
433 tmp = strsep((char **) &buf, "\n"); 428 tmp = strsep((char **) &buf, "\n");
434 if (!strcmp(tmp, "no")) 429 if (!strcmp(tmp, "no"))
435 type = QETH_LARGE_SEND_NO; 430 enable = 0;
436 else if (!strcmp(tmp, "TSO")) 431 else if (!strcmp(tmp, "TSO"))
437 type = QETH_LARGE_SEND_TSO; 432 enable = 1;
438 else 433 else
439 return -EINVAL; 434 return -EINVAL;
440 435
441 mutex_lock(&card->conf_mutex); 436 rtnl_lock();
442 if (card->options.large_send != type) 437
443 rc = qeth_l3_set_large_send(card, type); 438 card = dev_get_drvdata(dev);
444 mutex_unlock(&card->conf_mutex); 439
445 return rc ? rc : count; 440 if (enable)
441 card->dev->wanted_features |= NETIF_F_TSO;
442 else
443 card->dev->wanted_features &= ~NETIF_F_TSO;
444 netdev_update_features(card->dev);
445
446 rtnl_unlock();
447
448 return count;
446} 449}
447 450
448static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show, 451static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show,