aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/atm
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/atm_sysfs.c13
-rw-r--r--net/atm/br2684.c4
-rw-r--r--net/atm/clip.c11
-rw-r--r--net/atm/common.c3
-rw-r--r--net/atm/lec.c12
-rw-r--r--net/atm/lec.h2
-rw-r--r--net/atm/mpc.c4
-rw-r--r--net/atm/proc.c5
-rw-r--r--net/atm/resources.c7
-rw-r--r--net/atm/resources.h2
10 files changed, 34 insertions, 29 deletions
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index 799c631f0fed..f49da5814bc3 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -59,6 +59,14 @@ static ssize_t show_atmaddress(struct device *cdev,
59 return pos - buf; 59 return pos - buf;
60} 60}
61 61
62static ssize_t show_atmindex(struct device *cdev,
63 struct device_attribute *attr, char *buf)
64{
65 struct atm_dev *adev = to_atm_dev(cdev);
66
67 return sprintf(buf, "%d\n", adev->number);
68}
69
62static ssize_t show_carrier(struct device *cdev, 70static ssize_t show_carrier(struct device *cdev,
63 struct device_attribute *attr, char *buf) 71 struct device_attribute *attr, char *buf)
64{ 72{
@@ -99,6 +107,7 @@ static ssize_t show_link_rate(struct device *cdev,
99 107
100static DEVICE_ATTR(address, S_IRUGO, show_address, NULL); 108static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
101static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL); 109static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
110static DEVICE_ATTR(atmindex, S_IRUGO, show_atmindex, NULL);
102static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL); 111static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
103static DEVICE_ATTR(type, S_IRUGO, show_type, NULL); 112static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
104static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL); 113static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
@@ -106,6 +115,7 @@ static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
106static struct device_attribute *atm_attrs[] = { 115static struct device_attribute *atm_attrs[] = {
107 &dev_attr_atmaddress, 116 &dev_attr_atmaddress,
108 &dev_attr_address, 117 &dev_attr_address,
118 &dev_attr_atmindex,
109 &dev_attr_carrier, 119 &dev_attr_carrier,
110 &dev_attr_type, 120 &dev_attr_type,
111 &dev_attr_link_rate, 121 &dev_attr_link_rate,
@@ -143,12 +153,13 @@ static struct class atm_class = {
143 .dev_uevent = atm_uevent, 153 .dev_uevent = atm_uevent,
144}; 154};
145 155
146int atm_register_sysfs(struct atm_dev *adev) 156int atm_register_sysfs(struct atm_dev *adev, struct device *parent)
147{ 157{
148 struct device *cdev = &adev->class_dev; 158 struct device *cdev = &adev->class_dev;
149 int i, j, err; 159 int i, j, err;
150 160
151 cdev->class = &atm_class; 161 cdev->class = &atm_class;
162 cdev->parent = parent;
152 dev_set_drvdata(cdev, adev); 163 dev_set_drvdata(cdev, adev);
153 164
154 dev_set_name(cdev, "%s%d", adev->type, adev->number); 165 dev_set_name(cdev, "%s%d", adev->type, adev->number);
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ad2b232a2055..2252c2085dac 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -97,7 +97,7 @@ static LIST_HEAD(br2684_devs);
97 97
98static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev) 98static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
99{ 99{
100 return (struct br2684_dev *)netdev_priv(net_dev); 100 return netdev_priv(net_dev);
101} 101}
102 102
103static inline struct net_device *list_entry_brdev(const struct list_head *le) 103static inline struct net_device *list_entry_brdev(const struct list_head *le)
@@ -509,7 +509,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
509 write_lock_irq(&devs_lock); 509 write_lock_irq(&devs_lock);
510 net_dev = br2684_find_dev(&be.ifspec); 510 net_dev = br2684_find_dev(&be.ifspec);
511 if (net_dev == NULL) { 511 if (net_dev == NULL) {
512 pr_err("tried to attach to non-existant device\n"); 512 pr_err("tried to attach to non-existent device\n");
513 err = -ENXIO; 513 err = -ENXIO;
514 goto error; 514 goto error;
515 } 515 }
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 95fdd1185067..1d4be60e1390 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -310,9 +310,9 @@ static int clip_constructor(struct neighbour *neigh)
310 return 0; 310 return 0;
311} 311}
312 312
313static u32 clip_hash(const void *pkey, const struct net_device *dev) 313static u32 clip_hash(const void *pkey, const struct net_device *dev, __u32 rnd)
314{ 314{
315 return jhash_2words(*(u32 *) pkey, dev->ifindex, clip_tbl.hash_rnd); 315 return jhash_2words(*(u32 *) pkey, dev->ifindex, rnd);
316} 316}
317 317
318static struct neigh_table clip_tbl = { 318static struct neigh_table clip_tbl = {
@@ -502,7 +502,6 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
502 struct atmarp_entry *entry; 502 struct atmarp_entry *entry;
503 int error; 503 int error;
504 struct clip_vcc *clip_vcc; 504 struct clip_vcc *clip_vcc;
505 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = ip, .tos = 1}} };
506 struct rtable *rt; 505 struct rtable *rt;
507 506
508 if (vcc->push != clip_push) { 507 if (vcc->push != clip_push) {
@@ -519,9 +518,9 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
519 unlink_clip_vcc(clip_vcc); 518 unlink_clip_vcc(clip_vcc);
520 return 0; 519 return 0;
521 } 520 }
522 error = ip_route_output_key(&init_net, &rt, &fl); 521 rt = ip_route_output(&init_net, ip, 0, 1, 0);
523 if (error) 522 if (IS_ERR(rt))
524 return error; 523 return PTR_ERR(rt);
525 neigh = __neigh_lookup(&clip_tbl, &ip, rt->dst.dev, 1); 524 neigh = __neigh_lookup(&clip_tbl, &ip, rt->dst.dev, 1);
526 ip_rt_put(rt); 525 ip_rt_put(rt);
527 if (!neigh) 526 if (!neigh)
diff --git a/net/atm/common.c b/net/atm/common.c
index 940404a73b3d..22b963d06a10 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev *dev)
252 } 252 }
253 write_unlock_irq(&vcc_sklist_lock); 253 write_unlock_irq(&vcc_sklist_lock);
254} 254}
255EXPORT_SYMBOL(atm_dev_release_vccs);
255 256
256static int adjust_tp(struct atm_trafprm *tp, unsigned char aal) 257static int adjust_tp(struct atm_trafprm *tp, unsigned char aal)
257{ 258{
@@ -792,7 +793,7 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
792 default: 793 default:
793 if (level == SOL_SOCKET) 794 if (level == SOL_SOCKET)
794 return -EINVAL; 795 return -EINVAL;
795 break; 796 break;
796 } 797 }
797 if (!vcc->dev || !vcc->dev->ops->getsockopt) 798 if (!vcc->dev || !vcc->dev->ops->getsockopt)
798 return -EINVAL; 799 return -EINVAL;
diff --git a/net/atm/lec.c b/net/atm/lec.c
index d98bde1a0ac8..ba48daa68c1f 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -129,7 +129,6 @@ static struct net_device *dev_lec[MAX_LEC_ITF];
129#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) 129#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
130static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev) 130static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
131{ 131{
132 struct ethhdr *eth;
133 char *buff; 132 char *buff;
134 struct lec_priv *priv; 133 struct lec_priv *priv;
135 134
@@ -138,7 +137,6 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
138 * LE_TOPOLOGY_REQUEST with the same value of Topology Change bit 137 * LE_TOPOLOGY_REQUEST with the same value of Topology Change bit
139 * as the Config BPDU has 138 * as the Config BPDU has
140 */ 139 */
141 eth = (struct ethhdr *)skb->data;
142 buff = skb->data + skb->dev->hard_header_len; 140 buff = skb->data + skb->dev->hard_header_len;
143 if (*buff++ == 0x42 && *buff++ == 0x42 && *buff++ == 0x03) { 141 if (*buff++ == 0x42 && *buff++ == 0x42 && *buff++ == 0x03) {
144 struct sock *sk; 142 struct sock *sk;
@@ -220,7 +218,6 @@ static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
220static int lec_open(struct net_device *dev) 218static int lec_open(struct net_device *dev)
221{ 219{
222 netif_start_queue(dev); 220 netif_start_queue(dev);
223 memset(&dev->stats, 0, sizeof(struct net_device_stats));
224 221
225 return 0; 222 return 0;
226} 223}
@@ -817,8 +814,7 @@ static int lec_mcast_attach(struct atm_vcc *vcc, int arg)
817 if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg]) 814 if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg])
818 return -EINVAL; 815 return -EINVAL;
819 vcc->proto_data = dev_lec[arg]; 816 vcc->proto_data = dev_lec[arg];
820 return lec_mcast_make((struct lec_priv *)netdev_priv(dev_lec[arg]), 817 return lec_mcast_make(netdev_priv(dev_lec[arg]), vcc);
821 vcc);
822} 818}
823 819
824/* Initialize device. */ 820/* Initialize device. */
@@ -1175,14 +1171,13 @@ static int __init lane_module_init(void)
1175#endif 1171#endif
1176 1172
1177 register_atm_ioctl(&lane_ioctl_ops); 1173 register_atm_ioctl(&lane_ioctl_ops);
1178 pr_info("lec.c: " __DATE__ " " __TIME__ " initialized\n"); 1174 pr_info("lec.c: initialized\n");
1179 return 0; 1175 return 0;
1180} 1176}
1181 1177
1182static void __exit lane_module_cleanup(void) 1178static void __exit lane_module_cleanup(void)
1183{ 1179{
1184 int i; 1180 int i;
1185 struct lec_priv *priv;
1186 1181
1187 remove_proc_entry("lec", atm_proc_root); 1182 remove_proc_entry("lec", atm_proc_root);
1188 1183
@@ -1190,7 +1185,6 @@ static void __exit lane_module_cleanup(void)
1190 1185
1191 for (i = 0; i < MAX_LEC_ITF; i++) { 1186 for (i = 0; i < MAX_LEC_ITF; i++) {
1192 if (dev_lec[i] != NULL) { 1187 if (dev_lec[i] != NULL) {
1193 priv = netdev_priv(dev_lec[i]);
1194 unregister_netdev(dev_lec[i]); 1188 unregister_netdev(dev_lec[i]);
1195 free_netdev(dev_lec[i]); 1189 free_netdev(dev_lec[i]);
1196 dev_lec[i] = NULL; 1190 dev_lec[i] = NULL;
@@ -1609,7 +1603,7 @@ static void lec_arp_destroy(struct lec_priv *priv)
1609 struct lec_arp_table *entry; 1603 struct lec_arp_table *entry;
1610 int i; 1604 int i;
1611 1605
1612 cancel_rearming_delayed_work(&priv->lec_arp_work); 1606 cancel_delayed_work_sync(&priv->lec_arp_work);
1613 1607
1614 /* 1608 /*
1615 * Remove all entries 1609 * Remove all entries
diff --git a/net/atm/lec.h b/net/atm/lec.h
index 9d14d196cc1d..dfc071966463 100644
--- a/net/atm/lec.h
+++ b/net/atm/lec.h
@@ -35,7 +35,7 @@ struct lecdatahdr_8025 {
35 * Operations that LANE2 capable device can do. Two first functions 35 * Operations that LANE2 capable device can do. Two first functions
36 * are used to make the device do things. See spec 3.1.3 and 3.1.4. 36 * are used to make the device do things. See spec 3.1.3 and 3.1.4.
37 * 37 *
38 * The third function is intented for the MPOA component sitting on 38 * The third function is intended for the MPOA component sitting on
39 * top of the LANE device. The MPOA component assigns it's own function 39 * top of the LANE device. The MPOA component assigns it's own function
40 * to (*associate_indicator)() and the LANE device will use that 40 * to (*associate_indicator)() and the LANE device will use that
41 * function to tell about TLVs it sees floating through. 41 * function to tell about TLVs it sees floating through.
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 74bcc662c3dd..3ccca42e6f90 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -64,8 +64,6 @@
64 do { if (0) printk(KERN_CONT format, ##args); } while (0) 64 do { if (0) printk(KERN_CONT format, ##args); } while (0)
65#endif 65#endif
66 66
67#define MPOA_TAG_LEN 4
68
69/* mpc_daemon -> kernel */ 67/* mpc_daemon -> kernel */
70static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc); 68static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc);
71static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc); 69static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc);
@@ -1484,7 +1482,7 @@ static __init int atm_mpoa_init(void)
1484 if (mpc_proc_init() != 0) 1482 if (mpc_proc_init() != 0)
1485 pr_info("failed to initialize /proc/mpoa\n"); 1483 pr_info("failed to initialize /proc/mpoa\n");
1486 1484
1487 pr_info("mpc.c: " __DATE__ " " __TIME__ " initialized\n"); 1485 pr_info("mpc.c: initialized\n");
1488 1486
1489 return 0; 1487 return 0;
1490} 1488}
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 6262aeae398e..be3afdefec58 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -38,6 +38,7 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
38static const struct file_operations proc_atm_dev_ops = { 38static const struct file_operations proc_atm_dev_ops = {
39 .owner = THIS_MODULE, 39 .owner = THIS_MODULE,
40 .read = proc_dev_atm_read, 40 .read = proc_dev_atm_read,
41 .llseek = noop_llseek,
41}; 42};
42 43
43static void add_stats(struct seq_file *seq, const char *aal, 44static void add_stats(struct seq_file *seq, const char *aal,
@@ -190,7 +191,7 @@ static void vcc_info(struct seq_file *seq, struct atm_vcc *vcc)
190{ 191{
191 struct sock *sk = sk_atm(vcc); 192 struct sock *sk = sk_atm(vcc);
192 193
193 seq_printf(seq, "%p ", vcc); 194 seq_printf(seq, "%pK ", vcc);
194 if (!vcc->dev) 195 if (!vcc->dev)
195 seq_printf(seq, "Unassigned "); 196 seq_printf(seq, "Unassigned ");
196 else 197 else
@@ -217,7 +218,7 @@ static void svc_info(struct seq_file *seq, struct atm_vcc *vcc)
217{ 218{
218 if (!vcc->dev) 219 if (!vcc->dev)
219 seq_printf(seq, sizeof(void *) == 4 ? 220 seq_printf(seq, sizeof(void *) == 4 ?
220 "N/A@%p%10s" : "N/A@%p%2s", vcc, ""); 221 "N/A@%pK%10s" : "N/A@%pK%2s", vcc, "");
221 else 222 else
222 seq_printf(seq, "%3d %3d %5d ", 223 seq_printf(seq, "%3d %3d %5d ",
223 vcc->dev->number, vcc->vpi, vcc->vci); 224 vcc->dev->number, vcc->vpi, vcc->vci);
diff --git a/net/atm/resources.c b/net/atm/resources.c
index d29e58261511..23f45ce6f351 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -74,8 +74,9 @@ struct atm_dev *atm_dev_lookup(int number)
74} 74}
75EXPORT_SYMBOL(atm_dev_lookup); 75EXPORT_SYMBOL(atm_dev_lookup);
76 76
77struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, 77struct atm_dev *atm_dev_register(const char *type, struct device *parent,
78 int number, unsigned long *flags) 78 const struct atmdev_ops *ops, int number,
79 unsigned long *flags)
79{ 80{
80 struct atm_dev *dev, *inuse; 81 struct atm_dev *dev, *inuse;
81 82
@@ -115,7 +116,7 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
115 goto out_fail; 116 goto out_fail;
116 } 117 }
117 118
118 if (atm_register_sysfs(dev) < 0) { 119 if (atm_register_sysfs(dev, parent) < 0) {
119 pr_err("atm_register_sysfs failed for dev %s\n", type); 120 pr_err("atm_register_sysfs failed for dev %s\n", type);
120 atm_proc_dev_deregister(dev); 121 atm_proc_dev_deregister(dev);
121 goto out_fail; 122 goto out_fail;
diff --git a/net/atm/resources.h b/net/atm/resources.h
index 126fb1840dfb..521431e30507 100644
--- a/net/atm/resources.h
+++ b/net/atm/resources.h
@@ -42,6 +42,6 @@ static inline void atm_proc_dev_deregister(struct atm_dev *dev)
42 42
43#endif /* CONFIG_PROC_FS */ 43#endif /* CONFIG_PROC_FS */
44 44
45int atm_register_sysfs(struct atm_dev *adev); 45int atm_register_sysfs(struct atm_dev *adev, struct device *parent);
46void atm_unregister_sysfs(struct atm_dev *adev); 46void atm_unregister_sysfs(struct atm_dev *adev);
47#endif 47#endif