aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:38:13 -0500
commitcb18eccff48ef3986d1072964590bce6fec705fb (patch)
tree777fb1d15e0281341e1e02c9803d989538d346f2 /net/decnet/dn_dev.c
parentc827ba4cb49a30ce581201fd0ba2be77cde412c7 (diff)
parent5ef213f6842277ee1df5659f59fac0ffc9beb411 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (45 commits) [IPV4]: Restore multipath routing after rt_next changes. [XFRM] IPV6: Fix outbound RO transformation which is broken by IPsec tunnel patch. [NET]: Reorder fields of struct dst_entry [DECNET]: Convert decnet route to use the new dst_entry 'next' pointer [IPV6]: Convert ipv6 route to use the new dst_entry 'next' pointer [IPV4]: Convert ipv4 route to use the new dst_entry 'next' pointer [NET]: Introduce union in struct dst_entry to hold 'next' pointer [DECNET]: fix misannotation of linkinfo_dn [DECNET]: FRA_{DST,SRC} are le16 for decnet [UDP]: UDP can use sk_hash to speedup lookups [NET]: Fix whitespace errors. [NET] XFRM: Fix whitespace errors. [NET] X25: Fix whitespace errors. [NET] WANROUTER: Fix whitespace errors. [NET] UNIX: Fix whitespace errors. [NET] TIPC: Fix whitespace errors. [NET] SUNRPC: Fix whitespace errors. [NET] SCTP: Fix whitespace errors. [NET] SCHED: Fix whitespace errors. [NET] RXRPC: Fix whitespace errors. ...
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r--net/decnet/dn_dev.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 90b3dfd72b49..c5e28114beb8 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -224,27 +224,27 @@ static struct dn_dev_sysctl_table {
224 {0} 224 {0}
225 }, 225 },
226 {{ 226 {{
227 .ctl_name = 0, 227 .ctl_name = 0,
228 .procname = "", 228 .procname = "",
229 .mode = 0555, 229 .mode = 0555,
230 .child = dn_dev_sysctl.dn_dev_vars 230 .child = dn_dev_sysctl.dn_dev_vars
231 }, {0}}, 231 }, {0}},
232 {{ 232 {{
233 .ctl_name = NET_DECNET_CONF, 233 .ctl_name = NET_DECNET_CONF,
234 .procname = "conf", 234 .procname = "conf",
235 .mode = 0555, 235 .mode = 0555,
236 .child = dn_dev_sysctl.dn_dev_dev 236 .child = dn_dev_sysctl.dn_dev_dev
237 }, {0}}, 237 }, {0}},
238 {{ 238 {{
239 .ctl_name = NET_DECNET, 239 .ctl_name = NET_DECNET,
240 .procname = "decnet", 240 .procname = "decnet",
241 .mode = 0555, 241 .mode = 0555,
242 .child = dn_dev_sysctl.dn_dev_conf_dir 242 .child = dn_dev_sysctl.dn_dev_conf_dir
243 }, {0}}, 243 }, {0}},
244 {{ 244 {{
245 .ctl_name = CTL_NET, 245 .ctl_name = CTL_NET,
246 .procname = "net", 246 .procname = "net",
247 .mode = 0555, 247 .mode = 0555,
248 .child = dn_dev_sysctl.dn_dev_proto_dir 248 .child = dn_dev_sysctl.dn_dev_proto_dir
249 }, {0}} 249 }, {0}}
250}; 250};
@@ -299,7 +299,7 @@ static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
299 } 299 }
300} 300}
301 301
302static int dn_forwarding_proc(ctl_table *table, int write, 302static int dn_forwarding_proc(ctl_table *table, int write,
303 struct file *filep, 303 struct file *filep,
304 void __user *buffer, 304 void __user *buffer,
305 size_t *lenp, loff_t *ppos) 305 size_t *lenp, loff_t *ppos)
@@ -456,7 +456,7 @@ static int dn_dev_insert_ifa(struct dn_dev *dn_db, struct dn_ifaddr *ifa)
456 456
457 ASSERT_RTNL(); 457 ASSERT_RTNL();
458 458
459 /* Check for duplicates */ 459 /* Check for duplicates */
460 for(ifa1 = dn_db->ifa_list; ifa1; ifa1 = ifa1->ifa_next) { 460 for(ifa1 = dn_db->ifa_list; ifa1; ifa1 = ifa1->ifa_next) {
461 if (ifa1->ifa_local == ifa->ifa_local) 461 if (ifa1->ifa_local == ifa->ifa_local)
462 return -EEXIST; 462 return -EEXIST;
@@ -708,7 +708,7 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
708 if (!dn_db) 708 if (!dn_db)
709 return err; 709 return err;
710 } 710 }
711 711
712 if ((ifa = dn_dev_alloc_ifa()) == NULL) 712 if ((ifa = dn_dev_alloc_ifa()) == NULL)
713 return -ENOBUFS; 713 return -ENOBUFS;
714 714
@@ -853,7 +853,7 @@ out:
853 return rv; 853 return rv;
854} 854}
855 855
856/* 856/*
857 * Find a default address to bind to. 857 * Find a default address to bind to.
858 * 858 *
859 * This is one of those areas where the initial VMS concepts don't really 859 * This is one of those areas where the initial VMS concepts don't really
@@ -884,39 +884,39 @@ last_chance:
884 884
885static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa) 885static void dn_send_endnode_hello(struct net_device *dev, struct dn_ifaddr *ifa)
886{ 886{
887 struct endnode_hello_message *msg; 887 struct endnode_hello_message *msg;
888 struct sk_buff *skb = NULL; 888 struct sk_buff *skb = NULL;
889 __le16 *pktlen; 889 __le16 *pktlen;
890 struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr; 890 struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr;
891 891
892 if ((skb = dn_alloc_skb(NULL, sizeof(*msg), GFP_ATOMIC)) == NULL) 892 if ((skb = dn_alloc_skb(NULL, sizeof(*msg), GFP_ATOMIC)) == NULL)
893 return; 893 return;
894 894
895 skb->dev = dev; 895 skb->dev = dev;
896 896
897 msg = (struct endnode_hello_message *)skb_put(skb,sizeof(*msg)); 897 msg = (struct endnode_hello_message *)skb_put(skb,sizeof(*msg));
898 898
899 msg->msgflg = 0x0D; 899 msg->msgflg = 0x0D;
900 memcpy(msg->tiver, dn_eco_version, 3); 900 memcpy(msg->tiver, dn_eco_version, 3);
901 dn_dn2eth(msg->id, ifa->ifa_local); 901 dn_dn2eth(msg->id, ifa->ifa_local);
902 msg->iinfo = DN_RT_INFO_ENDN; 902 msg->iinfo = DN_RT_INFO_ENDN;
903 msg->blksize = dn_htons(mtu2blksize(dev)); 903 msg->blksize = dn_htons(mtu2blksize(dev));
904 msg->area = 0x00; 904 msg->area = 0x00;
905 memset(msg->seed, 0, 8); 905 memset(msg->seed, 0, 8);
906 memcpy(msg->neighbor, dn_hiord, ETH_ALEN); 906 memcpy(msg->neighbor, dn_hiord, ETH_ALEN);
907 907
908 if (dn_db->router) { 908 if (dn_db->router) {
909 struct dn_neigh *dn = (struct dn_neigh *)dn_db->router; 909 struct dn_neigh *dn = (struct dn_neigh *)dn_db->router;
910 dn_dn2eth(msg->neighbor, dn->addr); 910 dn_dn2eth(msg->neighbor, dn->addr);
911 } 911 }
912 912
913 msg->timer = dn_htons((unsigned short)dn_db->parms.t3); 913 msg->timer = dn_htons((unsigned short)dn_db->parms.t3);
914 msg->mpd = 0x00; 914 msg->mpd = 0x00;
915 msg->datalen = 0x02; 915 msg->datalen = 0x02;
916 memset(msg->data, 0xAA, 2); 916 memset(msg->data, 0xAA, 2);
917 917
918 pktlen = (__le16 *)skb_push(skb,2); 918 pktlen = (__le16 *)skb_push(skb,2);
919 *pktlen = dn_htons(skb->len - 2); 919 *pktlen = dn_htons(skb->len - 2);
920 920
921 skb->nh.raw = skb->data; 921 skb->nh.raw = skb->data;
922 922
@@ -986,11 +986,11 @@ static void dn_send_router_hello(struct net_device *dev, struct dn_ifaddr *ifa)
986 dn_dn2eth(ptr, ifa->ifa_local); 986 dn_dn2eth(ptr, ifa->ifa_local);
987 src = ptr; 987 src = ptr;
988 ptr += ETH_ALEN; 988 ptr += ETH_ALEN;
989 *ptr++ = dn_db->parms.forwarding == 1 ? 989 *ptr++ = dn_db->parms.forwarding == 1 ?
990 DN_RT_INFO_L1RT : DN_RT_INFO_L2RT; 990 DN_RT_INFO_L1RT : DN_RT_INFO_L2RT;
991 *((__le16 *)ptr) = dn_htons(mtu2blksize(dev)); 991 *((__le16 *)ptr) = dn_htons(mtu2blksize(dev));
992 ptr += 2; 992 ptr += 2;
993 *ptr++ = dn_db->parms.priority; /* Priority */ 993 *ptr++ = dn_db->parms.priority; /* Priority */
994 *ptr++ = 0; /* Area: Reserved */ 994 *ptr++ = 0; /* Area: Reserved */
995 *((__le16 *)ptr) = dn_htons((unsigned short)dn_db->parms.t3); 995 *((__le16 *)ptr) = dn_htons((unsigned short)dn_db->parms.t3);
996 ptr += 2; 996 ptr += 2;
@@ -1408,18 +1408,18 @@ static char *dn_type2asc(char type)
1408static int dn_dev_seq_show(struct seq_file *seq, void *v) 1408static int dn_dev_seq_show(struct seq_file *seq, void *v)
1409{ 1409{
1410 if (v == SEQ_START_TOKEN) 1410 if (v == SEQ_START_TOKEN)
1411 seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n"); 1411 seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n");
1412 else { 1412 else {
1413 struct net_device *dev = v; 1413 struct net_device *dev = v;
1414 char peer_buf[DN_ASCBUF_LEN]; 1414 char peer_buf[DN_ASCBUF_LEN];
1415 char router_buf[DN_ASCBUF_LEN]; 1415 char router_buf[DN_ASCBUF_LEN];
1416 struct dn_dev *dn_db = dev->dn_ptr; 1416 struct dn_dev *dn_db = dev->dn_ptr;
1417 1417
1418 seq_printf(seq, "%-8s %1s %04u %04u %04lu %04lu" 1418 seq_printf(seq, "%-8s %1s %04u %04u %04lu %04lu"
1419 " %04hu %03d %02x %-10s %-7s %-7s\n", 1419 " %04hu %03d %02x %-10s %-7s %-7s\n",
1420 dev->name ? dev->name : "???", 1420 dev->name ? dev->name : "???",
1421 dn_type2asc(dn_db->parms.mode), 1421 dn_type2asc(dn_db->parms.mode),
1422 0, 0, 1422 0, 0,
1423 dn_db->t3, dn_db->parms.t3, 1423 dn_db->t3, dn_db->parms.t3,
1424 mtu2blksize(dev), 1424 mtu2blksize(dev),
1425 dn_db->parms.priority, 1425 dn_db->parms.priority,
@@ -1476,17 +1476,17 @@ MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
1476 1476
1477void __init dn_dev_init(void) 1477void __init dn_dev_init(void)
1478{ 1478{
1479 if (addr[0] > 63 || addr[0] < 0) { 1479 if (addr[0] > 63 || addr[0] < 0) {
1480 printk(KERN_ERR "DECnet: Area must be between 0 and 63"); 1480 printk(KERN_ERR "DECnet: Area must be between 0 and 63");
1481 return; 1481 return;
1482 } 1482 }
1483 1483
1484 if (addr[1] > 1023 || addr[1] < 0) { 1484 if (addr[1] > 1023 || addr[1] < 0) {
1485 printk(KERN_ERR "DECnet: Node must be between 0 and 1023"); 1485 printk(KERN_ERR "DECnet: Node must be between 0 and 1023");
1486 return; 1486 return;
1487 } 1487 }
1488 1488
1489 decnet_address = dn_htons((addr[0] << 10) | addr[1]); 1489 decnet_address = dn_htons((addr[0] << 10) | addr[1]);
1490 1490
1491 dn_dev_devices_on(); 1491 dn_dev_devices_on();
1492 1492