aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_sys.c')
-rw-r--r--drivers/s390/net/qeth_sys.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index c1f3187f37ea..5836737ac58f 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -743,6 +743,47 @@ static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show,
743 qeth_dev_layer2_store); 743 qeth_dev_layer2_store);
744 744
745static ssize_t 745static ssize_t
746qeth_dev_performance_stats_show(struct device *dev, struct device_attribute *attr, char *buf)
747{
748 struct qeth_card *card = dev->driver_data;
749
750 if (!card)
751 return -EINVAL;
752
753 return sprintf(buf, "%i\n", card->options.performance_stats ? 1:0);
754}
755
756static ssize_t
757qeth_dev_performance_stats_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
758{
759 struct qeth_card *card = dev->driver_data;
760 char *tmp;
761 int i;
762
763 if (!card)
764 return -EINVAL;
765
766 i = simple_strtoul(buf, &tmp, 16);
767 if ((i == 0) || (i == 1)) {
768 if (i == card->options.performance_stats)
769 return count;
770 card->options.performance_stats = i;
771 if (i == 0)
772 memset(&card->perf_stats, 0,
773 sizeof(struct qeth_perf_stats));
774 card->perf_stats.initial_rx_packets = card->stats.rx_packets;
775 card->perf_stats.initial_tx_packets = card->stats.tx_packets;
776 } else {
777 PRINT_WARN("performance_stats: write 0 or 1 to this file!\n");
778 return -EINVAL;
779 }
780 return count;
781}
782
783static DEVICE_ATTR(performance_stats, 0644, qeth_dev_performance_stats_show,
784 qeth_dev_performance_stats_store);
785
786static ssize_t
746qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf) 787qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf)
747{ 788{
748 struct qeth_card *card = dev->driver_data; 789 struct qeth_card *card = dev->driver_data;
@@ -928,6 +969,7 @@ static struct device_attribute * qeth_device_attrs[] = {
928 &dev_attr_canonical_macaddr, 969 &dev_attr_canonical_macaddr,
929 &dev_attr_layer2, 970 &dev_attr_layer2,
930 &dev_attr_large_send, 971 &dev_attr_large_send,
972 &dev_attr_performance_stats,
931 NULL, 973 NULL,
932}; 974};
933 975