plan 9 kernel history: overview | file list | diff list

1993/1124/pc/devether.c (diff list | history)

1993/1120/sys/src/9/pc/devether.c:162,1861993/1124/sys/src/9/pc/devether.c:162,167 (short | long | prev | next)
1993/1113    
	return n; 
1992/0403    
} 
 
static void 
1993/1113    
etherintr(Ureg *ur) 
1992/0403    
{ 
1993/1113    
	int i, irq; 
1992/0403    
                 
1992/1222    
	/* 
1993/1113    
	 * Call all ethernet interrupt routines on this IRQ. 
	 * Might be better if setvec() took an argument which 
	 * was passed down to the interrupt routine when 
	 * called. This would let us easily distinguish multiple 
	 * controllers. A hack by any other name... 
1992/1222    
	 */ 
1993/1113    
	irq = ur->trap-Int0vec; 
	for(i = 0; i < MaxEther; i++){ 
		if(ether[i] && ether[i]->irq == irq) 
			(*ether[i]->interrupt)(ether[i]); 
1992/0403    
	} 
} 
                 
1993/1113    
static struct { 
	char	*type; 
	int	(*reset)(Ether*); 
1993/1120/sys/src/9/pc/devether.c:222,2361993/1124/sys/src/9/pc/devether.c:203,213
1992/1222    
			 * IRQ2 doesn't really exist, it's used to gang the interrupt 
			 * controllers together. A device set to IRQ2 will appear on 
			 * the second interrupt controller as IRQ9. 
1993/1113    
			 * If there are multiple controllers on the same IRQ, only 
			 * call setvec() for one of them, etherintr() will scan through 
			 * all the controllers looking for those at the IRQ it was 
			 * called with. This is a hack, see the comments in etherintr(). 
1992/1222    
			 */ 
1993/1113    
			if(ctlr->irq == 2) 
				ctlr->irq = 9; 
			if((irqmask & (1<<ctlr->irq)) == 0){ 
				setvec(Int0vec+ctlr->irq, etherintr); 
1993/1124    
				setvec(Int0vec+ctlr->irq, ctlr->interrupt, ctlr); 
1993/1113    
				irqmask |= 1<<ctlr->irq; 
			} 
1993/0212    
 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)