aboutsummaryrefslogtreecommitdiffstats
path: root/net/802
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-09 22:41:59 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-15 20:23:16 -0400
commitee446fd5e6dafee4a16fd1bd345d2571dcfd6f5d (patch)
tree6c2400cff6bd26c8bfb06bd523b227a0e3aa232e /net/802
parent211ed865108e24697b44bee5daac502ee6bdd4a4 (diff)
tokenring: delete all remaining driver support
This represents the mass deletion of the of the tokenring support. It gets rid of: - the net/tr.c which the drivers depended on - the drivers/net component - the Kbuild infrastructure around it - any tokenring related CONFIG_ settings in any defconfigs - the tokenring headers in the include/linux dir - the firmware associated with the tokenring drivers. - any associated token ring documentation. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/802')
-rw-r--r--net/802/Makefile1
-rw-r--r--net/802/tr.c669
2 files changed, 0 insertions, 670 deletions
diff --git a/net/802/Makefile b/net/802/Makefile
index 7893d679910c..a30d6e385aed 100644
--- a/net/802/Makefile
+++ b/net/802/Makefile
@@ -4,7 +4,6 @@
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
8obj-$(CONFIG_NET_FC) += fc.o 7obj-$(CONFIG_NET_FC) += fc.o
9obj-$(CONFIG_FDDI) += fddi.o 8obj-$(CONFIG_FDDI) += fddi.o
10obj-$(CONFIG_HIPPI) += hippi.o 9obj-$(CONFIG_HIPPI) += hippi.o
diff --git a/net/802/tr.c b/net/802/tr.c
deleted file mode 100644
index 175243b0d6d8..000000000000
--- a/net/802/tr.c
+++ /dev/null
@@ -1,669 +0,0 @@
1/*
2 * NET3: Token ring device handling subroutines
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Fixes: 3 Feb 97 Paul Norton <pnorton@cts.com> Minor routing fixes.
10 * Added rif table to /proc/net/tr_rif and rif timeout to
11 * /proc/sys/net/token-ring/rif_timeout.
12 * 22 Jun 98 Paul Norton <p.norton@computer.org> Rearranged
13 * tr_header and tr_type_trans to handle passing IPX SNAP and
14 * 802.2 through the correct layers. Eliminated tr_reformat.
15 *
16 */
17
18#include <asm/uaccess.h>
19#include <linux/module.h>
20#include <linux/types.h>
21#include <linux/kernel.h>
22#include <linux/jiffies.h>
23#include <linux/string.h>
24#include <linux/mm.h>
25#include <linux/socket.h>
26#include <linux/in.h>
27#include <linux/inet.h>
28#include <linux/netdevice.h>
29#include <linux/trdevice.h>
30#include <linux/skbuff.h>
31#include <linux/errno.h>
32#include <linux/timer.h>
33#include <linux/net.h>
34#include <linux/proc_fs.h>
35#include <linux/seq_file.h>
36#include <linux/init.h>
37#include <linux/sysctl.h>
38#include <linux/slab.h>
39#include <net/arp.h>
40#include <net/net_namespace.h>
41
42static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev);
43static void rif_check_expire(unsigned long dummy);
44
45#define TR_SR_DEBUG 0
46
47/*
48 * Each RIF entry we learn is kept this way
49 */
50
51struct rif_cache {
52 unsigned char addr[TR_ALEN];
53 int iface;
54 __be16 rcf;
55 __be16 rseg[8];
56 struct rif_cache *next;
57 unsigned long last_used;
58 unsigned char local_ring;
59};
60
61#define RIF_TABLE_SIZE 32
62
63/*
64 * We hash the RIF cache 32 ways. We do after all have to look it
65 * up a lot.
66 */
67
68static struct rif_cache *rif_table[RIF_TABLE_SIZE];
69
70static DEFINE_SPINLOCK(rif_lock);
71
72
73/*
74 * Garbage disposal timer.
75 */
76
77static struct timer_list rif_timer;
78
79static int sysctl_tr_rif_timeout = 60*10*HZ;
80
81static inline unsigned long rif_hash(const unsigned char *addr)
82{
83 unsigned long x;
84
85 x = addr[0];
86 x = (x << 2) ^ addr[1];
87 x = (x << 2) ^ addr[2];
88 x = (x << 2) ^ addr[3];
89 x = (x << 2) ^ addr[4];
90 x = (x << 2) ^ addr[5];
91
92 x ^= x >> 8;
93
94 return x & (RIF_TABLE_SIZE - 1);
95}
96
97/*
98 * Put the headers on a token ring packet. Token ring source routing
99 * makes this a little more exciting than on ethernet.
100 */
101
102static int tr_header(struct sk_buff *skb, struct net_device *dev,
103 unsigned short type,
104 const void *daddr, const void *saddr, unsigned int len)
105{
106 struct trh_hdr *trh;
107 int hdr_len;
108
109 /*
110 * Add the 802.2 SNAP header if IP as the IPv4/IPv6 code calls
111 * dev->hard_header directly.
112 */
113 if (type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP)
114 {
115 struct trllc *trllc;
116
117 hdr_len = sizeof(struct trh_hdr) + sizeof(struct trllc);
118 trh = (struct trh_hdr *)skb_push(skb, hdr_len);
119 trllc = (struct trllc *)(trh+1);
120 trllc->dsap = trllc->ssap = EXTENDED_SAP;
121 trllc->llc = UI_CMD;
122 trllc->protid[0] = trllc->protid[1] = trllc->protid[2] = 0x00;
123 trllc->ethertype = htons(type);
124 }
125 else
126 {
127 hdr_len = sizeof(struct trh_hdr);
128 trh = (struct trh_hdr *)skb_push(skb, hdr_len);
129 }
130
131 trh->ac=AC;
132 trh->fc=LLC_FRAME;
133
134 if(saddr)
135 memcpy(trh->saddr,saddr,dev->addr_len);
136 else
137 memcpy(trh->saddr,dev->dev_addr,dev->addr_len);
138
139 /*
140 * Build the destination and then source route the frame
141 */
142
143 if(daddr)
144 {
145 memcpy(trh->daddr,daddr,dev->addr_len);
146 tr_source_route(skb, trh, dev);
147 return hdr_len;
148 }
149
150 return -hdr_len;
151}
152
153/*
154 * A neighbour discovery of some species (eg arp) has completed. We
155 * can now send the packet.
156 */
157
158static int tr_rebuild_header(struct sk_buff *skb)
159{
160 struct trh_hdr *trh=(struct trh_hdr *)skb->data;
161 struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr));
162 struct net_device *dev = skb->dev;
163
164 /*
165 * FIXME: We don't yet support IPv6 over token rings
166 */
167
168 if(trllc->ethertype != htons(ETH_P_IP)) {
169 printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(trllc->ethertype));
170 return 0;
171 }
172
173#ifdef CONFIG_INET
174 if(arp_find(trh->daddr, skb)) {
175 return 1;
176 }
177 else
178#endif
179 {
180 tr_source_route(skb,trh,dev);
181 return 0;
182 }
183}
184
185/*
186 * Some of this is a bit hackish. We intercept RIF information
187 * used for source routing. We also grab IP directly and don't feed
188 * it via SNAP.
189 */
190
191__be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
192{
193
194 struct trh_hdr *trh;
195 struct trllc *trllc;
196 unsigned int riflen=0;
197
198 skb->dev = dev;
199 skb_reset_mac_header(skb);
200 trh = tr_hdr(skb);
201
202 if(trh->saddr[0] & TR_RII)
203 riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;
204
205 trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
206
207 skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
208
209 if(*trh->daddr & 0x80)
210 {
211 if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN))
212 skb->pkt_type=PACKET_BROADCAST;
213 else