diff options
Diffstat (limited to 'drivers/s390/net/qeth_l3_sys.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_sys.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index bf9f003e3a97..cd99210296e2 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c | |||
@@ -15,16 +15,6 @@ | |||
15 | #define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \ | 15 | #define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \ |
16 | struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store) | 16 | struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store) |
17 | 17 | ||
18 | static const char *qeth_l3_get_checksum_str(struct qeth_card *card) | ||
19 | { | ||
20 | if (card->options.checksum_type == SW_CHECKSUMMING) | ||
21 | return "sw"; | ||
22 | else if (card->options.checksum_type == HW_CHECKSUMMING) | ||
23 | return "hw"; | ||
24 | else | ||
25 | return "no"; | ||
26 | } | ||
27 | |||
28 | static ssize_t qeth_l3_dev_route_show(struct qeth_card *card, | 18 | static ssize_t qeth_l3_dev_route_show(struct qeth_card *card, |
29 | struct qeth_routing_info *route, char *buf) | 19 | struct qeth_routing_info *route, char *buf) |
30 | { | 20 | { |
@@ -295,51 +285,6 @@ out: | |||
295 | static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show, | 285 | static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show, |
296 | qeth_l3_dev_canonical_macaddr_store); | 286 | qeth_l3_dev_canonical_macaddr_store); |
297 | 287 | ||
298 | static ssize_t qeth_l3_dev_checksum_show(struct device *dev, | ||
299 | struct device_attribute *attr, char *buf) | ||
300 | { | ||
301 | struct qeth_card *card = dev_get_drvdata(dev); | ||
302 | |||
303 | if (!card) | ||
304 | return -EINVAL; | ||
305 | |||
306 | return sprintf(buf, "%s checksumming\n", | ||
307 | qeth_l3_get_checksum_str(card)); | ||
308 | } | ||
309 | |||
310 | static ssize_t qeth_l3_dev_checksum_store(struct device *dev, | ||
311 | struct device_attribute *attr, const char *buf, size_t count) | ||
312 | { | ||
313 | struct qeth_card *card = dev_get_drvdata(dev); | ||
314 | enum qeth_checksum_types csum_type; | ||
315 | char *tmp; | ||
316 | int rc = 0; | ||
317 | |||
318 | if (!card) | ||
319 | return -EINVAL; | ||
320 | |||
321 | mutex_lock(&card->conf_mutex); | ||
322 | tmp = strsep((char **) &buf, "\n"); | ||
323 | if (!strcmp(tmp, "sw_checksumming")) | ||
324 | csum_type = SW_CHECKSUMMING; | ||
325 | else if (!strcmp(tmp, "hw_checksumming")) | ||
326 | csum_type = HW_CHECKSUMMING; | ||
327 | else if (!strcmp(tmp, "no_checksumming")) | ||
328 | csum_type = NO_CHECKSUMMING; | ||
329 | else { | ||
330 | rc = -EINVAL; | ||
331 | goto out; | ||
332 | } | ||
333 | |||
334 | rc = qeth_l3_set_rx_csum(card, csum_type); | ||
335 | out: | ||
336 | mutex_unlock(&card->conf_mutex); | ||
337 | return rc ? rc : count; | ||
338 | } | ||
339 | |||
340 | static DEVICE_ATTR(checksumming, 0644, qeth_l3_dev_checksum_show, | ||
341 | qeth_l3_dev_checksum_store); | ||
342 | |||
343 | static ssize_t qeth_l3_dev_sniffer_show(struct device *dev, | 288 | static ssize_t qeth_l3_dev_sniffer_show(struct device *dev, |
344 | struct device_attribute *attr, char *buf) | 289 | struct device_attribute *attr, char *buf) |
345 | { | 290 | { |
@@ -402,64 +347,13 @@ out: | |||
402 | static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show, | 347 | static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show, |
403 | qeth_l3_dev_sniffer_store); | 348 | qeth_l3_dev_sniffer_store); |
404 | 349 | ||
405 | static ssize_t qeth_l3_dev_large_send_show(struct device *dev, | ||
406 | struct device_attribute *attr, char *buf) | ||
407 | { | ||
408 | struct qeth_card *card = dev_get_drvdata(dev); | ||
409 | |||
410 | if (!card) | ||
411 | return -EINVAL; | ||
412 | |||
413 | if (!(card->dev->features & NETIF_F_TSO)) | ||
414 | return sprintf(buf, "%s\n", "no"); | ||
415 | else | ||
416 | return sprintf(buf, "%s\n", "TSO"); | ||
417 | } | ||
418 | |||
419 | static ssize_t qeth_l3_dev_large_send_store(struct device *dev, | ||
420 | struct device_attribute *attr, const char *buf, size_t count) | ||
421 | { | ||
422 | struct qeth_card *card; | ||
423 | char *tmp; | ||
424 | int enable; | ||
425 | |||
426 | if (!card) | ||
427 | return -EINVAL; | ||
428 | tmp = strsep((char **) &buf, "\n"); | ||
429 | if (!strcmp(tmp, "no")) | ||
430 | enable = 0; | ||
431 | else if (!strcmp(tmp, "TSO")) | ||
432 | enable = 1; | ||
433 | else | ||
434 | return -EINVAL; | ||
435 | |||
436 | rtnl_lock(); | ||
437 | |||
438 | card = dev_get_drvdata(dev); | ||
439 | |||
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; | ||
449 | } | ||
450 | |||
451 | static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show, | ||
452 | qeth_l3_dev_large_send_store); | ||
453 | |||
454 | static struct attribute *qeth_l3_device_attrs[] = { | 350 | static struct attribute *qeth_l3_device_attrs[] = { |
455 | &dev_attr_route4.attr, | 351 | &dev_attr_route4.attr, |
456 | &dev_attr_route6.attr, | 352 | &dev_attr_route6.attr, |
457 | &dev_attr_fake_broadcast.attr, | 353 | &dev_attr_fake_broadcast.attr, |
458 | &dev_attr_broadcast_mode.attr, | 354 | &dev_attr_broadcast_mode.attr, |
459 | &dev_attr_canonical_macaddr.attr, | 355 | &dev_attr_canonical_macaddr.attr, |
460 | &dev_attr_checksumming.attr, | ||
461 | &dev_attr_sniffer.attr, | 356 | &dev_attr_sniffer.attr, |
462 | &dev_attr_large_send.attr, | ||
463 | NULL, | 357 | NULL, |
464 | }; | 358 | }; |
465 | 359 | ||