kernels/linux-2.4.0/drivers/net/wan/sdla_chdlc.c
/*============================================================================
 * Initialize Linux network interface.
 *
 * This routine is called only once for each interface, during Linux network
 * interface registration.  Returning anything but zero will fail interface
 * registration.
 */
Initialize Linux network interface.
This routine is called only once for each interface, during Linux network
interface registration.  Returning anything but zero will fail interface
registration.
Initialize Linux network interface . This routine is called only once for each interface during Linux network interface registration . Returning anything but zero will fail interface registration .
static int if_init (struct net_device* dev)
	{
	chdlc_private_area_t* chdlc_priv_area = dev->priv;
	sdla_t* card = chdlc_priv_area->card;
	wan_device_t* wandev = &card->wandev;
#ifndef LINUX_2_1
	int i;
#endif
	dev->open		= &if_open;
	dev->stop		= &if_close;
	dev->hard_header	= &if_header;
	dev->rebuild_header	= &if_rebuild_hdr;
	dev->hard_start_xmit	= &if_send;
	dev->get_stats		= &if_stats;
	dev->tx_timeout		= &if_tx_timeout;
	dev->watchdog_timeo	= TX_TIMEOUT;
	dev->flags		|= IFF_POINTTOPOINT;
	if (chdlc_priv_area->mc == WANOPT_YES){
		dev->flags 	|= IFF_MULTICAST;
	}
#ifndef LINUX_2_1
	dev->family		= AF_INET;
#endif	
	dev->type		= ARPHRD_PPP;	
	dev->mtu		= card->wandev.mtu;
	dev->hard_header_len	= CHDLC_HDR_LEN;
	dev->irq	= wandev->irq;
	dev->dma	= wandev->dma;
	dev->base_addr	= wandev->ioport;
	dev->mem_start	= wandev->maddr;
	dev->mem_end	= wandev->maddr + wandev->msize - 1;
        dev->tx_queue_len = 100;
#ifdef LINUX_2_1
	dev_init_buffers(dev);
#else
        for (i = 0; i < DEV_NUMBUFFS; ++i)
                skb_queue_head_init(&dev->buffs[i]);
#endif
	return 0;
}
static int if_init ( struct net_device * dev ) { chdlc_private_area_t * chdlc_priv_area = dev -> priv ; sdla_t * card = chdlc_priv_area -> card ; wan_device_t * wandev = & card -> wandev ; #ifndef LINUX_2_1 int i ; #endif dev -> open = & if_open ; dev -> stop = & if_close ; dev -> hard_header = & if_header ; dev -> rebuild_header = & if_rebuild_hdr ; dev -> hard_start_xmit = & if_send ; dev -> get_stats = & if_stats ; dev -> tx_timeout = & if_tx_timeout ; dev -> watchdog_timeo = TX_TIMEOUT ; dev -> flags |= IFF_POINTTOPOINT ; if ( chdlc_priv_area -> mc == WANOPT_YES ) { dev -> flags |= IFF_MULTICAST ; } #ifndef LINUX_2_1 dev -> family = AF_INET ; #endif dev -> type = ARPHRD_PPP ; dev -> mtu = card -> wandev . mtu ; dev -> hard_header_len = CHDLC_HDR_LEN ; dev -> irq = wandev -> irq ; dev -> dma = wandev -> dma ; dev -> base_addr = wandev -> ioport ; dev -> mem_start = wandev -> maddr ; dev -> mem_end = wandev -> maddr + wandev -> msize - 1 ; dev -> tx_queue_len = 100 ; #ifdef LINUX_2_1 dev_init_buffers ( dev ) ; #else for ( i = 0 ; i < DEV_NUMBUFFS ; ++ i ) skb_queue_head_init ( & dev -> buffs [ i ] ) ; #endif return 0 ; }
Initialize Linux network interface.
Initialize Linux network interface .
/* Initialize device driver entry points */ /* Initialize media-specific parameters */ /* Enable Mulitcasting if user selected */ /* ARP hw type -- dummy value */ /* Initialize hardware parameters */ /* Set transmit buffer queue length 
	 * If too low packets will not be retransmitted 
         * by stack.
	 */ /* Initialize socket buffers */