aboutsummaryrefslogtreecommitdiffstats
path: root/net/802
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /net/802
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'net/802')
-rw-r--r--net/802/Makefile1
-rw-r--r--net/802/fc.c4
-rw-r--r--net/802/fddi.c3
-rw-r--r--net/802/garp.c35
-rw-r--r--net/802/hippi.c3
-rw-r--r--net/802/p8022.c3
-rw-r--r--net/802/stp.c7
7 files changed, 30 insertions, 26 deletions
diff --git a/net/802/Makefile b/net/802/Makefile
index a30d6e385ae..7893d679910 100644
--- a/net/802/Makefile
+++ b/net/802/Makefile
@@ -4,6 +4,7 @@
4 4
5# Check the p8022 selections against net/core/Makefile. 5# Check the p8022 selections against net/core/Makefile.
6obj-$(CONFIG_LLC) += p8022.o psnap.o 6obj-$(CONFIG_LLC) += p8022.o psnap.o
7obj-$(CONFIG_TR) += p8022.o psnap.o tr.o
7obj-$(CONFIG_NET_FC) += fc.o 8obj-$(CONFIG_NET_FC) += fc.o
8obj-$(CONFIG_FDDI) += fddi.o 9obj-$(CONFIG_FDDI) += fddi.o
9obj-$(CONFIG_HIPPI) += hippi.o 10obj-$(CONFIG_HIPPI) += hippi.o
diff --git a/net/802/fc.c b/net/802/fc.c
index 05eea6b98bb..1e49f2d4ea9 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/system.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/string.h> 17#include <linux/string.h>
@@ -26,7 +27,6 @@
26#include <linux/net.h> 27#include <linux/net.h>
27#include <linux/proc_fs.h> 28#include <linux/proc_fs.h>
28#include <linux/init.h> 29#include <linux/init.h>
29#include <linux/export.h>
30#include <net/arp.h> 30#include <net/arp.h>
31 31
32/* 32/*
@@ -35,7 +35,7 @@
35 35
36static int fc_header(struct sk_buff *skb, struct net_device *dev, 36static int fc_header(struct sk_buff *skb, struct net_device *dev,
37 unsigned short type, 37 unsigned short type,
38 const void *daddr, const void *saddr, unsigned int len) 38 const void *daddr, const void *saddr, unsigned len)
39{ 39{
40 struct fch_hdr *fch; 40 struct fch_hdr *fch;
41 int hdr_len; 41 int hdr_len;
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 9cda40661e0..94b3ad08f39 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -27,6 +27,7 @@
27 */ 27 */
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <asm/system.h>
30#include <linux/types.h> 31#include <linux/types.h>
31#include <linux/kernel.h> 32#include <linux/kernel.h>
32#include <linux/string.h> 33#include <linux/string.h>
@@ -51,7 +52,7 @@
51 52
52static int fddi_header(struct sk_buff *skb, struct net_device *dev, 53static int fddi_header(struct sk_buff *skb, struct net_device *dev,
53 unsigned short type, 54 unsigned short type,
54 const void *daddr, const void *saddr, unsigned int len) 55 const void *daddr, const void *saddr, unsigned len)
55{ 56{
56 int hl = FDDI_K_SNAP_HLEN; 57 int hl = FDDI_K_SNAP_HLEN;
57 struct fddihdr *fddi; 58 struct fddihdr *fddi;
diff --git a/net/802/garp.c b/net/802/garp.c
index 8456f5d98b8..16102951d36 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -15,7 +15,6 @@
15#include <linux/rtnetlink.h> 15#include <linux/rtnetlink.h>
16#include <linux/llc.h> 16#include <linux/llc.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/module.h>
19#include <net/llc.h> 18#include <net/llc.h>
20#include <net/llc_pdu.h> 19#include <net/llc_pdu.h>
21#include <net/garp.h> 20#include <net/garp.h>
@@ -157,9 +156,9 @@ static struct garp_attr *garp_attr_lookup(const struct garp_applicant *app,
157 while (parent) { 156 while (parent) {
158 attr = rb_entry(parent, struct garp_attr, node); 157 attr = rb_entry(parent, struct garp_attr, node);
159 d = garp_attr_cmp(attr, data, len, type); 158 d = garp_attr_cmp(attr, data, len, type);
160 if (d > 0) 159 if (d < 0)
161 parent = parent->rb_left; 160 parent = parent->rb_left;
162 else if (d < 0) 161 else if (d > 0)
163 parent = parent->rb_right; 162 parent = parent->rb_right;
164 else 163 else
165 return attr; 164 return attr;
@@ -167,8 +166,7 @@ static struct garp_attr *garp_attr_lookup(const struct garp_applicant *app,
167 return NULL; 166 return NULL;
168} 167}
169 168
170static struct garp_attr *garp_attr_create(struct garp_applicant *app, 169static void garp_attr_insert(struct garp_applicant *app, struct garp_attr *new)
171 const void *data, u8 len, u8 type)
172{ 170{
173 struct rb_node *parent = NULL, **p = &app->gid.rb_node; 171 struct rb_node *parent = NULL, **p = &app->gid.rb_node;
174 struct garp_attr *attr; 172 struct garp_attr *attr;
@@ -177,16 +175,21 @@ static struct garp_attr *garp_attr_create(struct garp_applicant *app,
177 while (*p) { 175 while (*p) {
178 parent = *p; 176 parent = *p;
179 attr = rb_entry(parent, struct garp_attr, node); 177 attr = rb_entry(parent, struct garp_attr, node);
180 d = garp_attr_cmp(attr, data, len, type); 178 d = garp_attr_cmp(attr, new->data, new->dlen, new->type);
181 if (d > 0) 179 if (d < 0)
182 p = &parent->rb_left; 180 p = &parent->rb_left;
183 else if (d < 0) 181 else if (d > 0)
184 p = &parent->rb_right; 182 p = &parent->rb_right;
185 else {
186 /* The attribute already exists; re-use it. */
187 return attr;
188 }
189 } 183 }
184 rb_link_node(&new->node, parent, p);
185 rb_insert_color(&new->node, &app->gid);
186}
187
188static struct garp_attr *garp_attr_create(struct garp_applicant *app,
189 const void *data, u8 len, u8 type)
190{
191 struct garp_attr *attr;
192
190 attr = kmalloc(sizeof(*attr) + len, GFP_ATOMIC); 193 attr = kmalloc(sizeof(*attr) + len, GFP_ATOMIC);
191 if (!attr) 194 if (!attr)
192 return attr; 195 return attr;
@@ -194,9 +197,7 @@ static struct garp_attr *garp_attr_create(struct garp_applicant *app,
194 attr->type = type; 197 attr->type = type;
195 attr->dlen = len; 198 attr->dlen = len;
196 memcpy(attr->data, data, len); 199 memcpy(attr->data, data, len);
197 200 garp_attr_insert(app, attr);
198 rb_link_node(&attr->node, parent, p);
199 rb_insert_color(&attr->node, &app->gid);
200 return attr; 201 return attr;
201} 202}
202 203
@@ -552,7 +553,7 @@ static void garp_release_port(struct net_device *dev)
552 if (rtnl_dereference(port->applicants[i])) 553 if (rtnl_dereference(port->applicants[i]))
553 return; 554 return;
554 } 555 }
555 RCU_INIT_POINTER(dev->garp_port, NULL); 556 rcu_assign_pointer(dev->garp_port, NULL);
556 kfree_rcu(port, rcu); 557 kfree_rcu(port, rcu);
557} 558}
558 559
@@ -604,7 +605,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl
604 605
605 ASSERT_RTNL(); 606 ASSERT_RTNL();
606 607
607 RCU_INIT_POINTER(port->applicants[appl->type], NULL); 608 rcu_assign_pointer(port->applicants[appl->type], NULL);
608 609
609 /* Delete timer and generate a final TRANSMIT_PDU event to flush out 610 /* Delete timer and generate a final TRANSMIT_PDU event to flush out
610 * all pending messages before the applicant is gone. */ 611 * all pending messages before the applicant is gone. */
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 51a1f530417..91aca8780fd 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -35,6 +35,7 @@
35#include <net/arp.h> 35#include <net/arp.h>
36#include <net/sock.h> 36#include <net/sock.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/system.h>
38 39
39/* 40/*
40 * Create the HIPPI MAC header for an arbitrary protocol layer 41 * Create the HIPPI MAC header for an arbitrary protocol layer
@@ -45,7 +46,7 @@
45 46
46static int hippi_header(struct sk_buff *skb, struct net_device *dev, 47static int hippi_header(struct sk_buff *skb, struct net_device *dev,
47 unsigned short type, 48 unsigned short type,
48 const void *daddr, const void *saddr, unsigned int len) 49 const void *daddr, const void *saddr, unsigned len)
49{ 50{
50 struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN); 51 struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN);
51 struct hippi_cb *hcb = (struct hippi_cb *) skb->cb; 52 struct hippi_cb *hcb = (struct hippi_cb *) skb->cb;
diff --git a/net/802/p8022.c b/net/802/p8022.c
index 0bda8de7df5..7f353c4f437 100644
--- a/net/802/p8022.c
+++ b/net/802/p8022.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * NET3: Support for 802.2 demultiplexing off Ethernet 2 * NET3: Support for 802.2 demultiplexing off Ethernet (Token ring
3 * is kept separate see p8022tr.c)
3 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version 6 * as published by the Free Software Foundation; either version
diff --git a/net/802/stp.c b/net/802/stp.c
index 2c40ba0ec11..978c30b1b36 100644
--- a/net/802/stp.c
+++ b/net/802/stp.c
@@ -12,7 +12,6 @@
12#include <linux/etherdevice.h> 12#include <linux/etherdevice.h>
13#include <linux/llc.h> 13#include <linux/llc.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/module.h>
16#include <net/llc.h> 15#include <net/llc.h>
17#include <net/llc_pdu.h> 16#include <net/llc_pdu.h>
18#include <net/stp.h> 17#include <net/stp.h>
@@ -46,7 +45,7 @@ static int stp_pdu_rcv(struct sk_buff *skb, struct net_device *dev,
46 proto = rcu_dereference(garp_protos[eh->h_dest[5] - 45 proto = rcu_dereference(garp_protos[eh->h_dest[5] -
47 GARP_ADDR_MIN]); 46 GARP_ADDR_MIN]);
48 if (proto && 47 if (proto &&
49 !ether_addr_equal(eh->h_dest, proto->group_address)) 48 compare_ether_addr(eh->h_dest, proto->group_address))
50 goto err; 49 goto err;
51 } else 50 } else
52 proto = rcu_dereference(stp_proto); 51 proto = rcu_dereference(stp_proto);
@@ -89,9 +88,9 @@ void stp_proto_unregister(const struct stp_proto *proto)
89{ 88{
90 mutex_lock(&stp_proto_mutex); 89 mutex_lock(&stp_proto_mutex);
91 if (is_zero_ether_addr(proto->group_address)) 90 if (is_zero_ether_addr(proto->group_address))
92 RCU_INIT_POINTER(stp_proto, NULL); 91 rcu_assign_pointer(stp_proto, NULL);
93 else 92 else
94 RCU_INIT_POINTER(garp_protos[proto->group_address[5] - 93 rcu_assign_pointer(garp_protos[proto->group_address[5] -
95 GARP_ADDR_MIN], NULL); 94 GARP_ADDR_MIN], NULL);
96 synchronize_rcu(); 95 synchronize_rcu();
97 96