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

1995/0328/pc/scsi.c (diff list | history)

1995/0324/sys/src/9/pc/scsi.c:25,451995/0328/sys/src/9/pc/scsi.c:25,54 (short | long | prev | next)
1994/0908    
 
static Ctlr *scsi[MaxScsi]; 
 
static struct { 
1995/0328    
typedef struct Link Link; 
typedef struct Link { 
1994/0908    
	char	*type; 
	Scsiio	(*reset)(int, ISAConf*); 
} cards[MaxScsi+1]; 
 
1995/0328    
	Link*	link; 
} Link; 
 
static Link *link; 
static int linkcount; 
 
1993/0915    
void 
1994/0908    
addscsicard(char *t, Scsiio (*r)(int, ISAConf*)) 
1995/0328    
addscsilink(char *t, Scsiio (*r)(int, ISAConf*)) 
1993/0915    
{ 
1994/0908    
	static int ncard; 
1995/0328    
	Link *lp; 
1994/0908    
 
	if(ncard == MaxScsi) 
		panic("too many scsi cards\n"); 
	cards[ncard].type = t; 
	cards[ncard].reset = r; 
	ncard++; 
1995/0328    
	if((lp = xalloc(sizeof(Link))) == 0) 
		return; 
	lp->type = t; 
	lp->reset = r; 
 
	lp->link = link; 
	link = lp; 
	linkcount++; 
1993/0915    
} 
 
void 
1995/0324/sys/src/9/pc/scsi.c:46,521995/0328/sys/src/9/pc/scsi.c:55,62
1994/0908    
scsireset(void) 
1993/0915    
{ 
1994/0908    
	Ctlr *ctlr; 
	int ctlrno, n, t; 
1995/0328    
	int ctlrno, t; 
	Link *lp; 
1994/0908    
 
	for(ctlr = 0, ctlrno = 0; ctlrno < MaxScsi; ctlrno++){ 
		if(ctlr == 0) 
1995/0324/sys/src/9/pc/scsi.c:54,681995/0328/sys/src/9/pc/scsi.c:64,81
1994/0908    
		memset(ctlr, 0, sizeof(Ctlr)); 
		if(isaconfig("scsi", ctlrno, ctlr) == 0) 
			continue; 
		for(n = 0; cards[n].type; n++){ 
			if(strcmp(cards[n].type, ctlr->type)) 
1995/0328    
		for(lp = link; lp; lp = lp->link){ 
			if(strcmp(lp->type, ctlr->type)) 
1994/0908    
				continue; 
			if((ctlr->io = (*cards[n].reset)(ctlrno, ctlr)) == 0) 
1995/0328    
			if((ctlr->io = (*lp->reset)(ctlrno, ctlr)) == 0) 
1994/0908    
				break; 
 
			print("scsi%d: %s: port %lux irq %d addr %lux size %d\n", 
1995/0328    
			print("scsi%d: %s: port %lux irq %d", 
1994/0908    
				ctlrno, ctlr->type, ctlr->port, 
				ctlr->irq, ctlr->mem, ctlr->size); 
1995/0328    
			if(ctlr->mem) 
				print(" addr %lux size %d\n", ctlr->mem, ctlr->size); 
			print("\n"); 
1994/0908    
 
			for(t = 0; t < NTarget; t++){ 
				ctlr->target[t].ctlrno = ctlrno; 


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