aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l3_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_l3_sys.c')
-rw-r--r--drivers/s390/net/qeth_l3_sys.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 67cfa68dcf1b..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) \
16struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store) 16struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)
17 17
18static 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
28static ssize_t qeth_l3_dev_route_show(struct qeth_card *card, 18static 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:
295static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show, 285static 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
298static 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
310static 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);
335out:
336 mutex_unlock(&card->conf_mutex);
337 return rc ? rc : count;
338}
339
340static DEVICE_ATTR(checksumming, 0644, qeth_l3_dev_checksum_show,
341 qeth_l3_dev_checksum_store);
342
343static ssize_t qeth_l3_dev_sniffer_show(struct device *dev, 288static 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,61 +347,13 @@ out:
402static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show, 347static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show,
403 qeth_l3_dev_sniffer_store); 348 qeth_l3_dev_sniffer_store);
404 349
405static 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 switch (card->options.large_send) {
414 case QETH_LARGE_SEND_NO:
415 return sprintf(buf, "%s\n", "no");
416 case QETH_LARGE_SEND_TSO:
417 return sprintf(buf, "%s\n", "TSO");
418 default:
419 return sprintf(buf, "%s\n", "N/A");
420 }
421}
422
423static ssize_t qeth_l3_dev_large_send_store(struct device *dev,
424 struct device_attribute *attr, const char *buf, size_t count)
425{
426 struct qeth_card *card = dev_get_drvdata(dev);
427 enum qeth_large_send_types type;
428 int rc = 0;
429 char *tmp;
430
431 if (!card)
432 return -EINVAL;
433 tmp = strsep((char **) &buf, "\n");
434 if (!strcmp(tmp, "no"))
435 type = QETH_LARGE_SEND_NO;
436 else if (!strcmp(tmp, "TSO"))
437 type = QETH_LARGE_SEND_TSO;
438 else
439 return -EINVAL;
440
441 mutex_lock(&card->conf_mutex);
442 if (card->options.large_send != type)
443 rc = qeth_l3_set_large_send(card, type);
444 mutex_unlock(&card->conf_mutex);
445 return rc ? rc : count;
446}
447
448static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show,
449 qeth_l3_dev_large_send_store);
450
451static struct attribute *qeth_l3_device_attrs[] = { 350static struct attribute *qeth_l3_device_attrs[] = {
452 &dev_attr_route4.attr, 351 &dev_attr_route4.attr,
453 &dev_attr_route6.attr, 352 &dev_attr_route6.attr,
454 &dev_attr_fake_broadcast.attr, 353 &dev_attr_fake_broadcast.attr,
455 &dev_attr_broadcast_mode.attr, 354 &dev_attr_broadcast_mode.attr,
456 &dev_attr_canonical_macaddr.attr, 355 &dev_attr_canonical_macaddr.attr,
457 &dev_attr_checksumming.attr,
458 &dev_attr_sniffer.attr, 356 &dev_attr_sniffer.attr,
459 &dev_attr_large_send.attr,
460 NULL, 357 NULL,
461}; 358};
462 359