root/net/core/dev.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. min
  2. dev_add_pack
  3. dev_remove_pack
  4. dev_get
  5. dev_load
  6. dev_open
  7. dev_close
  8. register_netdevice_notifier
  9. unregister_netdevice_notifier
  10. dev_queue_xmit
  11. netif_rx
  12. dev_transmit
  13. in_net_bh
  14. net_bh
  15. dev_tint
  16. dev_ifconf
  17. sprintf_stats
  18. dev_get_info
  19. bad_mask
  20. dev_ifsioc
  21. dev_ioctl
  22. net_dev_init

   1 /*
   2  *      NET3    Protocol independent device support routines.
   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  *      Derived from the non IP parts of dev.c 1.0.19
  10  *              Authors:        Ross Biro, <bir7@leland.Stanford.Edu>
  11  *                              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  12  *                              Mark Evans, <evansmp@uhura.aston.ac.uk>
  13  *
  14  *      Additional Authors:
  15  *              Florian la Roche <rzsfl@rz.uni-sb.de>
  16  *              Alan Cox <gw4pts@gw4pts.ampr.org>
  17  *              David Hinds <dhinds@allegro.stanford.edu>
  18  *
  19  *      Changes:
  20  *              Alan Cox        :       device private ioctl copies fields back.
  21  *              Alan Cox        :       Transmit queue code does relevant stunts to
  22  *                                      keep the queue safe.
  23  *              Alan Cox        :       Fixed double lock.
  24  *              Alan Cox        :       Fixed promisc NULL pointer trap
  25  *              ????????        :       Support the full private ioctl range
  26  *              Alan Cox        :       Moved ioctl permission check into drivers
  27  *              Tim Kordas      :       SIOCADDMULTI/SIOCDELMULTI
  28  *              Alan Cox        :       100 backlog just doesn't cut it when
  29  *                                      you start doing multicast video 8)
  30  *              Alan Cox        :       Rewrote net_bh and list manager.
  31  *              Alan Cox        :       Fix ETH_P_ALL echoback lengths.
  32  *              Alan Cox        :       Took out transmit every packet pass
  33  *                                      Saved a few bytes in the ioctl handler
  34  *              Alan Cox        :       Network driver sets packet type before calling netif_rx. Saves
  35  *                                      a function call a packet.
  36  *              Alan Cox        :       Hashed net_bh()
  37  *              Richard Kooijman:       Timestamp fixes.
  38  *              Alan Cox        :       Wrong field in SIOCGIFDSTADDR
  39  *              Alan Cox        :       Device lock protection.
  40  *              Alan Cox        :       Fixed nasty side effect of device close changes.
  41  *              Rudi Cilibrasi  :       Pass the right thing to set_mac_address()
  42  *              Dave Miller     :       32bit quantity for the device lock to make it work out
  43  *                                      on a Sparc.
  44  *              Bjorn Ekwall    :       Added KERNELD hack.
  45  *              Alan Cox        :       Cleaned up the backlog initialise.
  46  *              Craig Metz      :       SIOCGIFCONF fix if space for under
  47  *                                      1 device.
  48  *
  49  */
  50 
  51 #include <asm/segment.h>
  52 #include <asm/system.h>
  53 #include <asm/bitops.h>
  54 #include <linux/config.h>
  55 #include <linux/types.h>
  56 #include <linux/kernel.h>
  57 #include <linux/sched.h>
  58 #include <linux/string.h>
  59 #include <linux/mm.h>
  60 #include <linux/socket.h>
  61 #include <linux/sockios.h>
  62 #include <linux/in.h>
  63 #include <linux/errno.h>
  64 #include <linux/interrupt.h>
  65 #include <linux/if_ether.h>
  66 #include <linux/inet.h>
  67 #include <linux/netdevice.h>
  68 #include <linux/etherdevice.h>
  69 #include <linux/notifier.h>
  70 #include <net/ip.h>
  71 #include <net/route.h>
  72 #include <linux/skbuff.h>
  73 #include <net/sock.h>
  74 #include <net/arp.h>
  75 #include <net/slhc.h>
  76 #include <linux/proc_fs.h>
  77 #include <linux/stat.h>
  78 #ifdef CONFIG_NET_ALIAS
  79 #include <linux/net_alias.h>
  80 #endif
  81 #ifdef CONFIG_KERNELD
  82 #include <linux/kerneld.h>
  83 #endif
  84 
  85 /*
  86  *      The list of packet types we will receive (as opposed to discard)
  87  *      and the routines to invoke.
  88  */
  89 
  90 struct packet_type *ptype_base[16];
  91 struct packet_type *ptype_all = NULL;           /* Taps */
  92 
  93 /*
  94  *      Device list lock
  95  */
  96  
  97 int dev_lockct=0;
  98  
  99 /*
 100  *      Our notifier list
 101  */
 102  
 103 struct notifier_block *netdev_chain=NULL;
 104 
 105 /*
 106  *      Device drivers call our routines to queue packets here. We empty the
 107  *      queue in the bottom half handler.
 108  */
 109 
 110 static struct sk_buff_head backlog;
 111 
 112 /* 
 113  *      We don't overdo the queue or we will thrash memory badly.
 114  */
 115  
 116 static int backlog_size = 0;
 117 
 118 /*
 119  *      Return the lesser of the two values. 
 120  */
 121  
 122 static __inline__ unsigned long min(unsigned long a, unsigned long b)
     /* [previous][next][first][last][top][bottom][index][help] */
 123 {
 124         return (a < b)? a : b;
 125 }
 126 
 127 
 128 /******************************************************************************************
 129 
 130                 Protocol management and registration routines
 131 
 132 *******************************************************************************************/
 133 
 134 /*
 135  *      For efficiency
 136  */
 137 
 138 static int dev_nit=0;
 139 
 140 /*
 141  *      Add a protocol ID to the list. Now that the input handler is
 142  *      smarter we can dispense with all the messy stuff that used to be
 143  *      here.
 144  */
 145  
 146 void dev_add_pack(struct packet_type *pt)
     /* [previous][next][first][last][top][bottom][index][help] */
 147 {
 148         int hash;
 149         if(pt->type==htons(ETH_P_ALL))
 150         {
 151                 dev_nit++;
 152                 pt->next=ptype_all;
 153                 ptype_all=pt;
 154         }
 155         else
 156         {       
 157                 hash=ntohs(pt->type)&15;
 158                 pt->next = ptype_base[hash];
 159                 ptype_base[hash] = pt;
 160         }
 161 }
 162 
 163 
 164 /*
 165  *      Remove a protocol ID from the list.
 166  */
 167  
 168 void dev_remove_pack(struct packet_type *pt)
     /* [previous][next][first][last][top][bottom][index][help] */
 169 {
 170         struct packet_type **pt1;
 171         if(pt->type==htons(ETH_P_ALL))
 172         {
 173                 dev_nit--;
 174                 pt1=&ptype_all;
 175         }
 176         else
 177                 pt1=&ptype_base[ntohs(pt->type)&15];
 178         for(; (*pt1)!=NULL; pt1=&((*pt1)->next))
 179         {
 180                 if(pt==(*pt1))
 181                 {
 182                         *pt1=pt->next;
 183                         return;
 184                 }
 185         }
 186         printk("dev_remove_pack: %p not found.\n", pt);
 187 }
 188 
 189 /*****************************************************************************************
 190 
 191                             Device Interface Subroutines
 192 
 193 ******************************************************************************************/
 194 
 195 /* 
 196  *      Find an interface by name.
 197  */
 198  
 199 struct device *dev_get(const char *name)
     /* [previous][next][first][last][top][bottom][index][help] */
 200 {
 201         struct device *dev;
 202 
 203         for (dev = dev_base; dev != NULL; dev = dev->next) 
 204         {
 205                 if (strcmp(dev->name, name) == 0)
 206                         return(dev);
 207         }
 208         return NULL;
 209 }
 210         
 211 /*
 212  *      Find and possibly load an interface.
 213  */
 214  
 215 #ifdef CONFIG_KERNELD
 216 
 217 extern __inline__ void dev_load(const char *name)
     /* [previous][next][first][last][top][bottom][index][help] */
 218 {
 219         if(!dev_get(name)) {
 220 #ifdef CONFIG_NET_ALIAS
 221                 const char *sptr;
 222  
 223                 for (sptr=name ; *sptr ; sptr++) if(*sptr==':') break;
 224                 if (!(*sptr && *(sptr+1)))
 225 #endif
 226                         request_module(name);
 227         }
 228 }
 229 
 230 #endif
 231  
 232 /*
 233  *      Prepare an interface for use. 
 234  */
 235  
 236 int dev_open(struct device *dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 237 {
 238         int ret = 0;
 239 
 240         /*
 241          *      Call device private open method
 242          */
 243         if (dev->open) 
 244                 ret = dev->open(dev);
 245 
 246         /*
 247          *      If it went open OK then set the flags
 248          */
 249          
 250         if (ret == 0) 
 251         {
 252                 dev->flags |= (IFF_UP | IFF_RUNNING);
 253                 /*
 254                  *      Initialise multicasting status 
 255                  */
 256                 dev_mc_upload(dev);
 257                 notifier_call_chain(&netdev_chain, NETDEV_UP, dev);
 258         }
 259         return(ret);
 260 }
 261 
 262 
 263 /*
 264  *      Completely shutdown an interface.
 265  */
 266  
 267 int dev_close(struct device *dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 268 {
 269         int ct=0;
 270 
 271         /*
 272          *      Call the device specific close. This cannot fail.
 273          *      Only if device is UP
 274          */
 275          
 276         if ((dev->flags & IFF_UP) && dev->stop)
 277                 dev->stop(dev);
 278 
 279         /*
 280          *      Device is now down.
 281          */
 282          
 283         dev->flags&=~(IFF_UP|IFF_RUNNING);
 284 
 285         /*
 286          *      Tell people we are going down
 287          */
 288         notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev);
 289         /*
 290          *      Flush the multicast chain
 291          */
 292         dev_mc_discard(dev);
 293         /*
 294          *      Blank the IP addresses
 295          */
 296         dev->pa_addr = 0;
 297         dev->pa_dstaddr = 0;
 298         dev->pa_brdaddr = 0;
 299         dev->pa_mask = 0;
 300         /*
 301          *      Purge any queued packets when we down the link 
 302          */
 303         while(ct<DEV_NUMBUFFS)
 304         {
 305                 struct sk_buff *skb;
 306                 while((skb=skb_dequeue(&dev->buffs[ct]))!=NULL)
 307                         if(skb->free)
 308                                 kfree_skb(skb,FREE_WRITE);
 309                 ct++;
 310         }
 311         return(0);
 312 }
 313 
 314 
 315 /*
 316  *      Device change register/unregister. These are not inline or static
 317  *      as we export them to the world.
 318  */
 319 
 320 int register_netdevice_notifier(struct notifier_block *nb)
     /* [previous][next][first][last][top][bottom][index][help] */
 321 {
 322         return notifier_chain_register(&netdev_chain, nb);
 323 }
 324 
 325 int unregister_netdevice_notifier(struct notifier_block *nb)
     /* [previous][next][first][last][top][bottom][index][help] */
 326 {
 327         return notifier_chain_unregister(&netdev_chain,nb);
 328 }
 329 
 330 /*
 331  *      Send (or queue for sending) a packet. 
 332  *
 333  *      IMPORTANT: When this is called to resend frames. The caller MUST
 334  *      already have locked the sk_buff. Apart from that we do the
 335  *      rest of the magic.
 336  */
 337 
 338 void dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri)
     /* [previous][next][first][last][top][bottom][index][help] */
 339 {
 340         unsigned long flags;
 341         struct sk_buff_head *list;
 342         int retransmission = 0; /* used to say if the packet should go  */
 343                                 /* at the front or the back of the      */
 344                                 /* queue - front is a retransmit try    */
 345 
 346         if(pri>=0 && !skb_device_locked(skb))
 347                 skb_device_lock(skb);   /* Shove a lock on the frame */
 348 #if CONFIG_SKB_CHECK 
 349         IS_SKB(skb);
 350 #endif    
 351         skb->dev = dev;
 352 
 353         /*
 354          *      Negative priority is used to flag a frame that is being pulled from the
 355          *      queue front as a retransmit attempt. It therefore goes back on the queue
 356          *      start on a failure.
 357          */
 358          
 359         if (pri < 0) 
 360         {
 361                 pri = -pri-1;
 362                 retransmission = 1;
 363         }
 364 
 365 #ifdef CONFIG_NET_DEBUG
 366         if (pri >= DEV_NUMBUFFS) 
 367         {
 368                 printk("bad priority in dev_queue_xmit.\n");
 369                 pri = 1;
 370         }
 371 #endif
 372 
 373         /*
 374          *      If the address has not been resolved. Call the device header rebuilder.
 375          *      This can cover all protocols and technically not just ARP either.
 376          */
 377          
 378         if (!skb->arp && dev->rebuild_header(skb->data, dev, skb->raddr, skb)) {
 379                 return;
 380         }
 381 
 382         /*
 383          *
 384          *      If dev is an alias, switch to its main device.
 385          *      "arp" resolution has been made with alias device, so
 386          *      arp entries refer to alias, not main.
 387          *
 388          */
 389 
 390 #ifdef CONFIG_NET_ALIAS
 391         if (net_alias_is(dev))
 392                 skb->dev = dev = net_alias_main_dev(dev);
 393 #endif
 394         list = dev->buffs + pri;
 395 
 396         save_flags(flags);
 397         /* if this isn't a retransmission, use the first packet instead... */
 398         if (!retransmission) {
 399                 if (skb_queue_len(list)) {
 400                         /* avoid overrunning the device queue.. */
 401                         if (skb_queue_len(list) > dev->tx_queue_len) {
 402                                 dev_kfree_skb(skb, FREE_WRITE);
 403                                 return;
 404                         }
 405                         cli();
 406                         skb_device_unlock(skb);         /* Buffer is on the device queue and can be freed safely */
 407                         __skb_queue_tail(list, skb);
 408                         skb = __skb_dequeue(list);
 409                         skb_device_lock(skb);           /* New buffer needs locking down */
 410                         restore_flags(flags);
 411                 }
 412                 
 413                 /* copy outgoing packets to any sniffer packet handlers */
 414                 if (dev_nit) {
 415                         struct packet_type *ptype;
 416                         skb->stamp=xtime;
 417                         for (ptype = ptype_all; ptype!=NULL; ptype = ptype->next) 
 418                         {
 419                                 /* Never send packets back to the socket
 420                                  * they originated from - MvS (miquels@drinkel.ow.org)
 421                                  */
 422                                 if ((ptype->dev == dev || !ptype->dev) &&
 423                                    ((struct sock *)ptype->data != skb->sk))
 424                                 {
 425                                         struct sk_buff *skb2;
 426                                         if ((skb2 = skb_clone(skb, GFP_ATOMIC)) == NULL)
 427                                                 break;
 428                                         skb2->h.raw = skb2->data + dev->hard_header_len;
 429                                         skb2->mac.raw = skb2->data;
 430                                         ptype->func(skb2, skb->dev, ptype);
 431                                 }
 432                         }
 433                 }
 434         }
 435         start_bh_atomic();
 436         if (dev->hard_start_xmit(skb, dev) == 0) {
 437                 /*
 438                  *      Packet is now solely the responsibility of the driver
 439                  */
 440                 end_bh_atomic();
 441                 return;
 442         }
 443         end_bh_atomic();
 444 
 445         /*
 446          *      Transmission failed, put skb back into a list. Once on the list it's safe and
 447          *      no longer device locked (it can be freed safely from the device queue)
 448          */
 449         cli();
 450         skb_device_unlock(skb);
 451         __skb_queue_head(list,skb);
 452         restore_flags(flags);
 453 }
 454 
 455 /*
 456  *      Receive a packet from a device driver and queue it for the upper
 457  *      (protocol) levels.  It always succeeds. This is the recommended 
 458  *      interface to use.
 459  */
 460 
 461 void netif_rx(struct sk_buff *skb)
     /* [previous][next][first][last][top][bottom][index][help] */
 462 {
 463         static int dropping = 0;
 464 
 465         /*
 466          *      Any received buffers are un-owned and should be discarded
 467          *      when freed. These will be updated later as the frames get
 468          *      owners.
 469          */
 470 
 471         skb->sk = NULL;
 472         skb->free = 1;
 473         if(skb->stamp.tv_sec==0)
 474                 skb->stamp = xtime;
 475 
 476         /*
 477          *      Check that we aren't overdoing things.
 478          */
 479 
 480         if (!backlog_size)
 481                 dropping = 0;
 482         else if (backlog_size > 300)
 483                 dropping = 1;
 484 
 485         if (dropping) 
 486         {
 487                 kfree_skb(skb, FREE_READ);
 488                 return;
 489         }
 490 
 491         /*
 492          *      Add it to the "backlog" queue. 
 493          */
 494 #if CONFIG_SKB_CHECK
 495         IS_SKB(skb);
 496 #endif  
 497         skb_queue_tail(&backlog,skb);
 498         backlog_size++;
 499   
 500         /*
 501          *      If any packet arrived, mark it for processing after the
 502          *      hardware interrupt returns.
 503          */
 504 
 505 #ifdef CONFIG_NET_RUNONIRQ      /* Dont enable yet, needs some driver mods */
 506         net_bh();
 507 #else
 508         mark_bh(NET_BH);
 509 #endif
 510         return;
 511 }
 512 
 513 /*
 514  *      This routine causes all interfaces to try to send some data. 
 515  */
 516  
 517 void dev_transmit(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 518 {
 519         struct device *dev;
 520 
 521         for (dev = dev_base; dev != NULL; dev = dev->next)
 522         {
 523                 if (dev->flags != 0 && !dev->tbusy) {
 524                         /*
 525                          *      Kick the device
 526                          */
 527                         dev_tint(dev);
 528                 }
 529         }
 530 }
 531 
 532 
 533 /**********************************************************************************
 534 
 535                         Receive Queue Processor
 536                         
 537 ***********************************************************************************/
 538 
 539 /*
 540  *      This is a single non-reentrant routine which takes the received packet
 541  *      queue and throws it at the networking layers in the hope that something
 542  *      useful will emerge.
 543  */
 544  
 545 volatile unsigned long in_bh = 0;       /* Non-reentrant remember */
 546 
 547 int in_net_bh() /* Used by timer.c */
     /* [previous][next][first][last][top][bottom][index][help] */
 548 {
 549         return(in_bh==0?0:1);
 550 }
 551 
 552 /*
 553  *      When we are called the queue is ready to grab, the interrupts are
 554  *      on and hardware can interrupt and queue to the receive queue a we
 555  *      run with no problems.
 556  *      This is run as a bottom half after an interrupt handler that does
 557  *      mark_bh(NET_BH);
 558  */
 559  
 560 void net_bh(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 561 {
 562         struct sk_buff *skb;
 563         struct packet_type *ptype;
 564         struct packet_type *pt_prev;
 565         unsigned short type;
 566 
 567         /*
 568          *      Atomically check and mark our BUSY state. 
 569          */
 570 
 571         if (set_bit(1, (void*)&in_bh))
 572                 return;
 573 
 574         /*
 575          *      Can we send anything now? We want to clear the
 576          *      decks for any more sends that get done as we
 577          *      process the input. This also minimises the
 578          *      latency on a transmit interrupt bh.
 579          */
 580 
 581         dev_transmit();
 582   
 583         /*
 584          *      Any data left to process. This may occur because a
 585          *      mark_bh() is done after we empty the queue including
 586          *      that from the device which does a mark_bh() just after
 587          */
 588 
 589         cli();
 590         
 591         /*
 592          *      While the queue is not empty
 593          */
 594          
 595         while((skb=__skb_dequeue(&backlog))!=NULL)
 596         {
 597                 /*
 598                  *      We have a packet. Therefore the queue has shrunk
 599                  */
 600                 backlog_size--;
 601 
 602                 sti();
 603                 
 604                /*
 605                 *       Bump the pointer to the next structure.
 606                 *
 607                 *       On entry to the protocol layer. skb->data and
 608                 *       skb->h.raw point to the MAC and encapsulated data
 609                 */
 610 
 611                 skb->h.raw = skb->data;
 612 
 613                /*
 614                 *       Fetch the packet protocol ID. 
 615                 */
 616                 
 617                 type = skb->protocol;
 618 
 619                 /*
 620                  *      We got a packet ID.  Now loop over the "known protocols"
 621                  *      list. There are two lists. The ptype_all list of taps (normally empty)
 622                  *      and the main protocol list which is hashed perfectly for normal protocols.
 623                  */
 624                 pt_prev = NULL;
 625                 for (ptype = ptype_all; ptype!=NULL; ptype=ptype->next)
 626                 {
 627                         if(pt_prev)
 628                         {
 629                                 struct sk_buff *skb2=skb_clone(skb, GFP_ATOMIC);
 630                                 if(skb2)
 631                                         pt_prev->func(skb2,skb->dev, pt_prev);
 632                         }
 633                         pt_prev=ptype;
 634                 }
 635                 
 636                 for (ptype = ptype_base[ntohs(type)&15]; ptype != NULL; ptype = ptype->next) 
 637                 {
 638                         if (ptype->type == type && (!ptype->dev || ptype->dev==skb->dev))
 639                         {
 640                                 /*
 641                                  *      We already have a match queued. Deliver
 642                                  *      to it and then remember the new match
 643                                  */
 644                                 if(pt_prev)
 645                                 {
 646                                         struct sk_buff *skb2;
 647 
 648                                         skb2=skb_clone(skb, GFP_ATOMIC);
 649 
 650                                         /*
 651                                          *      Kick the protocol handler. This should be fast
 652                                          *      and efficient code.
 653                                          */
 654 
 655                                         if(skb2)
 656                                                 pt_prev->func(skb2, skb->dev, pt_prev);
 657                                 }
 658                                 /* Remember the current last to do */
 659                                 pt_prev=ptype;
 660                         }
 661                 } /* End of protocol list loop */
 662                 
 663                 /*
 664                  *      Is there a last item to send to ?
 665                  */
 666 
 667                 if(pt_prev)
 668                         pt_prev->func(skb, skb->dev, pt_prev);
 669                 /*
 670                  *      Has an unknown packet has been received ?
 671                  */
 672          
 673                 else
 674                         kfree_skb(skb, FREE_WRITE);
 675 
 676                 /*
 677                  *      Again, see if we can transmit anything now. 
 678                  *      [Ought to take this out judging by tests it slows
 679                  *       us down not speeds us up]
 680                  */
 681 #ifdef XMIT_EVERY
 682                 dev_transmit();
 683 #endif          
 684                 cli();
 685         }       /* End of queue loop */
 686         
 687         /*
 688          *      We have emptied the queue
 689          */
 690          
 691         in_bh = 0;
 692         sti();
 693         
 694         /*
 695          *      One last output flush.
 696          */
 697 
 698 #ifdef XMIT_AFTER        
 699         dev_transmit();
 700 #endif
 701 }
 702 
 703 
 704 /*
 705  *      This routine is called when an device driver (i.e. an
 706  *      interface) is ready to transmit a packet.
 707  */
 708  
 709 void dev_tint(struct device *dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 710 {
 711         int i;
 712         unsigned long flags;
 713         struct sk_buff_head * head;
 714         
 715         /*
 716          * aliases do not transmit (for now :) )
 717          */
 718 
 719 #ifdef CONFIG_NET_ALIAS
 720         if (net_alias_is(dev)) return;
 721 #endif
 722         head = dev->buffs;
 723         save_flags(flags);
 724         cli();
 725 
 726         /*
 727          *      Work the queues in priority order
 728          */      
 729         for(i = 0;i < DEV_NUMBUFFS; i++,head++)
 730         {
 731 
 732                 while (!skb_queue_empty(head)) {
 733                         struct sk_buff *skb;
 734 
 735                         skb = head->next;
 736                         __skb_unlink(skb, head);
 737                         /*
 738                          *      Stop anyone freeing the buffer while we retransmit it
 739                          */
 740                         skb_device_lock(skb);
 741                         restore_flags(flags);
 742                         /*
 743                          *      Feed them to the output stage and if it fails
 744                          *      indicate they re-queue at the front.
 745                          */
 746                         dev_queue_xmit(skb,dev,-i - 1);
 747                         /*
 748                          *      If we can take no more then stop here.
 749                          */
 750                         if (dev->tbusy)
 751                                 return;
 752                         cli();
 753                 }
 754         }
 755         restore_flags(flags);
 756 }
 757 
 758 
 759 /*
 760  *      Perform a SIOCGIFCONF call. This structure will change
 761  *      size shortly, and there is nothing I can do about it.
 762  *      Thus we will need a 'compatibility mode'.
 763  */
 764 
 765 static int dev_ifconf(char *arg)
     /* [previous][next][first][last][top][bottom][index][help] */
 766 {
 767         struct ifconf ifc;
 768         struct ifreq ifr;
 769         struct device *dev;
 770         char *pos;
 771         int len;
 772         int err;
 773 
 774         /*
 775          *      Fetch the caller's info block. 
 776          */
 777          
 778         err=verify_area(VERIFY_WRITE, arg, sizeof(struct ifconf));
 779         if(err)
 780                 return err;
 781         memcpy_fromfs(&ifc, arg, sizeof(struct ifconf));
 782         len = ifc.ifc_len;
 783         pos = ifc.ifc_buf;
 784 
 785         /*
 786          *      We now walk the device list filling each active device
 787          *      into the array.
 788          */
 789          
 790         err=verify_area(VERIFY_WRITE,pos,len);
 791         if(err)
 792                 return err;
 793         
 794         /*
 795          *      Loop over the interfaces, and write an info block for each. 
 796          */
 797 
 798         for (dev = dev_base; dev != NULL; dev = dev->next) 
 799         {
 800                 if(!(dev->flags & IFF_UP))      /* Downed devices don't count */
 801                         continue;
 802                 /*
 803                  *      Have we run out of space here ?
 804                  */
 805         
 806                 if (len < sizeof(struct ifreq)) 
 807                         break;
 808 
 809                 memset(&ifr, 0, sizeof(struct ifreq));
 810                 strcpy(ifr.ifr_name, dev->name);
 811                 (*(struct sockaddr_in *) &ifr.ifr_addr).sin_family = dev->family;
 812                 (*(struct sockaddr_in *) &ifr.ifr_addr).sin_addr.s_addr = dev->pa_addr;
 813 
 814 
 815                 /*
 816                  *      Write this block to the caller's space. 
 817                  */
 818                  
 819                 memcpy_tofs(pos, &ifr, sizeof(struct ifreq));
 820                 pos += sizeof(struct ifreq);
 821                 len -= sizeof(struct ifreq);            
 822         }
 823 
 824         /*
 825          *      All done.  Write the updated control block back to the caller. 
 826          */
 827          
 828         ifc.ifc_len = (pos - ifc.ifc_buf);
 829         ifc.ifc_req = (struct ifreq *) ifc.ifc_buf;
 830         memcpy_tofs(arg, &ifc, sizeof(struct ifconf));
 831         
 832         /*
 833          *      Report how much was filled in
 834          */
 835          
 836         return(pos - arg);
 837 }
 838 
 839 
 840 /*
 841  *      This is invoked by the /proc filesystem handler to display a device
 842  *      in detail.
 843  */
 844 
 845 #ifdef CONFIG_PROC_FS
 846 static int sprintf_stats(char *buffer, struct device *dev)
     /* [previous][next][first][last][top][bottom][index][help] */
 847 {
 848         struct enet_statistics *stats = (dev->get_stats ? dev->get_stats(dev): NULL);
 849         int size;
 850         
 851         if (stats)
 852                 size = sprintf(buffer, "%6s:%7d %4d %4d %4d %4d %8d %4d %4d %4d %5d %4d\n",
 853                    dev->name,
 854                    stats->rx_packets, stats->rx_errors,
 855                    stats->rx_dropped + stats->rx_missed_errors,
 856                    stats->rx_fifo_errors,
 857                    stats->rx_length_errors + stats->rx_over_errors
 858                    + stats->rx_crc_errors + stats->rx_frame_errors,
 859                    stats->tx_packets, stats->tx_errors, stats->tx_dropped,
 860                    stats->tx_fifo_errors, stats->collisions,
 861                    stats->tx_carrier_errors + stats->tx_aborted_errors
 862                    + stats->tx_window_errors + stats->tx_heartbeat_errors);
 863         else
 864                 size = sprintf(buffer, "%6s: No statistics available.\n", dev->name);
 865 
 866         return size;
 867 }
 868 
 869 /*
 870  *      Called from the PROCfs module. This now uses the new arbitrary sized /proc/net interface
 871  *      to create /proc/net/dev
 872  */
 873  
 874 int dev_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
     /* [previous][next][first][last][top][bottom][index][help] */
 875 {
 876         int len=0;
 877         off_t begin=0;
 878         off_t pos=0;
 879         int size;
 880         
 881         struct device *dev;
 882 
 883 
 884         size = sprintf(buffer, "Inter-|   Receive                  |  Transmit\n"
 885                             " face |packets errs drop fifo frame|packets errs drop fifo colls carrier\n");
 886         
 887         pos+=size;
 888         len+=size;
 889         
 890 
 891         for (dev = dev_base; dev != NULL; dev = dev->next) 
 892         {
 893                 size = sprintf_stats(buffer+len, dev);
 894                 len+=size;
 895                 pos=begin+len;
 896                                 
 897                 if(pos<offset)
 898                 {
 899                         len=0;
 900                         begin=pos;
 901                 }
 902                 if(pos>offset+length)
 903                         break;
 904         }
 905         
 906         *start=buffer+(offset-begin);   /* Start of wanted data */
 907         len-=(offset-begin);            /* Start slop */
 908         if(len>length)
 909                 len=length;             /* Ending slop */
 910         return len;
 911 }
 912 #endif  /* CONFIG_PROC_FS */
 913 
 914 
 915 /*
 916  *      This checks bitmasks for the ioctl calls for devices.
 917  */
 918  
 919 static inline int bad_mask(unsigned long mask, unsigned long addr)
     /* [previous][next][first][last][top][bottom][index][help] */
 920 {
 921         if (addr & (mask = ~mask))
 922                 return 1;
 923         mask = ntohl(mask);
 924         if (mask & (mask+1))
 925                 return 1;
 926         return 0;
 927 }
 928 
 929 /*
 930  *      Perform the SIOCxIFxxx calls. 
 931  *
 932  *      The socket layer has seen an ioctl the address family thinks is
 933  *      for the device. At this point we get invoked to make a decision
 934  */
 935  
 936 static int dev_ifsioc(void *arg, unsigned int getset)
     /* [previous][next][first][last][top][bottom][index][help] */
 937 {
 938         struct ifreq ifr;
 939         struct device *dev;
 940         int ret;
 941 
 942         /*
 943          *      Fetch the caller's info block into kernel space
 944          */
 945 
 946         int err=verify_area(VERIFY_WRITE, arg, sizeof(struct ifreq));
 947         if(err)
 948                 return err;
 949         
 950         memcpy_fromfs(&ifr, arg, sizeof(struct ifreq));
 951 
 952         /*
 953          *      See which interface the caller is talking about. 
 954          */
 955          
 956         /*
 957          *
 958          *      net_alias_dev_get(): dev_get() with added alias naming magic.
 959          *      only allow alias creation/deletion if (getset==SIOCSIFADDR)
 960          *
 961          */
 962          
 963 #ifdef CONFIG_KERNELD
 964         dev_load(ifr.ifr_name);
 965 #endif  
 966 
 967 #ifdef CONFIG_NET_ALIAS
 968         if ((dev = net_alias_dev_get(ifr.ifr_name, getset == SIOCSIFADDR, &err, NULL, NULL)) == NULL)
 969                 return(err);
 970 #else
 971         if ((dev = dev_get(ifr.ifr_name)) == NULL)      
 972                 return(-ENODEV);
 973 #endif
 974         switch(getset) 
 975         {
 976                 case SIOCGIFFLAGS:      /* Get interface flags */
 977                         ifr.ifr_flags = dev->flags;
 978                         goto rarok;
 979 
 980                 case SIOCSIFFLAGS:      /* Set interface flags */
 981                         {
 982                                 int old_flags = dev->flags;
 983                                 
 984                                 /*
 985                                  *      We are not allowed to potentially close/unload
 986                                  *      a device until we get this lock.
 987                                  */
 988                                 
 989                                 dev_lock_wait();
 990                                 
 991                                 /*
 992                                  *      Set the flags on our device.
 993                                  */
 994                                  
 995                                 dev->flags = (ifr.ifr_flags & (
 996                                         IFF_BROADCAST | IFF_DEBUG | IFF_LOOPBACK |
 997                                         IFF_POINTOPOINT | IFF_NOTRAILERS | IFF_RUNNING |
 998                                         IFF_NOARP | IFF_PROMISC | IFF_ALLMULTI | IFF_SLAVE | IFF_MASTER
 999                                         | IFF_MULTICAST)) | (dev->flags & IFF_UP);
1000                                 /*
1001                                  *      Load in the correct multicast list now the flags have changed.
1002                                  */                             
1003 
1004                                 dev_mc_upload(dev);
1005 
1006                                 /*
1007                                  *      Have we downed the interface. We handle IFF_UP ourselves
1008                                  *      according to user attempts to set it, rather than blindly
1009                                  *      setting it.
1010                                  */
1011                                  
1012                                 if ((old_flags^ifr.ifr_flags)&IFF_UP)   /* Bit is different  ? */
1013                                 {
1014                                         if(old_flags&IFF_UP)            /* Gone down */
1015                                                 ret=dev_close(dev);             
1016                                         else                            /* Come up */
1017                                         {
1018                                                 ret=dev_open(dev);
1019                                                 if(ret<0)
1020                                                         dev->flags&=~IFF_UP;    /* Open failed */
1021                                         }       
1022                                 }
1023                                 else
1024                                         ret=0;
1025                                 /*
1026                                  *      Load in the correct multicast list now the flags have changed.
1027                                  */                             
1028 
1029                                 dev_mc_upload(dev);
1030                         }
1031                         break;
1032                 
1033                 case SIOCGIFADDR:       /* Get interface address (and family) */
1034                         if(ifr.ifr_addr.sa_family==AF_UNSPEC)
1035                         {
1036                                 memcpy(ifr.ifr_hwaddr.sa_data,dev->dev_addr, MAX_ADDR_LEN);
1037                                 ifr.ifr_hwaddr.sa_family=dev->type;                     
1038                                 goto rarok;
1039                         }
1040                         else
1041                         {
1042                                 (*(struct sockaddr_in *)
1043                                           &ifr.ifr_addr).sin_addr.s_addr = dev->pa_addr;
1044                                 (*(struct sockaddr_in *)
1045                                           &ifr.ifr_addr).sin_family = dev->family;
1046                                 (*(struct sockaddr_in *)
1047                                           &ifr.ifr_addr).sin_port = 0;
1048                         }
1049                         goto rarok;
1050         
1051                 case SIOCSIFADDR:       /* Set interface address (and family) */
1052                 
1053                         /*
1054                          *      BSDism. SIOCSIFADDR family=AF_UNSPEC sets the
1055                          *      physical address. We can cope with this now.
1056                          */
1057                         
1058                         if(ifr.ifr_addr.sa_family==AF_UNSPEC)
1059                         {
1060                                 if(dev->set_mac_address==NULL)
1061                                         return -EOPNOTSUPP;
1062                                 ret=dev->set_mac_address(dev,&ifr.ifr_addr);
1063                         }
1064                         else
1065                         {
1066 
1067                                 /*
1068                                  *      if dev is an alias, must rehash to update
1069                                  *      address change
1070                                  */
1071 
1072 #ifdef CONFIG_NET_ALIAS
1073                                 if (net_alias_is(dev))
1074                                 net_alias_dev_rehash(dev ,&ifr.ifr_addr);
1075 #endif
1076                                 dev->pa_addr = (*(struct sockaddr_in *)
1077                                          &ifr.ifr_addr).sin_addr.s_addr;
1078                                 dev->family = ifr.ifr_addr.sa_family;
1079                         
1080 #ifdef CONFIG_INET      
1081                                 /* This is naughty. When net-032e comes out It wants moving into the net032
1082                                    code not the kernel. Till then it can sit here (SIGH) */             
1083                                 dev->pa_mask = ip_get_mask(dev->pa_addr);
1084 #endif                  
1085                                 dev->pa_brdaddr = dev->pa_addr | ~dev->pa_mask;
1086                                 ret = 0;
1087                         }
1088                         break;
1089                         
1090                 case SIOCGIFBRDADDR:    /* Get the broadcast address */
1091                         (*(struct sockaddr_in *)
1092                                 &ifr.ifr_broadaddr).sin_addr.s_addr = dev->pa_brdaddr;
1093                         (*(struct sockaddr_in *)
1094                                 &ifr.ifr_broadaddr).sin_family = dev->family;
1095                         (*(struct sockaddr_in *)
1096                                 &ifr.ifr_broadaddr).sin_port = 0;
1097                         goto rarok;
1098 
1099                 case SIOCSIFBRDADDR:    /* Set the broadcast address */
1100                         dev->pa_brdaddr = (*(struct sockaddr_in *)
1101                                 &ifr.ifr_broadaddr).sin_addr.s_addr;
1102                         ret = 0;
1103                         break;
1104                         
1105                 case SIOCGIFDSTADDR:    /* Get the destination address (for point-to-point links) */
1106                         (*(struct sockaddr_in *)
1107                                 &ifr.ifr_dstaddr).sin_addr.s_addr = dev->pa_dstaddr;
1108                         (*(struct sockaddr_in *)
1109                                 &ifr.ifr_dstaddr).sin_family = dev->family;
1110                         (*(struct sockaddr_in *)
1111                                 &ifr.ifr_dstaddr).sin_port = 0;
1112                         goto rarok;
1113         
1114                 case SIOCSIFDSTADDR:    /* Set the destination address (for point-to-point links) */
1115                         dev->pa_dstaddr = (*(struct sockaddr_in *)
1116                                 &ifr.ifr_dstaddr).sin_addr.s_addr;
1117                         ret = 0;
1118                         break;
1119                         
1120                 case SIOCGIFNETMASK:    /* Get the netmask for the interface */
1121                         (*(struct sockaddr_in *)
1122                                 &ifr.ifr_netmask).sin_addr.s_addr = dev->pa_mask;
1123                         (*(struct sockaddr_in *)
1124                                 &ifr.ifr_netmask).sin_family = dev->family;
1125                         (*(struct sockaddr_in *)
1126                                 &ifr.ifr_netmask).sin_port = 0;
1127                         goto rarok;
1128 
1129                 case SIOCSIFNETMASK:    /* Set the netmask for the interface */
1130                         {
1131                                 unsigned long mask = (*(struct sockaddr_in *)
1132                                         &ifr.ifr_netmask).sin_addr.s_addr;
1133                                 ret = -EINVAL;
1134                                 /*
1135                                  *      The mask we set must be legal.
1136                                  */
1137                                 if (bad_mask(mask,0))
1138                                         break;
1139                                 dev->pa_mask = mask;
1140                                 ret = 0;
1141                         }
1142                         break;
1143                         
1144                 case SIOCGIFMETRIC:     /* Get the metric on the interface (currently unused) */
1145                         
1146                         ifr.ifr_metric = dev->metric;
1147                         goto  rarok;
1148                         
1149                 case SIOCSIFMETRIC:     /* Set the metric on the interface (currently unused) */
1150                         dev->metric = ifr.ifr_metric;
1151                         ret=0;
1152                         break;
1153         
1154                 case SIOCGIFMTU:        /* Get the MTU of a device */
1155                         ifr.ifr_mtu = dev->mtu;
1156                         goto rarok;
1157         
1158                 case SIOCSIFMTU:        /* Set the MTU of a device */
1159                 
1160                         /*
1161                          *      MTU must be positive.
1162                          */
1163                          
1164                         if(ifr.ifr_mtu<68)
1165                                 return -EINVAL;
1166                         dev->mtu = ifr.ifr_mtu;
1167                         ret = 0;
1168                         break;
1169         
1170                 case SIOCGIFMEM:        /* Get the per device memory space. We can add this but currently
1171                                            do not support it */
1172                         ret = -EINVAL;
1173                         break;
1174                 
1175                 case SIOCSIFMEM:        /* Set the per device memory buffer space. Not applicable in our case */
1176                         ret = -EINVAL;
1177                         break;
1178 
1179                 case SIOCGIFHWADDR:
1180                         memcpy(ifr.ifr_hwaddr.sa_data,dev->dev_addr, MAX_ADDR_LEN);
1181                         ifr.ifr_hwaddr.sa_family=dev->type;                     
1182                         goto rarok;
1183                                 
1184                 case SIOCSIFHWADDR:
1185                         if(dev->set_mac_address==NULL)
1186                                 return -EOPNOTSUPP;
1187                         if(ifr.ifr_hwaddr.sa_family!=dev->type)
1188                                 return -EINVAL;
1189                         ret=dev->set_mac_address(dev,&ifr.ifr_hwaddr);
1190                         break;
1191                         
1192                 case SIOCGIFMAP:
1193                         ifr.ifr_map.mem_start=dev->mem_start;
1194                         ifr.ifr_map.mem_end=dev->mem_end;
1195                         ifr.ifr_map.base_addr=dev->base_addr;
1196                         ifr.ifr_map.irq=dev->irq;
1197                         ifr.ifr_map.dma=dev->dma;
1198                         ifr.ifr_map.port=dev->if_port;
1199                         goto rarok;
1200                         
1201                 case SIOCSIFMAP:
1202                         if(dev->set_config==NULL)
1203                                 return -EOPNOTSUPP;
1204                         return dev->set_config(dev,&ifr.ifr_map);
1205                         
1206                 case SIOCADDMULTI:
1207                         if(dev->set_multicast_list==NULL)
1208                                 return -EINVAL;
1209                         if(ifr.ifr_hwaddr.sa_family!=AF_UNSPEC)
1210                                 return -EINVAL;
1211                         dev_mc_add(dev,ifr.ifr_hwaddr.sa_data, dev->addr_len, 1);
1212                         return 0;
1213 
1214                 case SIOCDELMULTI:
1215                         if(dev->set_multicast_list==NULL)
1216                                 return -EINVAL;
1217                         if(ifr.ifr_hwaddr.sa_family!=AF_UNSPEC)
1218                                 return -EINVAL;
1219                         dev_mc_delete(dev,ifr.ifr_hwaddr.sa_data,dev->addr_len, 1);
1220                         return 0;
1221                 /*
1222                  *      Unknown or private ioctl
1223                  */
1224 
1225                 default:
1226                         if((getset >= SIOCDEVPRIVATE) &&
1227                            (getset <= (SIOCDEVPRIVATE + 15))) {
1228                                 if(dev->do_ioctl==NULL)
1229                                         return -EOPNOTSUPP;
1230                                 ret=dev->do_ioctl(dev, &ifr, getset);
1231                                 memcpy_tofs(arg,&ifr,sizeof(struct ifreq));
1232                                 break;
1233                         }
1234                         
1235                         ret = -EINVAL;
1236         }
1237         return(ret);
1238 /*
1239  *      The load of calls that return an ifreq and ok (saves memory).
1240  */
1241 rarok:
1242         memcpy_tofs(arg, &ifr, sizeof(struct ifreq));
1243         return 0;
1244 }
1245 
1246 
1247 /*
1248  *      This function handles all "interface"-type I/O control requests. The actual
1249  *      'doing' part of this is dev_ifsioc above.
1250  */
1251 
1252 int dev_ioctl(unsigned int cmd, void *arg)
     /* [previous][next][first][last][top][bottom][index][help] */
1253 {
1254         switch(cmd) 
1255         {
1256                 case SIOCGIFCONF:
1257                         (void) dev_ifconf((char *) arg);
1258                         return 0;
1259 
1260                 /*
1261                  *      Ioctl calls that can be done by all.
1262                  */
1263                  
1264                 case SIOCGIFFLAGS:
1265                 case SIOCGIFADDR:
1266                 case SIOCGIFDSTADDR:
1267                 case SIOCGIFBRDADDR:
1268                 case SIOCGIFNETMASK:
1269                 case SIOCGIFMETRIC:
1270                 case SIOCGIFMTU:
1271                 case SIOCGIFMEM:
1272                 case SIOCGIFHWADDR:
1273                 case SIOCSIFHWADDR:
1274                 case SIOCGIFSLAVE:
1275                 case SIOCGIFMAP:
1276                         return dev_ifsioc(arg, cmd);
1277 
1278                 /*
1279                  *      Ioctl calls requiring the power of a superuser
1280                  */
1281                  
1282                 case SIOCSIFFLAGS:
1283                 case SIOCSIFADDR:
1284                 case SIOCSIFDSTADDR:
1285                 case SIOCSIFBRDADDR:
1286                 case SIOCSIFNETMASK:
1287                 case SIOCSIFMETRIC:
1288                 case SIOCSIFMTU:
1289                 case SIOCSIFMEM:
1290                 case SIOCSIFMAP:
1291                 case SIOCSIFSLAVE:
1292                 case SIOCADDMULTI:
1293                 case SIOCDELMULTI:
1294                         if (!suser())
1295                                 return -EPERM;
1296                         return dev_ifsioc(arg, cmd);
1297         
1298                 case SIOCSIFLINK:
1299                         return -EINVAL;
1300 
1301                 /*
1302                  *      Unknown or private ioctl.
1303                  */     
1304                  
1305                 default:
1306                         if((cmd >= SIOCDEVPRIVATE) &&
1307                            (cmd <= (SIOCDEVPRIVATE + 15))) {
1308                                 return dev_ifsioc(arg, cmd);
1309                         }
1310                         return -EINVAL;
1311         }
1312 }
1313 
1314 
1315 /*
1316  *      Initialize the DEV module. At boot time this walks the device list and
1317  *      unhooks any devices that fail to initialise (normally hardware not 
1318  *      present) and leaves us with a valid list of present and active devices.
1319  *
1320  */
1321 extern int lance_init(void);
1322 extern int ni65_init(void);
1323 extern int pi_init(void);
1324 extern int dec21040_init(void);
1325 
1326 int net_dev_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
1327 {
1328         struct device *dev, **dp;
1329 
1330         /*
1331          *      Initialise the packet receive queue.
1332          */
1333          
1334         skb_queue_head_init(&backlog);
1335         
1336         /*
1337          * This is VeryUgly(tm).
1338          *
1339          * Some devices want to be initialized eary..
1340          */
1341 #if defined(CONFIG_LANCE)
1342         lance_init();
1343 #endif
1344 #if defined(CONFIG_NI65)
1345         ni65_init();
1346 #endif
1347 #if defined(CONFIG_PI)
1348         pi_init();
1349 #endif  
1350 #if defined(CONFIG_PT)
1351         pt_init();
1352 #endif
1353 #if defined(CONFIG_DEC_ELCP)
1354         dec21040_init();
1355 #endif  
1356         /*
1357          *      SLHC if present needs attaching so other people see it
1358          *      even if not opened.
1359          */
1360 #if (defined(CONFIG_SLIP_COMPRESSED) || defined(CONFIG_PPP)) && defined(CONFIG_SLHC_BUILTIN)
1361         slhc_install();
1362 #endif  
1363 
1364         /*
1365          *      Add the devices.
1366          *      If the call to dev->init fails, the dev is removed
1367          *      from the chain disconnecting the device until the
1368          *      next reboot.
1369          */
1370 
1371         dp = &dev_base;
1372         while ((dev = *dp) != NULL)
1373         {
1374                 int i;
1375                 for (i = 0; i < DEV_NUMBUFFS; i++)  {
1376                         skb_queue_head_init(dev->buffs + i);
1377                 }
1378 
1379                 if (dev->init && dev->init(dev)) 
1380                 {
1381                         /*
1382                          *      It failed to come up. Unhook it.
1383                          */
1384                         *dp = dev->next;
1385                 } 
1386                 else
1387                 {
1388                         dp = &dev->next;
1389                 }
1390         }
1391 
1392 #ifdef CONFIG_PROC_FS
1393         proc_net_register(&(struct proc_dir_entry) {
1394                 PROC_NET_DEV, 3, "dev",
1395                 S_IFREG | S_IRUGO, 1, 0, 0,
1396                 0, &proc_net_inode_operations,
1397                 dev_get_info
1398         });
1399 #endif
1400 
1401         /*      
1402          *      Initialise net_alias engine 
1403          *
1404          *              - register net_alias device notifier
1405          *              - register proc entries:        /proc/net/alias_types
1406          *                                                                      /proc/net/aliases
1407          */
1408 
1409 #ifdef CONFIG_NET_ALIAS
1410         net_alias_init();
1411 #endif
1412 
1413         init_bh(NET_BH, net_bh);
1414         return 0;
1415 }

/* [previous][next][first][last][top][bottom][index][help] */