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

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

1995/0328/sys/src/9/pc/scsi.c:12,191995/0329/sys/src/9/pc/scsi.c:12,25 (short | long | prev | next)
1994/0908    
	Ninq		= 255, 
	Nscratch	= 255, 
1993/0915    
 
1995/0329    
	CMDtest		= 0x00, 
1994/0908    
	CMDreqsense	= 0x03, 
1995/0329    
	CMDread6	= 0x08, 
	CMDwrite6	= 0x0A, 
1994/0908    
	CMDinquire	= 0x12, 
1995/0329    
	CMDstart	= 0x1B, 
	CMDread10	= 0x28, 
	CMDwrite10	= 0x2A, 
1994/0908    
}; 
 
typedef struct { 
1995/0328/sys/src/9/pc/scsi.c:142,1551995/0329/sys/src/9/pc/scsi.c:148,159
1994/0908    
		} 
 
		/* 
		 * Inquire to find out what the device is 
1995/0329    
		 * Inquire to find out what the device is. 
1994/0908    
		 * Drivers then use the result to attach to targets 
		 */ 
1995/0324    
		memset(t->inq, 0, Ninq); 
1994/0908    
		cmd[0] = CMDinquire; 
		cmd[4] = Ninq; 
		nbytes = Ninq; 
1995/0324    
		s = scsiexec(t, SCSIread, cmd, sizeof(cmd), t->inq, &nbytes); 
1995/0329    
		s = scsiinquiry(t, 0, t->inq, &nbytes); 
1994/0908    
		if(s < 0) { 
1995/0324    
			print("scsi%d: unit %d inquire failed, status %d\n", t->ctlrno, i, s); 
1994/0908    
			continue; 
1995/0328/sys/src/9/pc/scsi.c:196,2021995/0329/sys/src/9/pc/scsi.c:200,206
1994/0908    
 
		t = &scsi[ctlr]->target[unit]; 
		devno++; 
		if(t->ok && (t->inq[0]&0x0F) == type){ 
1995/0329    
		if(t->ok && (t->inq[0]&0x1F) == type){ 
1994/0908    
			*rt = t; 
			*inq = t->inq; 
			sprint(id, "scsi%d: unit %d", ctlr, unit); 
1995/0328/sys/src/9/pc/scsi.c:212,2211995/0329/sys/src/9/pc/scsi.c:216,237
1994/0908    
	uchar cmd[6]; 
 
	memset(cmd, 0, sizeof cmd); 
	cmd[0] = 0x1b; 
1995/0329    
	cmd[0] = CMDstart; 
1994/0908    
	cmd[1] = lun<<5; 
	cmd[4] = s ? 1 : 0; 
	return scsiexec(t, SCSIread, cmd, sizeof(cmd), 0, 0); 
1995/0329    
} 
 
int 
scsiinquiry(Target *t, char lun, void *data, int *datalen) 
{ 
	uchar cmd[6]; 
 
	memset(cmd, 0, sizeof cmd); 
	cmd[0] = CMDinquire; 
	cmd[1] = lun<<5; 
	cmd[4] = *datalen; 
	return scsiexec(t, SCSIread, cmd, sizeof(cmd), data, datalen); 
1993/0915    
} 
 
1994/0908    
int 


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