diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:27:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:08 -0400 |
commit | cd1ae0e49bdd814cfaa2e5ab28cff21a30e20085 (patch) | |
tree | 1b993b9de4cb9a8578022a4014063c3e87ec996e /arch/um/drivers/mcast_kern.c | |
parent | 1a80521990a0e30e61a92994a009adc52161b070 (diff) |
uml: network formatting
Style and other non-functional changes in the UML networking code, including
include tidying
style violations
copyright updates
printks getting severities
userspace code calling libc directly rather than using the os_*
wrappers
There's also a exit path cleanup in the pcap driver.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/mcast_kern.c')
-rw-r--r-- | arch/um/drivers/mcast_kern.c | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/arch/um/drivers/mcast_kern.c b/arch/um/drivers/mcast_kern.c index e6b8e0dd72a8..5027b870d11d 100644 --- a/arch/um/drivers/mcast_kern.c +++ b/arch/um/drivers/mcast_kern.c | |||
@@ -1,24 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * user-mode-linux networking multicast transport | 2 | * user-mode-linux networking multicast transport |
3 | * Copyright (C) 2001 by Harald Welte <laforge@gnumonks.org> | 3 | * Copyright (C) 2001 by Harald Welte <laforge@gnumonks.org> |
4 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * | 5 | * |
5 | * based on the existing uml-networking code, which is | 6 | * based on the existing uml-networking code, which is |
6 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and | 7 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and |
7 | * James Leu (jleu@mindspring.net). | 8 | * James Leu (jleu@mindspring.net). |
8 | * Copyright (C) 2001 by various other people who didn't put their name here. | 9 | * Copyright (C) 2001 by various other people who didn't put their name here. |
9 | * | 10 | * |
10 | * Licensed under the GPL. | 11 | * Licensed under the GPL. |
11 | */ | 12 | */ |
12 | 13 | ||
13 | #include "linux/kernel.h" | ||
14 | #include "linux/init.h" | 14 | #include "linux/init.h" |
15 | #include "linux/netdevice.h" | 15 | #include <linux/netdevice.h> |
16 | #include "linux/etherdevice.h" | ||
17 | #include "linux/in.h" | ||
18 | #include "linux/inet.h" | ||
19 | #include "net_kern.h" | ||
20 | #include "net_user.h" | ||
21 | #include "mcast.h" | 16 | #include "mcast.h" |
17 | #include "net_kern.h" | ||
22 | 18 | ||
23 | struct mcast_init { | 19 | struct mcast_init { |
24 | char *addr; | 20 | char *addr; |
@@ -39,26 +35,23 @@ static void mcast_init(struct net_device *dev, void *data) | |||
39 | dpri->ttl = init->ttl; | 35 | dpri->ttl = init->ttl; |
40 | dpri->dev = dev; | 36 | dpri->dev = dev; |
41 | 37 | ||
42 | printk("mcast backend "); | 38 | printk("mcast backend multicast address: %s:%u, TTL:%u\n", |
43 | printk("multicast address: %s:%u, TTL:%u ", | ||
44 | dpri->addr, dpri->port, dpri->ttl); | 39 | dpri->addr, dpri->port, dpri->ttl); |
45 | |||
46 | printk("\n"); | ||
47 | } | 40 | } |
48 | 41 | ||
49 | static int mcast_read(int fd, struct sk_buff **skb, struct uml_net_private *lp) | 42 | static int mcast_read(int fd, struct sk_buff **skb, struct uml_net_private *lp) |
50 | { | 43 | { |
51 | *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); | 44 | *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); |
52 | if(*skb == NULL) return(-ENOMEM); | 45 | if (*skb == NULL) |
53 | return(net_recvfrom(fd, skb_mac_header(*skb), | 46 | return -ENOMEM; |
54 | (*skb)->dev->mtu + ETH_HEADER_OTHER)); | 47 | return net_recvfrom(fd, skb_mac_header(*skb), |
48 | (*skb)->dev->mtu + ETH_HEADER_OTHER); | ||
55 | } | 49 | } |
56 | 50 | ||
57 | static int mcast_write(int fd, struct sk_buff **skb, | 51 | static int mcast_write(int fd, struct sk_buff **skb, struct uml_net_private *lp) |
58 | struct uml_net_private *lp) | ||
59 | { | 52 | { |
60 | return mcast_user_write(fd, (*skb)->data, (*skb)->len, | 53 | return mcast_user_write(fd, (*skb)->data, (*skb)->len, |
61 | (struct mcast_data *) &lp->user); | 54 | (struct mcast_data *) &lp->user); |
62 | } | 55 | } |
63 | 56 | ||
64 | static const struct net_kern_info mcast_kern_info = { | 57 | static const struct net_kern_info mcast_kern_info = { |
@@ -81,34 +74,34 @@ int mcast_setup(char *str, char **mac_out, void *data) | |||
81 | 74 | ||
82 | remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str, | 75 | remain = split_if_spec(str, mac_out, &init->addr, &port_str, &ttl_str, |
83 | NULL); | 76 | NULL); |
84 | if(remain != NULL){ | 77 | if (remain != NULL) { |
85 | printk(KERN_ERR "mcast_setup - Extra garbage on " | 78 | printk(KERN_ERR "mcast_setup - Extra garbage on " |
86 | "specification : '%s'\n", remain); | 79 | "specification : '%s'\n", remain); |
87 | return(0); | 80 | return 0; |
88 | } | 81 | } |
89 | 82 | ||
90 | if(port_str != NULL){ | 83 | if (port_str != NULL) { |
91 | init->port = simple_strtoul(port_str, &last, 10); | 84 | init->port = simple_strtoul(port_str, &last, 10); |
92 | if((*last != '\0') || (last == port_str)){ | 85 | if ((*last != '\0') || (last == port_str)) { |
93 | printk(KERN_ERR "mcast_setup - Bad port : '%s'\n", | 86 | printk(KERN_ERR "mcast_setup - Bad port : '%s'\n", |
94 | port_str); | 87 | port_str); |
95 | return(0); | 88 | return 0; |
96 | } | 89 | } |
97 | } | 90 | } |
98 | 91 | ||
99 | if(ttl_str != NULL){ | 92 | if (ttl_str != NULL) { |
100 | init->ttl = simple_strtoul(ttl_str, &last, 10); | 93 | init->ttl = simple_strtoul(ttl_str, &last, 10); |
101 | if((*last != '\0') || (last == ttl_str)){ | 94 | if ((*last != '\0') || (last == ttl_str)) { |
102 | printk(KERN_ERR "mcast_setup - Bad ttl : '%s'\n", | 95 | printk(KERN_ERR "mcast_setup - Bad ttl : '%s'\n", |
103 | ttl_str); | 96 | ttl_str); |
104 | return(0); | 97 | return 0; |
105 | } | 98 | } |
106 | } | 99 | } |
107 | 100 | ||
108 | printk(KERN_INFO "Configured mcast device: %s:%u-%u\n", init->addr, | 101 | printk(KERN_INFO "Configured mcast device: %s:%u-%u\n", init->addr, |
109 | init->port, init->ttl); | 102 | init->port, init->ttl); |
110 | 103 | ||
111 | return(1); | 104 | return 1; |
112 | } | 105 | } |
113 | 106 | ||
114 | static struct transport mcast_transport = { | 107 | static struct transport mcast_transport = { |