tr.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  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. #include <asm/uaccess.h>
  18. #include <asm/system.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 <net/arp.h>
  39. #include <net/net_namespace.h>
  40. static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev);
  41. static void rif_check_expire(unsigned long dummy);
  42. #define TR_SR_DEBUG 0
  43. /*
  44. * Each RIF entry we learn is kept this way
  45. */
  46. struct rif_cache {
  47. unsigned char addr[TR_ALEN];
  48. int iface;
  49. __be16 rcf;
  50. __be16 rseg[8];
  51. struct rif_cache *next;
  52. unsigned long last_used;
  53. unsigned char local_ring;
  54. };
  55. #define RIF_TABLE_SIZE 32
  56. /*
  57. * We hash the RIF cache 32 ways. We do after all have to look it
  58. * up a lot.
  59. */
  60. static struct rif_cache *rif_table[RIF_TABLE_SIZE];
  61. static DEFINE_SPINLOCK(rif_lock);
  62. /*
  63. * Garbage disposal timer.
  64. */
  65. static struct timer_list rif_timer;
  66. static int sysctl_tr_rif_timeout = 60*10*HZ;
  67. static inline unsigned long rif_hash(const unsigned char *addr)
  68. {
  69. unsigned long x;
  70. x = addr[0];
  71. x = (x << 2) ^ addr[1];
  72. x = (x << 2) ^ addr[2];
  73. x = (x << 2) ^ addr[3];
  74. x = (x << 2) ^ addr[4];
  75. x = (x << 2) ^ addr[5];
  76. x ^= x >> 8;
  77. return x & (RIF_TABLE_SIZE - 1);
  78. }
  79. /*
  80. * Put the headers on a token ring packet. Token ring source routing
  81. * makes this a little more exciting than on ethernet.
  82. */
  83. static int tr_header(struct sk_buff *skb, struct net_device *dev,
  84. unsigned short type,
  85. const void *daddr, const void *saddr, unsigned len)
  86. {
  87. struct trh_hdr *trh;
  88. int hdr_len;
  89. /*
  90. * Add the 802.2 SNAP header if IP as the IPv4/IPv6 code calls
  91. * dev->hard_header directly.
  92. */
  93. if (type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP)
  94. {
  95. struct trllc *trllc;
  96. hdr_len = sizeof(struct trh_hdr) + sizeof(struct trllc);
  97. trh = (struct trh_hdr *)skb_push(skb, hdr_len);
  98. trllc = (struct trllc *)(trh+1);
  99. trllc->dsap = trllc->ssap = EXTENDED_SAP;
  100. trllc->llc = UI_CMD;
  101. trllc->protid[0] = trllc->protid[1] = trllc->protid[2] = 0x00;
  102. trllc->ethertype = htons(type);
  103. }
  104. else
  105. {
  106. hdr_len = sizeof(struct trh_hdr);
  107. trh = (struct trh_hdr *)skb_push(skb, hdr_len);
  108. }
  109. trh->ac=AC;
  110. trh->fc=LLC_FRAME;
  111. if(saddr)
  112. memcpy(trh->saddr,saddr,dev->addr_len);
  113. else
  114. memcpy(trh->saddr,dev->dev_addr,dev->addr_len);
  115. /*
  116. * Build the destination and then source route the frame
  117. */
  118. if(daddr)
  119. {
  120. memcpy(trh->daddr,daddr,dev->addr_len);
  121. tr_source_route(skb, trh, dev);
  122. return(hdr_len);
  123. }
  124. return -hdr_len;
  125. }
  126. /*
  127. * A neighbour discovery of some species (eg arp) has completed. We
  128. * can now send the packet.
  129. */
  130. static int tr_rebuild_header(struct sk_buff *skb)
  131. {
  132. struct trh_hdr *trh=(struct trh_hdr *)skb->data;
  133. struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr));
  134. struct net_device *dev = skb->dev;
  135. /*
  136. * FIXME: We don't yet support IPv6 over token rings
  137. */
  138. if(trllc->ethertype != htons(ETH_P_IP)) {
  139. printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(trllc->ethertype));
  140. return 0;
  141. }
  142. #ifdef CONFIG_INET
  143. if(arp_find(trh->daddr, skb)) {
  144. return 1;
  145. }
  146. else
  147. #endif
  148. {
  149. tr_source_route(skb,trh,dev);
  150. return 0;
  151. }
  152. }
  153. /*
  154. * Some of this is a bit hackish. We intercept RIF information
  155. * used for source routing. We also grab IP directly and don't feed
  156. * it via SNAP.
  157. */
  158. __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
  159. {
  160. struct trh_hdr *trh;
  161. struct trllc *trllc;
  162. unsigned riflen=0;
  163. skb->dev = dev;
  164. skb_reset_mac_header(skb);
  165. trh = tr_hdr(skb);
  166. if(trh->saddr[0] & TR_RII)
  167. riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;
  168. trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
  169. skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
  170. if(*trh->daddr & 0x80)
  171. {
  172. if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN))
  173. skb->pkt_type=PACKET_BROADCAST;
  174. else
  175. skb->pkt_type=PACKET_MULTICAST;
  176. }
  177. else if ( (trh->daddr[0] & 0x01) && (trh->daddr[1] & 0x00) && (trh->daddr[2] & 0x5E))
  178. {
  179. skb->pkt_type=PACKET_MULTICAST;
  180. }
  181. else if(dev->flags & IFF_PROMISC)
  182. {
  183. if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN))
  184. skb->pkt_type=PACKET_OTHERHOST;
  185. }
  186. if ((skb->pkt_type != PACKET_BROADCAST) &&
  187. (skb->pkt_type != PACKET_MULTICAST))
  188. tr_add_rif_info(trh,dev) ;
  189. /*
  190. * Strip the SNAP header from ARP packets since we don't
  191. * pass them through to the 802.2/SNAP layers.
  192. */
  193. if (trllc->dsap == EXTENDED_SAP &&
  194. (trllc->ethertype == htons(ETH_P_IP) ||
  195. trllc->ethertype == htons(ETH_P_IPV6) ||
  196. trllc->ethertype == htons(ETH_P_ARP)))
  197. {
  198. skb_pull(skb, sizeof(struct trllc));
  199. return trllc->ethertype;
  200. }
  201. return htons(ETH_P_TR_802_2);
  202. }
  203. /*
  204. * We try to do source routing...
  205. */
  206. void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,
  207. struct net_device *dev)
  208. {
  209. int slack;
  210. unsigned int hash;
  211. struct rif_cache *entry;
  212. unsigned char *olddata;
  213. unsigned long flags;
  214. static const unsigned char mcast_func_addr[]
  215. = {0xC0,0x00,0x00,0x04,0x00,0x00};
  216. spin_lock_irqsave(&rif_lock, flags);
  217. /*
  218. * Broadcasts are single route as stated in RFC 1042
  219. */
  220. if( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) ||
  221. (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN)) )
  222. {
  223. trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
  224. | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
  225. trh->saddr[0]|=TR_RII;
  226. }
  227. else
  228. {
  229. hash = rif_hash(trh->daddr);
  230. /*
  231. * Walk the hash table and look for an entry
  232. */
  233. for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->daddr[0]),TR_ALEN);entry=entry->next);
  234. /*
  235. * If we found an entry we can route the frame.
  236. */
  237. if(entry)
  238. {
  239. #if TR_SR_DEBUG
  240. {
  241. DECLARE_MAC_BUF(mac);
  242. printk("source routing for %s\n",print_mac(mac, trh->daddr));
  243. }
  244. #endif
  245. if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8)
  246. {
  247. trh->rcf=entry->rcf;
  248. memcpy(&trh->rseg[0],&entry->rseg[0],8*sizeof(unsigned short));
  249. trh->rcf^=htons(TR_RCF_DIR_BIT);
  250. trh->rcf&=htons(0x1fff); /* Issam Chehab <ichehab@madge1.demon.co.uk> */
  251. trh->saddr[0]|=TR_RII;
  252. #if TR_SR_DEBUG
  253. printk("entry found with rcf %04x\n", entry->rcf);
  254. }
  255. else
  256. {
  257. printk("entry found but without rcf length, local=%02x\n", entry->local_ring);
  258. #endif
  259. }
  260. entry->last_used=jiffies;
  261. }
  262. else
  263. {
  264. /*
  265. * Without the information we simply have to shout
  266. * on the wire. The replies should rapidly clean this
  267. * situation up.
  268. */
  269. trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
  270. | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
  271. trh->saddr[0]|=TR_RII;
  272. #if TR_SR_DEBUG
  273. printk("no entry in rif table found - broadcasting frame\n");
  274. #endif
  275. }
  276. }
  277. /* Compress the RIF here so we don't have to do it in the driver(s) */
  278. if (!(trh->saddr[0] & 0x80))
  279. slack = 18;
  280. else
  281. slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
  282. olddata = skb->data;
  283. spin_unlock_irqrestore(&rif_lock, flags);
  284. skb_pull(skb, slack);
  285. memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);
  286. }
  287. /*
  288. * We have learned some new RIF information for our source
  289. * routing.
  290. */
  291. static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
  292. {
  293. unsigned int hash, rii_p = 0;
  294. unsigned long flags;
  295. struct rif_cache *entry;
  296. unsigned char saddr0;
  297. spin_lock_irqsave(&rif_lock, flags);
  298. saddr0 = trh->saddr[0];
  299. /*
  300. * Firstly see if the entry exists
  301. */
  302. if(trh->saddr[0] & TR_RII)
  303. {
  304. trh->saddr[0]&=0x7f;
  305. if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2)
  306. {
  307. rii_p = 1;
  308. }
  309. }
  310. hash = rif_hash(trh->saddr);
  311. for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);entry=entry->next);
  312. if(entry==NULL)
  313. {
  314. #if TR_SR_DEBUG
  315. DECLARE_MAC_BUF(mac);
  316. printk("adding rif_entry: addr:%s rcf:%04X\n",
  317. print_mac(mac, trh->saddr), ntohs(trh->rcf));
  318. #endif
  319. /*
  320. * Allocate our new entry. A failure to allocate loses
  321. * use the information. This is harmless.
  322. *
  323. * FIXME: We ought to keep some kind of cache size
  324. * limiting and adjust the timers to suit.
  325. */
  326. entry=kmalloc(sizeof(struct rif_cache),GFP_ATOMIC);
  327. if(!entry)
  328. {
  329. printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
  330. spin_unlock_irqrestore(&rif_lock, flags);
  331. return;
  332. }
  333. memcpy(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);
  334. entry->iface = dev->ifindex;
  335. entry->next=rif_table[hash];
  336. entry->last_used=jiffies;
  337. rif_table[hash]=entry;
  338. if (rii_p)
  339. {
  340. entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
  341. memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
  342. entry->local_ring = 0;
  343. }
  344. else
  345. {
  346. entry->local_ring = 1;
  347. }
  348. }
  349. else /* Y. Tahara added */
  350. {
  351. /*
  352. * Update existing entries
  353. */
  354. if (!entry->local_ring)
  355. if (entry->rcf != (trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK)) &&
  356. !(trh->rcf & htons(TR_RCF_BROADCAST_MASK)))
  357. {
  358. #if TR_SR_DEBUG
  359. {
  360. DECLARE_MAC_BUF(mac);
  361. printk("updating rif_entry: addr:%s rcf:%04X\n",
  362. print_mac(mac, trh->saddr), ntohs(trh->rcf));
  363. }
  364. #endif
  365. entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
  366. memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
  367. }
  368. entry->last_used=jiffies;
  369. }
  370. trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */
  371. spin_unlock_irqrestore(&rif_lock, flags);
  372. }
  373. /*
  374. * Scan the cache with a timer and see what we need to throw out.
  375. */
  376. static void rif_check_expire(unsigned long dummy)
  377. {
  378. int i;
  379. unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
  380. spin_lock_irqsave(&rif_lock, flags);
  381. for(i =0; i < RIF_TABLE_SIZE; i++) {
  382. struct rif_cache *entry, **pentry;
  383. pentry = rif_table+i;
  384. while((entry=*pentry) != NULL) {
  385. unsigned long expires
  386. = entry->last_used + sysctl_tr_rif_timeout;
  387. if (time_before_eq(expires, jiffies)) {
  388. *pentry = entry->next;
  389. kfree(entry);
  390. } else {
  391. pentry = &entry->next;
  392. if (time_before(expires, next_interval))
  393. next_interval = expires;
  394. }
  395. }
  396. }
  397. spin_unlock_irqrestore(&rif_lock, flags);
  398. mod_timer(&rif_timer, next_interval);
  399. }
  400. /*
  401. * Generate the /proc/net information for the token ring RIF
  402. * routing.
  403. */
  404. #ifdef CONFIG_PROC_FS
  405. static struct rif_cache *rif_get_idx(loff_t pos)
  406. {
  407. int i;
  408. struct rif_cache *entry;
  409. loff_t off = 0;
  410. for(i = 0; i < RIF_TABLE_SIZE; i++)
  411. for(entry = rif_table[i]; entry; entry = entry->next) {
  412. if (off == pos)
  413. return entry;
  414. ++off;
  415. }
  416. return NULL;
  417. }
  418. static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
  419. {
  420. spin_lock_irq(&rif_lock);
  421. return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
  422. }
  423. static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
  424. {
  425. int i;
  426. struct rif_cache *ent = v;
  427. ++*pos;
  428. if (v == SEQ_START_TOKEN) {
  429. i = -1;
  430. goto scan;
  431. }
  432. if (ent->next)
  433. return ent->next;
  434. i = rif_hash(ent->addr);
  435. scan:
  436. while (++i < RIF_TABLE_SIZE) {
  437. if ((ent = rif_table[i]) != NULL)
  438. return ent;
  439. }
  440. return NULL;
  441. }
  442. static void rif_seq_stop(struct seq_file *seq, void *v)
  443. {
  444. spin_unlock_irq(&rif_lock);
  445. }
  446. static int rif_seq_show(struct seq_file *seq, void *v)
  447. {
  448. int j, rcf_len, segment, brdgnmb;
  449. struct rif_cache *entry = v;
  450. DECLARE_MAC_BUF(mac);
  451. if (v == SEQ_START_TOKEN)
  452. seq_puts(seq,
  453. "if TR address TTL rcf routing segments\n");
  454. else {
  455. struct net_device *dev = dev_get_by_index(&init_net, entry->iface);
  456. long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout)
  457. - (long) jiffies;
  458. seq_printf(seq, "%s %s %7li ",
  459. dev?dev->name:"?",
  460. print_mac(mac, entry->addr),
  461. ttl/HZ);
  462. if (entry->local_ring)
  463. seq_puts(seq, "local\n");
  464. else {
  465. seq_printf(seq, "%04X", ntohs(entry->rcf));
  466. rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2;
  467. if (rcf_len)
  468. rcf_len >>= 1;
  469. for(j = 1; j < rcf_len; j++) {
  470. if(j==1) {
  471. segment=ntohs(entry->rseg[j-1])>>4;
  472. seq_printf(seq," %03X",segment);
  473. }
  474. segment=ntohs(entry->rseg[j])>>4;
  475. brdgnmb=ntohs(entry->rseg[j-1])&0x00f;
  476. seq_printf(seq,"-%01X-%03X",brdgnmb,segment);
  477. }
  478. seq_putc(seq, '\n');
  479. }
  480. }
  481. return 0;
  482. }
  483. static const struct seq_operations rif_seq_ops = {
  484. .start = rif_seq_start,
  485. .next = rif_seq_next,
  486. .stop = rif_seq_stop,
  487. .show = rif_seq_show,
  488. };
  489. static int rif_seq_open(struct inode *inode, struct file *file)
  490. {
  491. return seq_open(file, &rif_seq_ops);
  492. }
  493. static const struct file_operations rif_seq_fops = {
  494. .owner = THIS_MODULE,
  495. .open = rif_seq_open,
  496. .read = seq_read,
  497. .llseek = seq_lseek,
  498. .release = seq_release,
  499. };
  500. #endif
  501. static const struct header_ops tr_header_ops = {
  502. .create = tr_header,
  503. .rebuild= tr_rebuild_header,
  504. };
  505. static void tr_setup(struct net_device *dev)
  506. {
  507. /*
  508. * Configure and register
  509. */
  510. dev->header_ops = &tr_header_ops;
  511. dev->type = ARPHRD_IEEE802_TR;
  512. dev->hard_header_len = TR_HLEN;
  513. dev->mtu = 2000;
  514. dev->addr_len = TR_ALEN;
  515. dev->tx_queue_len = 100; /* Long queues on tr */
  516. memset(dev->broadcast,0xFF, TR_ALEN);
  517. /* New-style flags. */
  518. dev->flags = IFF_BROADCAST | IFF_MULTICAST ;
  519. }
  520. /**
  521. * alloc_trdev - Register token ring device
  522. * @sizeof_priv: Size of additional driver-private structure to be allocated
  523. * for this token ring device
  524. *
  525. * Fill in the fields of the device structure with token ring-generic values.
  526. *
  527. * Constructs a new net device, complete with a private data area of
  528. * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
  529. * this private data area.
  530. */
  531. struct net_device *alloc_trdev(int sizeof_priv)
  532. {
  533. return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
  534. }
  535. #ifdef CONFIG_SYSCTL
  536. static struct ctl_table tr_table[] = {
  537. {
  538. .ctl_name = NET_TR_RIF_TIMEOUT,
  539. .procname = "rif_timeout",
  540. .data = &sysctl_tr_rif_timeout,
  541. .maxlen = sizeof(int),
  542. .mode = 0644,
  543. .proc_handler = &proc_dointvec
  544. },
  545. { 0 },
  546. };
  547. static __initdata struct ctl_path tr_path[] = {
  548. { .procname = "net", .ctl_name = CTL_NET, },
  549. { .procname = "token-ring", .ctl_name = NET_TR, },
  550. { }
  551. };
  552. #endif
  553. /*
  554. * Called during bootup. We don't actually have to initialise
  555. * too much for this.
  556. */
  557. static int __init rif_init(void)
  558. {
  559. rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
  560. setup_timer(&rif_timer, rif_check_expire, 0);
  561. add_timer(&rif_timer);
  562. #ifdef CONFIG_SYSCTL
  563. register_sysctl_paths(tr_path, tr_table);
  564. #endif
  565. proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
  566. return 0;
  567. }
  568. module_init(rif_init);
  569. EXPORT_SYMBOL(tr_type_trans);
  570. EXPORT_SYMBOL(alloc_trdev);