diff options
author | chavey <chavey@google.com> | 2010-04-08 00:54:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-08 00:54:42 -0400 |
commit | 97f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6 (patch) | |
tree | 0aea84f87d78183056dceb07b1eb31dc812df3a4 /net | |
parent | 8dd4bd002a32e787978fcb2be1e6ab09a3eb04ae (diff) |
net: fix ethtool coding style errors and warnings
Fix coding style errors and warnings output while running checkpatch.pl
on the files net/core/ethtool.c and include/linux/ethtool.h
Signed-off-by: chavey <chavey@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/ethtool.c | 141 |
1 files changed, 74 insertions, 67 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 73c81edde8d9..99e9f850ea07 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/ethtool.h> | 18 | #include <linux/ethtool.h> |
19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <asm/uaccess.h> | 21 | #include <linux/uaccess.h> |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * Some useful ethtool_ops methods that're device independent. | 24 | * Some useful ethtool_ops methods that're device independent. |
@@ -30,6 +30,7 @@ u32 ethtool_op_get_link(struct net_device *dev) | |||
30 | { | 30 | { |
31 | return netif_carrier_ok(dev) ? 1 : 0; | 31 | return netif_carrier_ok(dev) ? 1 : 0; |
32 | } | 32 | } |
33 | EXPORT_SYMBOL(ethtool_op_get_link); | ||
33 | 34 | ||
34 | u32 ethtool_op_get_rx_csum(struct net_device *dev) | 35 | u32 ethtool_op_get_rx_csum(struct net_device *dev) |
35 | { | 36 | { |
@@ -62,6 +63,7 @@ int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data) | |||
62 | 63 | ||
63 | return 0; | 64 | return 0; |
64 | } | 65 | } |
66 | EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum); | ||
65 | 67 | ||
66 | int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) | 68 | int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) |
67 | { | 69 | { |
@@ -72,11 +74,13 @@ int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data) | |||
72 | 74 | ||
73 | return 0; | 75 | return 0; |
74 | } | 76 | } |
77 | EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum); | ||
75 | 78 | ||
76 | u32 ethtool_op_get_sg(struct net_device *dev) | 79 | u32 ethtool_op_get_sg(struct net_device *dev) |
77 | { | 80 | { |
78 | return (dev->features & NETIF_F_SG) != 0; | 81 | return (dev->features & NETIF_F_SG) != 0; |
79 | } | 82 | } |
83 | EXPORT_SYMBOL(ethtool_op_get_sg); | ||
80 | 84 | ||
81 | int ethtool_op_set_sg(struct net_device *dev, u32 data) | 85 | int ethtool_op_set_sg(struct net_device *dev, u32 data) |
82 | { | 86 | { |
@@ -87,11 +91,13 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data) | |||
87 | 91 | ||
88 | return 0; | 92 | return 0; |
89 | } | 93 | } |
94 | EXPORT_SYMBOL(ethtool_op_set_sg); | ||
90 | 95 | ||
91 | u32 ethtool_op_get_tso(struct net_device *dev) | 96 | u32 ethtool_op_get_tso(struct net_device *dev) |
92 | { | 97 | { |
93 | return (dev->features & NETIF_F_TSO) != 0; | 98 | return (dev->features & NETIF_F_TSO) != 0; |
94 | } | 99 | } |
100 | EXPORT_SYMBOL(ethtool_op_get_tso); | ||
95 | 101 | ||
96 | int ethtool_op_set_tso(struct net_device *dev, u32 data) | 102 | int ethtool_op_set_tso(struct net_device *dev, u32 data) |
97 | { | 103 | { |
@@ -102,11 +108,13 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data) | |||
102 | 108 | ||
103 | return 0; | 109 | return 0; |
104 | } | 110 | } |
111 | EXPORT_SYMBOL(ethtool_op_set_tso); | ||
105 | 112 | ||
106 | u32 ethtool_op_get_ufo(struct net_device *dev) | 113 | u32 ethtool_op_get_ufo(struct net_device *dev) |
107 | { | 114 | { |
108 | return (dev->features & NETIF_F_UFO) != 0; | 115 | return (dev->features & NETIF_F_UFO) != 0; |
109 | } | 116 | } |
117 | EXPORT_SYMBOL(ethtool_op_get_ufo); | ||
110 | 118 | ||
111 | int ethtool_op_set_ufo(struct net_device *dev, u32 data) | 119 | int ethtool_op_set_ufo(struct net_device *dev, u32 data) |
112 | { | 120 | { |
@@ -116,6 +124,7 @@ int ethtool_op_set_ufo(struct net_device *dev, u32 data) | |||
116 | dev->features &= ~NETIF_F_UFO; | 124 | dev->features &= ~NETIF_F_UFO; |
117 | return 0; | 125 | return 0; |
118 | } | 126 | } |
127 | EXPORT_SYMBOL(ethtool_op_set_ufo); | ||
119 | 128 | ||
120 | /* the following list of flags are the same as their associated | 129 | /* the following list of flags are the same as their associated |
121 | * NETIF_F_xxx values in include/linux/netdevice.h | 130 | * NETIF_F_xxx values in include/linux/netdevice.h |
@@ -132,6 +141,7 @@ u32 ethtool_op_get_flags(struct net_device *dev) | |||
132 | 141 | ||
133 | return dev->features & flags_dup_features; | 142 | return dev->features & flags_dup_features; |
134 | } | 143 | } |
144 | EXPORT_SYMBOL(ethtool_op_get_flags); | ||
135 | 145 | ||
136 | int ethtool_op_set_flags(struct net_device *dev, u32 data) | 146 | int ethtool_op_set_flags(struct net_device *dev, u32 data) |
137 | { | 147 | { |
@@ -160,6 +170,7 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data) | |||
160 | dev->features = features; | 170 | dev->features = features; |
161 | return 0; | 171 | return 0; |
162 | } | 172 | } |
173 | EXPORT_SYMBOL(ethtool_op_set_flags); | ||
163 | 174 | ||
164 | void ethtool_ntuple_flush(struct net_device *dev) | 175 | void ethtool_ntuple_flush(struct net_device *dev) |
165 | { | 176 | { |
@@ -205,7 +216,8 @@ static int ethtool_set_settings(struct net_device *dev, void __user *useraddr) | |||
205 | return dev->ethtool_ops->set_settings(dev, &cmd); | 216 | return dev->ethtool_ops->set_settings(dev, &cmd); |
206 | } | 217 | } |
207 | 218 | ||
208 | static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr) | 219 | static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, |
220 | void __user *useraddr) | ||
209 | { | 221 | { |
210 | struct ethtool_drvinfo info; | 222 | struct ethtool_drvinfo info; |
211 | const struct ethtool_ops *ops = dev->ethtool_ops; | 223 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -245,7 +257,7 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void _ | |||
245 | } | 257 | } |
246 | 258 | ||
247 | static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, | 259 | static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, |
248 | void __user *useraddr) | 260 | void __user *useraddr) |
249 | { | 261 | { |
250 | struct ethtool_sset_info info; | 262 | struct ethtool_sset_info info; |
251 | const struct ethtool_ops *ops = dev->ethtool_ops; | 263 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -304,7 +316,8 @@ out: | |||
304 | return ret; | 316 | return ret; |
305 | } | 317 | } |
306 | 318 | ||
307 | static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, void __user *useraddr) | 319 | static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, |
320 | void __user *useraddr) | ||
308 | { | 321 | { |
309 | struct ethtool_rxnfc cmd; | 322 | struct ethtool_rxnfc cmd; |
310 | 323 | ||
@@ -317,7 +330,8 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, void __u | |||
317 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); | 330 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); |
318 | } | 331 | } |
319 | 332 | ||
320 | static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr) | 333 | static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, |
334 | void __user *useraddr) | ||
321 | { | 335 | { |
322 | struct ethtool_rxnfc info; | 336 | struct ethtool_rxnfc info; |
323 | const struct ethtool_ops *ops = dev->ethtool_ops; | 337 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -362,8 +376,8 @@ err_out: | |||
362 | } | 376 | } |
363 | 377 | ||
364 | static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, | 378 | static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, |
365 | struct ethtool_rx_ntuple_flow_spec *spec, | 379 | struct ethtool_rx_ntuple_flow_spec *spec, |
366 | struct ethtool_rx_ntuple_flow_spec_container *fsc) | 380 | struct ethtool_rx_ntuple_flow_spec_container *fsc) |
367 | { | 381 | { |
368 | 382 | ||
369 | /* don't add filters forever */ | 383 | /* don't add filters forever */ |
@@ -389,7 +403,8 @@ static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, | |||
389 | list->count++; | 403 | list->count++; |
390 | } | 404 | } |
391 | 405 | ||
392 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, void __user *useraddr) | 406 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, |
407 | void __user *useraddr) | ||
393 | { | 408 | { |
394 | struct ethtool_rx_ntuple cmd; | 409 | struct ethtool_rx_ntuple cmd; |
395 | const struct ethtool_ops *ops = dev->ethtool_ops; | 410 | const struct ethtool_ops *ops = dev->ethtool_ops; |
@@ -514,125 +529,125 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
514 | case UDP_V4_FLOW: | 529 | case UDP_V4_FLOW: |
515 | case SCTP_V4_FLOW: | 530 | case SCTP_V4_FLOW: |
516 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 531 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
517 | fsc->fs.h_u.tcp_ip4_spec.ip4src); | 532 | fsc->fs.h_u.tcp_ip4_spec.ip4src); |
518 | p += ETH_GSTRING_LEN; | 533 | p += ETH_GSTRING_LEN; |
519 | num_strings++; | 534 | num_strings++; |
520 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 535 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
521 | fsc->fs.m_u.tcp_ip4_spec.ip4src); | 536 | fsc->fs.m_u.tcp_ip4_spec.ip4src); |
522 | p += ETH_GSTRING_LEN; | 537 | p += ETH_GSTRING_LEN; |
523 | num_strings++; | 538 | num_strings++; |
524 | sprintf(p, "\tDest IP addr: 0x%x\n", | 539 | sprintf(p, "\tDest IP addr: 0x%x\n", |
525 | fsc->fs.h_u.tcp_ip4_spec.ip4dst); | 540 | fsc->fs.h_u.tcp_ip4_spec.ip4dst); |
526 | p += ETH_GSTRING_LEN; | 541 | p += ETH_GSTRING_LEN; |
527 | num_strings++; | 542 | num_strings++; |
528 | sprintf(p, "\tDest IP mask: 0x%x\n", | 543 | sprintf(p, "\tDest IP mask: 0x%x\n", |
529 | fsc->fs.m_u.tcp_ip4_spec.ip4dst); | 544 | fsc->fs.m_u.tcp_ip4_spec.ip4dst); |
530 | p += ETH_GSTRING_LEN; | 545 | p += ETH_GSTRING_LEN; |
531 | num_strings++; | 546 | num_strings++; |
532 | sprintf(p, "\tSrc Port: %d, mask: 0x%x\n", | 547 | sprintf(p, "\tSrc Port: %d, mask: 0x%x\n", |
533 | fsc->fs.h_u.tcp_ip4_spec.psrc, | 548 | fsc->fs.h_u.tcp_ip4_spec.psrc, |
534 | fsc->fs.m_u.tcp_ip4_spec.psrc); | 549 | fsc->fs.m_u.tcp_ip4_spec.psrc); |
535 | p += ETH_GSTRING_LEN; | 550 | p += ETH_GSTRING_LEN; |
536 | num_strings++; | 551 | num_strings++; |
537 | sprintf(p, "\tDest Port: %d, mask: 0x%x\n", | 552 | sprintf(p, "\tDest Port: %d, mask: 0x%x\n", |
538 | fsc->fs.h_u.tcp_ip4_spec.pdst, | 553 | fsc->fs.h_u.tcp_ip4_spec.pdst, |
539 | fsc->fs.m_u.tcp_ip4_spec.pdst); | 554 | fsc->fs.m_u.tcp_ip4_spec.pdst); |
540 | p += ETH_GSTRING_LEN; | 555 | p += ETH_GSTRING_LEN; |
541 | num_strings++; | 556 | num_strings++; |
542 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 557 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
543 | fsc->fs.h_u.tcp_ip4_spec.tos, | 558 | fsc->fs.h_u.tcp_ip4_spec.tos, |
544 | fsc->fs.m_u.tcp_ip4_spec.tos); | 559 | fsc->fs.m_u.tcp_ip4_spec.tos); |
545 | p += ETH_GSTRING_LEN; | 560 | p += ETH_GSTRING_LEN; |
546 | num_strings++; | 561 | num_strings++; |
547 | break; | 562 | break; |
548 | case AH_ESP_V4_FLOW: | 563 | case AH_ESP_V4_FLOW: |
549 | case ESP_V4_FLOW: | 564 | case ESP_V4_FLOW: |
550 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 565 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
551 | fsc->fs.h_u.ah_ip4_spec.ip4src); | 566 | fsc->fs.h_u.ah_ip4_spec.ip4src); |
552 | p += ETH_GSTRING_LEN; | 567 | p += ETH_GSTRING_LEN; |
553 | num_strings++; | 568 | num_strings++; |
554 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 569 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
555 | fsc->fs.m_u.ah_ip4_spec.ip4src); | 570 | fsc->fs.m_u.ah_ip4_spec.ip4src); |
556 | p += ETH_GSTRING_LEN; | 571 | p += ETH_GSTRING_LEN; |
557 | num_strings++; | 572 | num_strings++; |
558 | sprintf(p, "\tDest IP addr: 0x%x\n", | 573 | sprintf(p, "\tDest IP addr: 0x%x\n", |
559 | fsc->fs.h_u.ah_ip4_spec.ip4dst); | 574 | fsc->fs.h_u.ah_ip4_spec.ip4dst); |
560 | p += ETH_GSTRING_LEN; | 575 | p += ETH_GSTRING_LEN; |
561 | num_strings++; | 576 | num_strings++; |
562 | sprintf(p, "\tDest IP mask: 0x%x\n", | 577 | sprintf(p, "\tDest IP mask: 0x%x\n", |
563 | fsc->fs.m_u.ah_ip4_spec.ip4dst); | 578 | fsc->fs.m_u.ah_ip4_spec.ip4dst); |
564 | p += ETH_GSTRING_LEN; | 579 | p += ETH_GSTRING_LEN; |
565 | num_strings++; | 580 | num_strings++; |
566 | sprintf(p, "\tSPI: %d, mask: 0x%x\n", | 581 | sprintf(p, "\tSPI: %d, mask: 0x%x\n", |
567 | fsc->fs.h_u.ah_ip4_spec.spi, | 582 | fsc->fs.h_u.ah_ip4_spec.spi, |
568 | fsc->fs.m_u.ah_ip4_spec.spi); | 583 | fsc->fs.m_u.ah_ip4_spec.spi); |
569 | p += ETH_GSTRING_LEN; | 584 | p += ETH_GSTRING_LEN; |
570 | num_strings++; | 585 | num_strings++; |
571 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 586 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
572 | fsc->fs.h_u.ah_ip4_spec.tos, | 587 | fsc->fs.h_u.ah_ip4_spec.tos, |
573 | fsc->fs.m_u.ah_ip4_spec.tos); | 588 | fsc->fs.m_u.ah_ip4_spec.tos); |
574 | p += ETH_GSTRING_LEN; | 589 | p += ETH_GSTRING_LEN; |
575 | num_strings++; | 590 | num_strings++; |
576 | break; | 591 | break; |
577 | case IP_USER_FLOW: | 592 | case IP_USER_FLOW: |
578 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 593 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
579 | fsc->fs.h_u.raw_ip4_spec.ip4src); | 594 | fsc->fs.h_u.raw_ip4_spec.ip4src); |
580 | p += ETH_GSTRING_LEN; | 595 | p += ETH_GSTRING_LEN; |
581 | num_strings++; | 596 | num_strings++; |
582 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 597 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
583 | fsc->fs.m_u.raw_ip4_spec.ip4src); | 598 | fsc->fs.m_u.raw_ip4_spec.ip4src); |
584 | p += ETH_GSTRING_LEN; | 599 | p += ETH_GSTRING_LEN; |
585 | num_strings++; | 600 | num_strings++; |
586 | sprintf(p, "\tDest IP addr: 0x%x\n", | 601 | sprintf(p, "\tDest IP addr: 0x%x\n", |
587 | fsc->fs.h_u.raw_ip4_spec.ip4dst); | 602 | fsc->fs.h_u.raw_ip4_spec.ip4dst); |
588 | p += ETH_GSTRING_LEN; | 603 | p += ETH_GSTRING_LEN; |
589 | num_strings++; | 604 | num_strings++; |
590 | sprintf(p, "\tDest IP mask: 0x%x\n", | 605 | sprintf(p, "\tDest IP mask: 0x%x\n", |
591 | fsc->fs.m_u.raw_ip4_spec.ip4dst); | 606 | fsc->fs.m_u.raw_ip4_spec.ip4dst); |
592 | p += ETH_GSTRING_LEN; | 607 | p += ETH_GSTRING_LEN; |
593 | num_strings++; | 608 | num_strings++; |
594 | break; | 609 | break; |
595 | case IPV4_FLOW: | 610 | case IPV4_FLOW: |
596 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 611 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
597 | fsc->fs.h_u.usr_ip4_spec.ip4src); | 612 | fsc->fs.h_u.usr_ip4_spec.ip4src); |
598 | p += ETH_GSTRING_LEN; | 613 | p += ETH_GSTRING_LEN; |
599 | num_strings++; | 614 | num_strings++; |
600 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 615 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
601 | fsc->fs.m_u.usr_ip4_spec.ip4src); | 616 | fsc->fs.m_u.usr_ip4_spec.ip4src); |
602 | p += ETH_GSTRING_LEN; | 617 | p += ETH_GSTRING_LEN; |
603 | num_strings++; | 618 | num_strings++; |
604 | sprintf(p, "\tDest IP addr: 0x%x\n", | 619 | sprintf(p, "\tDest IP addr: 0x%x\n", |
605 | fsc->fs.h_u.usr_ip4_spec.ip4dst); | 620 | fsc->fs.h_u.usr_ip4_spec.ip4dst); |
606 | p += ETH_GSTRING_LEN; | 621 | p += ETH_GSTRING_LEN; |
607 | num_strings++; | 622 | num_strings++; |
608 | sprintf(p, "\tDest IP mask: 0x%x\n", | 623 | sprintf(p, "\tDest IP mask: 0x%x\n", |
609 | fsc->fs.m_u.usr_ip4_spec.ip4dst); | 624 | fsc->fs.m_u.usr_ip4_spec.ip4dst); |
610 | p += ETH_GSTRING_LEN; | 625 | p += ETH_GSTRING_LEN; |
611 | num_strings++; | 626 | num_strings++; |
612 | sprintf(p, "\tL4 bytes: 0x%x, mask: 0x%x\n", | 627 | sprintf(p, "\tL4 bytes: 0x%x, mask: 0x%x\n", |
613 | fsc->fs.h_u.usr_ip4_spec.l4_4_bytes, | 628 | fsc->fs.h_u.usr_ip4_spec.l4_4_bytes, |
614 | fsc->fs.m_u.usr_ip4_spec.l4_4_bytes); | 629 | fsc->fs.m_u.usr_ip4_spec.l4_4_bytes); |
615 | p += ETH_GSTRING_LEN; | 630 | p += ETH_GSTRING_LEN; |
616 | num_strings++; | 631 | num_strings++; |
617 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", | 632 | sprintf(p, "\tTOS: %d, mask: 0x%x\n", |
618 | fsc->fs.h_u.usr_ip4_spec.tos, | 633 | fsc->fs.h_u.usr_ip4_spec.tos, |
619 | fsc->fs.m_u.usr_ip4_spec.tos); | 634 | fsc->fs.m_u.usr_ip4_spec.tos); |
620 | p += ETH_GSTRING_LEN; | 635 | p += ETH_GSTRING_LEN; |
621 | num_strings++; | 636 | num_strings++; |
622 | sprintf(p, "\tIP Version: %d, mask: 0x%x\n", | 637 | sprintf(p, "\tIP Version: %d, mask: 0x%x\n", |
623 | fsc->fs.h_u.usr_ip4_spec.ip_ver, | 638 | fsc->fs.h_u.usr_ip4_spec.ip_ver, |
624 | fsc->fs.m_u.usr_ip4_spec.ip_ver); | 639 | fsc->fs.m_u.usr_ip4_spec.ip_ver); |
625 | p += ETH_GSTRING_LEN; | 640 | p += ETH_GSTRING_LEN; |
626 | num_strings++; | 641 | num_strings++; |
627 | sprintf(p, "\tProtocol: %d, mask: 0x%x\n", | 642 | sprintf(p, "\tProtocol: %d, mask: 0x%x\n", |
628 | fsc->fs.h_u.usr_ip4_spec.proto, | 643 | fsc->fs.h_u.usr_ip4_spec.proto, |
629 | fsc->fs.m_u.usr_ip4_spec.proto); | 644 | fsc->fs.m_u.usr_ip4_spec.proto); |
630 | p += ETH_GSTRING_LEN; | 645 | p += ETH_GSTRING_LEN; |
631 | num_strings++; | 646 | num_strings++; |
632 | break; | 647 | break; |
633 | }; | 648 | }; |
634 | sprintf(p, "\tVLAN: %d, mask: 0x%x\n", | 649 | sprintf(p, "\tVLAN: %d, mask: 0x%x\n", |
635 | fsc->fs.vlan_tag, fsc->fs.vlan_tag_mask); | 650 | fsc->fs.vlan_tag, fsc->fs.vlan_tag_mask); |
636 | p += ETH_GSTRING_LEN; | 651 | p += ETH_GSTRING_LEN; |
637 | num_strings++; | 652 | num_strings++; |
638 | sprintf(p, "\tUser-defined: 0x%Lx\n", fsc->fs.data); | 653 | sprintf(p, "\tUser-defined: 0x%Lx\n", fsc->fs.data); |
@@ -645,7 +660,7 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
645 | sprintf(p, "\tAction: Drop\n"); | 660 | sprintf(p, "\tAction: Drop\n"); |
646 | else | 661 | else |
647 | sprintf(p, "\tAction: Direct to queue %d\n", | 662 | sprintf(p, "\tAction: Direct to queue %d\n", |
648 | fsc->fs.action); | 663 | fsc->fs.action); |
649 | p += ETH_GSTRING_LEN; | 664 | p += ETH_GSTRING_LEN; |
650 | num_strings++; | 665 | num_strings++; |
651 | unknown_filter: | 666 | unknown_filter: |
@@ -857,7 +872,8 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) | |||
857 | return ret; | 872 | return ret; |
858 | } | 873 | } |
859 | 874 | ||
860 | static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) | 875 | static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, |
876 | void __user *useraddr) | ||
861 | { | 877 | { |
862 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; | 878 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; |
863 | 879 | ||
@@ -871,7 +887,8 @@ static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void | |||
871 | return 0; | 887 | return 0; |
872 | } | 888 | } |
873 | 889 | ||
874 | static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) | 890 | static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, |
891 | void __user *useraddr) | ||
875 | { | 892 | { |
876 | struct ethtool_coalesce coalesce; | 893 | struct ethtool_coalesce coalesce; |
877 | 894 | ||
@@ -975,6 +992,7 @@ static int ethtool_set_tx_csum(struct net_device *dev, char __user *useraddr) | |||
975 | 992 | ||
976 | return dev->ethtool_ops->set_tx_csum(dev, edata.data); | 993 | return dev->ethtool_ops->set_tx_csum(dev, edata.data); |
977 | } | 994 | } |
995 | EXPORT_SYMBOL(ethtool_op_set_tx_csum); | ||
978 | 996 | ||
979 | static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr) | 997 | static int ethtool_set_rx_csum(struct net_device *dev, char __user *useraddr) |
980 | { | 998 | { |
@@ -1046,7 +1064,7 @@ static int ethtool_get_gso(struct net_device *dev, char __user *useraddr) | |||
1046 | 1064 | ||
1047 | edata.data = dev->features & NETIF_F_GSO; | 1065 | edata.data = dev->features & NETIF_F_GSO; |
1048 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 1066 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
1049 | return -EFAULT; | 1067 | return -EFAULT; |
1050 | return 0; | 1068 | return 0; |
1051 | } | 1069 | } |
1052 | 1070 | ||
@@ -1069,7 +1087,7 @@ static int ethtool_get_gro(struct net_device *dev, char __user *useraddr) | |||
1069 | 1087 | ||
1070 | edata.data = dev->features & NETIF_F_GRO; | 1088 | edata.data = dev->features & NETIF_F_GRO; |
1071 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 1089 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
1072 | return -EFAULT; | 1090 | return -EFAULT; |
1073 | return 0; | 1091 | return 0; |
1074 | } | 1092 | } |
1075 | 1093 | ||
@@ -1281,7 +1299,8 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr, | |||
1281 | return actor(dev, edata.data); | 1299 | return actor(dev, edata.data); |
1282 | } | 1300 | } |
1283 | 1301 | ||
1284 | static noinline_for_stack int ethtool_flash_device(struct net_device *dev, char __user *useraddr) | 1302 | static noinline_for_stack int ethtool_flash_device(struct net_device *dev, |
1303 | char __user *useraddr) | ||
1285 | { | 1304 | { |
1286 | struct ethtool_flash efl; | 1305 | struct ethtool_flash efl; |
1287 | 1306 | ||
@@ -1310,11 +1329,11 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1310 | if (!dev->ethtool_ops) | 1329 | if (!dev->ethtool_ops) |
1311 | return -EOPNOTSUPP; | 1330 | return -EOPNOTSUPP; |
1312 | 1331 | ||
1313 | if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd))) | 1332 | if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) |
1314 | return -EFAULT; | 1333 | return -EFAULT; |
1315 | 1334 | ||
1316 | /* Allow some commands to be done by anyone */ | 1335 | /* Allow some commands to be done by anyone */ |
1317 | switch(ethcmd) { | 1336 | switch (ethcmd) { |
1318 | case ETHTOOL_GDRVINFO: | 1337 | case ETHTOOL_GDRVINFO: |
1319 | case ETHTOOL_GMSGLVL: | 1338 | case ETHTOOL_GMSGLVL: |
1320 | case ETHTOOL_GCOALESCE: | 1339 | case ETHTOOL_GCOALESCE: |
@@ -1342,10 +1361,11 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1342 | return -EPERM; | 1361 | return -EPERM; |
1343 | } | 1362 | } |
1344 | 1363 | ||
1345 | if (dev->ethtool_ops->begin) | 1364 | if (dev->ethtool_ops->begin) { |
1346 | if ((rc = dev->ethtool_ops->begin(dev)) < 0) | 1365 | rc = dev->ethtool_ops->begin(dev); |
1366 | if (rc < 0) | ||
1347 | return rc; | 1367 | return rc; |
1348 | 1368 | } | |
1349 | old_features = dev->features; | 1369 | old_features = dev->features; |
1350 | 1370 | ||
1351 | switch (ethcmd) { | 1371 | switch (ethcmd) { |
@@ -1535,16 +1555,3 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
1535 | 1555 | ||
1536 | return rc; | 1556 | return rc; |
1537 | } | 1557 | } |
1538 | |||
1539 | EXPORT_SYMBOL(ethtool_op_get_link); | ||
1540 | EXPORT_SYMBOL(ethtool_op_get_sg); | ||
1541 | EXPORT_SYMBOL(ethtool_op_get_tso); | ||
1542 | EXPORT_SYMBOL(ethtool_op_set_sg); | ||
1543 | EXPORT_SYMBOL(ethtool_op_set_tso); | ||
1544 | EXPORT_SYMBOL(ethtool_op_set_tx_csum); | ||
1545 | EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum); | ||
1546 | EXPORT_SYMBOL(ethtool_op_set_tx_ipv6_csum); | ||
1547 | EXPORT_SYMBOL(ethtool_op_set_ufo); | ||
1548 | EXPORT_SYMBOL(ethtool_op_get_ufo); | ||
1549 | EXPORT_SYMBOL(ethtool_op_set_flags); | ||
1550 | EXPORT_SYMBOL(ethtool_op_get_flags); | ||