kernels/linux-2.4.0/drivers/net/3c527.c
/**
 *	mc32_open
 *	@dev: device to open
 *
 *	The user is trying to bring the card into ready state. This requires
 *	a brief dialogue with the card. Firstly we enable interrupts and then
 *	'indications'. Without these enabled the card doesn't bother telling
 *	us what it has done. This had me puzzled for a week.
 *
 *	We then load the network address and multicast filters. Turn on the
 *	workaround mode. This works around a bug in the 82586 - it asks the
 *	firmware to do so. It has a performance hit but is needed on busy
 *	[read most] lans. We load the ring with buffers then we kick it
 *	all off.
 */
mc32_open
@dev: device to open

The user is trying to bring the card into ready state. This requires
a brief dialogue with the card. Firstly we enable interrupts and then
'indications'. Without these enabled the card doesn't bother telling
us what it has done. This had me puzzled for a week.

We then load the network address and multicast filters. Turn on the
workaround mode. This works around a bug in the 82586 - it asks the
firmware to do so. It has a performance hit but is needed on busy
[read most] lans. We load the ring with buffers then we kick it
all off.
mc32_open @dev : device to open The user is trying to bring the card into ready state . This requires a brief dialogue with the card . Firstly we enable interrupts and then ' indications ' . Without these enabled the card doesn ' t bother telling us what it has done . This had me puzzled for a week . We then load the network address and multicast filters . Turn on the workaround mode . This works around a bug in the 82586 - it asks the firmware to do so . It has a performance hit but is needed on busy [ read most ] lans . We load the ring with buffers then we kick it all off .
static int mc32_open(struct net_device *dev)
{
	int ioaddr = dev->base_addr;
	u16 zero_word=0;
	u8 one=1;
	u8 regs;
	regs=inb(ioaddr+HOST_CTRL);
	regs|=HOST_CTRL_INTE;
	outb(regs, ioaddr+HOST_CTRL);
	mc32_command(dev, 4, &one, 2);
	mc32_rx_abort(dev);
	mc32_tx_abort(dev);
	mc32_command(dev, 1, dev->dev_addr, 6);
	mc32_set_multicast_list(dev);
	mc32_command(dev, 0x0D, &zero_word, 2); 
	if(mc32_load_rx_ring(dev))
	{
		mc32_close(dev);
		return -ENOBUFS;
	}
	mc32_rx_begin(dev);
	mc32_tx_begin(dev);
	netif_start_queue(dev);	
	return 0;
}
static int mc32_open ( struct net_device * dev ) { int ioaddr = dev -> base_addr ; u16 zero_word = 0 ; u8 one = 1 ; u8 regs ; regs = inb ( ioaddr + HOST_CTRL ) ; regs |= HOST_CTRL_INTE ; outb ( regs , ioaddr + HOST_CTRL ) ; mc32_command ( dev , 4 , & one , 2 ) ; mc32_rx_abort ( dev ) ; mc32_tx_abort ( dev ) ; mc32_command ( dev , 1 , dev -> dev_addr , 6 ) ; mc32_set_multicast_list ( dev ) ; mc32_command ( dev , 0x0D , & zero_word , 2 ) ; if ( mc32_load_rx_ring ( dev ) ) { mc32_close ( dev ) ; return - ENOBUFS ; } mc32_rx_begin ( dev ) ; mc32_tx_begin ( dev ) ; netif_start_queue ( dev ) ; return 0 ; }
mc32_open
      @dev: device to open
mc32_open @dev : device to open
/*
	 *	Interrupts enabled
	 */ /*
	 *	Send the indications on command
	 */ /*
	 *	Send the command sequence "abort, resume" for RX and TX.
	 *	The abort cleans up the buffer chains if needed.
	 */ /* Set Network Address */ /* Set the filters */ /* Issue the 82586 workaround command - this is for "busy lans",
	   but basically means for all lans now days - has a performance
	   cost but best set */ /* 82586 bug workaround on */ /* Load the ring we just initialised */ /* And the resume command goes last */