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

1999/0422/alphapc/pci.c (diff list | history)

1999/0422/sys/src/9/alphapc/pci.c:40,501999/0507/sys/src/9/alphapc/pci.c:40,51 (short | long | prev | next)
1999/0415    
		maxfno = 0; 
		for(fno = 0; fno <= maxfno; fno++){ 
			/* 
			 * For this possible device, form the bus+device+function 
			 * triplet needed to address it and try to read the vendor 
			 * and device ID. If successful, allocate a device struct 
			 * and start to fill it in with some useful information from 
			 * the device's configuration space. 
1999/0507    
			 * For this possible device, form the 
			 * bus+device+function triplet needed to address it 
			 * and try to read the vendor and device ID. 
			 * If successful, allocate a device struct and 
			 * start to fill it in with some useful information 
			 * from the device's configuration space. 
1999/0415    
			 */ 
			tbdf = MKBUS(BusPCI, bno, dno, fno); 
			l = pcicfgrw32(tbdf, PciVID, 0, 1); 
1999/0422/sys/src/9/alphapc/pci.c:70,761999/0507/sys/src/9/alphapc/pci.c:71,79
1999/0415    
			pcitail = p; 
 
			p->intl = pcicfgr8(p, PciINTL); 
			p->ccru = pcicfgr16(p, PciCCRu); 
1999/0507    
			p->ccrp = pcicfgr8(p, PciCCRp); 
			p->ccru = pcicfgr8(p, PciCCRu); 
			p->ccrb = pcicfgr8(p, PciCCRb); 
1999/0415    
 
			/* 
			 * If the device is a multi-function device adjust the 
1999/0422/sys/src/9/alphapc/pci.c:84,901999/0507/sys/src/9/alphapc/pci.c:87,93
1999/0415    
			 * If appropriate, read the base address registers 
			 * and work out the sizes. 
			 */ 
			switch(p->ccru>>8){ 
1999/0507    
			switch(p->ccrb){ 
1999/0415    
 
			case 0x01:		/* mass storage controller */ 
			case 0x02:		/* network controller */ 
1999/0422/sys/src/9/alphapc/pci.c:129,1351999/0507/sys/src/9/alphapc/pci.c:132,138
1999/0415    
		/* 
		 * Find PCI-PCI bridges and recursively descend the tree. 
		 */ 
		if(p->ccru != ((0x06<<8)|0x04)) 
1999/0507    
		if(p->ccrb != 0x06 || p->ccru != 0x04) 
1999/0415    
			continue; 
 
		/* 
1999/0422/sys/src/9/alphapc/pci.c:311,3241999/0507/sys/src/9/alphapc/pci.c:314,329
1999/0415    
	int i; 
	Pcidev *t; 
 
1999/0507    
	if(pcicfgmode == -1) 
		pcicfginit(); 
1999/0415    
	if(p == nil) { 
		p = pciroot; 
		print("bus dev type vid  did intl memory\n"); 
	} 
	for(t = p; t != nil; t = t->link) { 
		print("%d  %2d/%d %.4ux %.4ux %.4ux %2d  ", 
1999/0507    
		print("%d  %2d/%d %.2ux %.2ux %.2ux %.4ux %.4ux %2d  ", 
1999/0415    
			BUSBNO(t->tbdf), BUSDNO(t->tbdf), BUSFNO(t->tbdf), 
			t->ccru, t->vid, t->did, t->intl); 
1999/0507    
			t->ccrb, t->ccru, t->ccrp, t->vid, t->did, t->intl); 
1999/0415    
 
		for(i = 0; i < nelem(p->mem); i++) { 
			if(t->mem[i].size == 0) 


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