diff options
Diffstat (limited to 'drivers/net/dummy.c')
-rw-r--r-- | drivers/net/dummy.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 713ce6c532c5..37dcfdc63456 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -39,8 +39,6 @@ | |||
39 | 39 | ||
40 | static int numdummies = 1; | 40 | static int numdummies = 1; |
41 | 41 | ||
42 | static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); | ||
43 | |||
44 | static int dummy_set_address(struct net_device *dev, void *p) | 42 | static int dummy_set_address(struct net_device *dev, void *p) |
45 | { | 43 | { |
46 | struct sockaddr *sa = p; | 44 | struct sockaddr *sa = p; |
@@ -57,6 +55,16 @@ static void set_multicast_list(struct net_device *dev) | |||
57 | { | 55 | { |
58 | } | 56 | } |
59 | 57 | ||
58 | |||
59 | static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev) | ||
60 | { | ||
61 | dev->stats.tx_packets++; | ||
62 | dev->stats.tx_bytes += skb->len; | ||
63 | |||
64 | dev_kfree_skb(skb); | ||
65 | return NETDEV_TX_OK; | ||
66 | } | ||
67 | |||
60 | static const struct net_device_ops dummy_netdev_ops = { | 68 | static const struct net_device_ops dummy_netdev_ops = { |
61 | .ndo_start_xmit = dummy_xmit, | 69 | .ndo_start_xmit = dummy_xmit, |
62 | .ndo_validate_addr = eth_validate_addr, | 70 | .ndo_validate_addr = eth_validate_addr, |
@@ -78,16 +86,6 @@ static void dummy_setup(struct net_device *dev) | |||
78 | dev->flags &= ~IFF_MULTICAST; | 86 | dev->flags &= ~IFF_MULTICAST; |
79 | random_ether_addr(dev->dev_addr); | 87 | random_ether_addr(dev->dev_addr); |
80 | } | 88 | } |
81 | |||
82 | static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) | ||
83 | { | ||
84 | dev->stats.tx_packets++; | ||
85 | dev->stats.tx_bytes += skb->len; | ||
86 | |||
87 | dev_kfree_skb(skb); | ||
88 | return NETDEV_TX_OK; | ||
89 | } | ||
90 | |||
91 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) | 89 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) |
92 | { | 90 | { |
93 | if (tb[IFLA_ADDRESS]) { | 91 | if (tb[IFLA_ADDRESS]) { |