diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-06-30 13:06:40 -0400 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2008-07-23 17:00:25 -0400 |
commit | 4dfce4075aa4e2eee35e52a78dbabfe37d94c908 (patch) | |
tree | 962f5cde27a9b7eedc45b4c018d07d10b455d590 /drivers/net/wan/hdlc_cisco.c | |
parent | d6f8aa8586dabe605454f3c98a5c1a577c3e0cfb (diff) |
WAN: cosmetic changes to generic HDLC
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'drivers/net/wan/hdlc_cisco.c')
-rw-r--r-- | drivers/net/wan/hdlc_cisco.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index 849819c2552d..44e64b15dbd1 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c | |||
@@ -9,19 +9,18 @@ | |||
9 | * as published by the Free Software Foundation. | 9 | * as published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/slab.h> | ||
15 | #include <linux/poll.h> | ||
16 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/hdlc.h> | ||
17 | #include <linux/if_arp.h> | 14 | #include <linux/if_arp.h> |
15 | #include <linux/inetdevice.h> | ||
18 | #include <linux/init.h> | 16 | #include <linux/init.h> |
19 | #include <linux/skbuff.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/module.h> | ||
20 | #include <linux/pkt_sched.h> | 19 | #include <linux/pkt_sched.h> |
21 | #include <linux/inetdevice.h> | 20 | #include <linux/poll.h> |
22 | #include <linux/lapb.h> | ||
23 | #include <linux/rtnetlink.h> | 21 | #include <linux/rtnetlink.h> |
24 | #include <linux/hdlc.h> | 22 | #include <linux/skbuff.h> |
23 | #include <linux/slab.h> | ||
25 | 24 | ||
26 | #undef DEBUG_HARD_HEADER | 25 | #undef DEBUG_HARD_HEADER |
27 | 26 | ||
@@ -68,9 +67,9 @@ struct cisco_state { | |||
68 | static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr); | 67 | static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr); |
69 | 68 | ||
70 | 69 | ||
71 | static inline struct cisco_state * state(hdlc_device *hdlc) | 70 | static inline struct cisco_state* state(hdlc_device *hdlc) |
72 | { | 71 | { |
73 | return(struct cisco_state *)(hdlc->state); | 72 | return (struct cisco_state *)hdlc->state; |
74 | } | 73 | } |
75 | 74 | ||
76 | 75 | ||
@@ -172,7 +171,7 @@ static int cisco_rx(struct sk_buff *skb) | |||
172 | data->address != CISCO_UNICAST) | 171 | data->address != CISCO_UNICAST) |
173 | goto rx_error; | 172 | goto rx_error; |
174 | 173 | ||
175 | switch(ntohs(data->protocol)) { | 174 | switch (ntohs(data->protocol)) { |
176 | case CISCO_SYS_INFO: | 175 | case CISCO_SYS_INFO: |
177 | /* Packet is not needed, drop it. */ | 176 | /* Packet is not needed, drop it. */ |
178 | dev_kfree_skb_any(skb); | 177 | dev_kfree_skb_any(skb); |
@@ -336,7 +335,7 @@ static struct hdlc_proto proto = { | |||
336 | static const struct header_ops cisco_header_ops = { | 335 | static const struct header_ops cisco_header_ops = { |
337 | .create = cisco_hard_header, | 336 | .create = cisco_hard_header, |
338 | }; | 337 | }; |
339 | 338 | ||
340 | static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) | 339 | static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) |
341 | { | 340 | { |
342 | cisco_proto __user *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco; | 341 | cisco_proto __user *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco; |
@@ -359,10 +358,10 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
359 | return 0; | 358 | return 0; |
360 | 359 | ||
361 | case IF_PROTO_CISCO: | 360 | case IF_PROTO_CISCO: |
362 | if(!capable(CAP_NET_ADMIN)) | 361 | if (!capable(CAP_NET_ADMIN)) |
363 | return -EPERM; | 362 | return -EPERM; |
364 | 363 | ||
365 | if(dev->flags & IFF_UP) | 364 | if (dev->flags & IFF_UP) |
366 | return -EBUSY; | 365 | return -EBUSY; |
367 | 366 | ||
368 | if (copy_from_user(&new_settings, cisco_s, size)) | 367 | if (copy_from_user(&new_settings, cisco_s, size)) |
@@ -372,7 +371,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
372 | new_settings.timeout < 2) | 371 | new_settings.timeout < 2) |
373 | return -EINVAL; | 372 | return -EINVAL; |
374 | 373 | ||
375 | result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); | 374 | result = hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); |
376 | if (result) | 375 | if (result) |
377 | return result; | 376 | return result; |
378 | 377 | ||