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

2000/0618/alphapc/sd.h (diff list | history)

2000/0515/sys/src/9/alphapc/sd.h:32,402000/0607/sys/src/9/alphapc/sd.h:32,39 (short | long)
2000/0515    
	int	nopen;			/* of partitions on this unit */ 
	int	changed; 
 
	QLock	raw; 
2000/0607    
	Lock	rawinuse;		/* really just a test-and-set */ 
2000/0515    
	int	state; 
	ulong	pid; 
	SDreq*	req; 
} SDunit; 
 
2000/0515/sys/src/9/alphapc/sd.h:91,962000/0607/sys/src/9/alphapc/sd.h:90,96
2000/0515    
}; 
 
enum { 
2000/0607    
	SDretry		= -5,		/* internal to controllers */ 
2000/0515    
	SDmalloc	= -4, 
	SDeio		= -3, 
	SDtimeout	= -2, 
2000/0607/sys/src/9/alphapc/sd.h:14,202000/0618/sys/src/9/alphapc/sd.h:14,20 (short | long)
2000/0515    
	char	user[NAMELEN]; 
	ulong	perm; 
	int	valid; 
	int	nopen;			/* of this partition */ 
2000/0618    
	ulong	vers; 
2000/0515    
} SDpart; 
 
typedef struct SDunit { 
2000/0607/sys/src/9/alphapc/sd.h:27,362000/0618/sys/src/9/alphapc/sd.h:27,34
2000/0515    
	QLock	ctl; 
	ulong	sectors; 
	ulong	secsize; 
	SDpart*	part; 
	int	npart;			/* of valid partitions */ 
	int	nopen;			/* of partitions on this unit */ 
	int	changed; 
2000/0618    
	SDpart*	part;		/* either nil or points at array of size SDnpart */ 
	ulong	vers; 
2000/0515    
 
2000/0607    
	Lock	rawinuse;		/* really just a test-and-set */ 
2000/0515    
	int	state; 
2000/0618/sys/src/9/alphapc/sd.h:4,182000/0706/sys/src/9/alphapc/sd.h:4,23 (short | long)
2000/0515    
typedef struct SDev SDev; 
typedef struct SDifc SDifc; 
typedef struct SDpart SDpart; 
2000/0706    
typedef struct SDperm SDperm; 
2000/0515    
typedef struct SDreq SDreq; 
typedef struct SDunit SDunit; 
 
typedef struct SDpart { 
	ulong	start; 
	ulong	end; 
2000/0706    
typedef struct SDperm { 
2000/0515    
	char	name[NAMELEN]; 
	char	user[NAMELEN]; 
	ulong	perm; 
2000/0706    
} SDperm; 
 
typedef struct SDpart { 
	ulong	start; 
	ulong	end; 
	SDperm; 
2000/0515    
	int	valid; 
2000/0618    
	ulong	vers; 
2000/0515    
} SDpart; 
2000/0618/sys/src/9/alphapc/sd.h:21,382000/0706/sys/src/9/alphapc/sd.h:26,45
2000/0515    
	SDev*	dev; 
	int	subno; 
	uchar	inquiry[256];		/* format follows SCSI spec */ 
	char	name[NAMELEN]; 
2000/0706    
	SDperm; 
2000/0515    
	Rendez	rendez; 
 
	QLock	ctl; 
	ulong	sectors; 
	ulong	secsize; 
2000/0618    
	SDpart*	part;		/* either nil or points at array of size SDnpart */ 
2000/0706    
	SDpart*	part;			/* nil or array of size SDnpart */ 
2000/0618    
	ulong	vers; 
2000/0706    
	SDperm	ctlperm; 
2000/0515    
 
2000/0607    
	Lock	rawinuse;		/* really just a test-and-set */ 
2000/0515    
	int	state; 
	SDreq*	req; 
2000/0706    
	SDperm	rawperm; 
2000/0515    
} SDunit; 
 
typedef struct SDev { 
2000/0706/sys/src/9/alphapc/sd.h:32,382000/0809/sys/src/9/alphapc/sd.h:32,39 (short | long)
2000/0515    
	QLock	ctl; 
	ulong	sectors; 
	ulong	secsize; 
2000/0706    
	SDpart*	part;			/* nil or array of size SDnpart */ 
2000/0809    
	SDpart*	part;			/* nil or array of size npart */ 
	int	npart; 
2000/0618    
	ulong	vers; 
2000/0706    
	SDperm	ctlperm; 
2000/0515    
 
2000/0809/sys/src/9/alphapc/sd.h:1,1212000/1129/sys/src/9/alphapc/sd.h:0 (short | long)
Deleted.
rsc Mon Mar 7 10:20:29 2005
2000/0515    
/* 
 * Storage Device. 
 */ 
typedef struct SDev SDev; 
typedef struct SDifc SDifc; 
typedef struct SDpart SDpart; 
2000/0706    
typedef struct SDperm SDperm; 
2000/0515    
typedef struct SDreq SDreq; 
typedef struct SDunit SDunit; 
                 
2000/0706    
typedef struct SDperm { 
2000/0515    
	char	name[NAMELEN]; 
	char	user[NAMELEN]; 
	ulong	perm; 
2000/0706    
} SDperm; 
                 
typedef struct SDpart { 
	ulong	start; 
	ulong	end; 
	SDperm; 
2000/0515    
	int	valid; 
2000/0618    
	ulong	vers; 
2000/0515    
} SDpart; 
                 
typedef struct SDunit { 
	SDev*	dev; 
	int	subno; 
	uchar	inquiry[256];		/* format follows SCSI spec */ 
2000/0706    
	SDperm; 
2000/0515    
	Rendez	rendez; 
                 
	QLock	ctl; 
	ulong	sectors; 
	ulong	secsize; 
2000/0809    
	SDpart*	part;			/* nil or array of size npart */ 
	int	npart; 
2000/0618    
	ulong	vers; 
2000/0706    
	SDperm	ctlperm; 
2000/0515    
                 
2000/0607    
	Lock	rawinuse;		/* really just a test-and-set */ 
2000/0515    
	int	state; 
	SDreq*	req; 
2000/0706    
	SDperm	rawperm; 
2000/0515    
} SDunit; 
                 
typedef struct SDev { 
	SDifc*	ifc;			/* pnp/legacy */ 
	void	*ctlr; 
	int	idno; 
	char	name[NAMELEN]; 
	int	index;			/* into unit space */ 
	int	nunit; 
	SDev*	next; 
                 
	QLock;				/* enable/disable */ 
	int	enabled; 
} SDev; 
                 
typedef struct SDifc { 
	char*	name; 
                 
	SDev*	(*pnp)(void); 
	SDev*	(*legacy)(int, int); 
	SDev*	(*id)(SDev*); 
	int	(*enable)(SDev*); 
	int	(*disable)(SDev*); 
                 
	int	(*verify)(SDunit*); 
	int	(*online)(SDunit*); 
	int	(*rio)(SDreq*); 
	int	(*rctl)(SDunit*, char*, int); 
	int	(*wctl)(SDunit*, Cmdbuf*); 
                 
	long	(*bio)(SDunit*, int, int, void*, long, long); 
} SDifc; 
                 
typedef struct SDreq { 
	SDunit*	unit; 
	int	lun; 
	int	write; 
	uchar	cmd[16]; 
	int	clen; 
	void*	data; 
	int	dlen; 
                 
	int	flags; 
                 
	int	status; 
	long	rlen; 
	uchar	sense[256]; 
} SDreq; 
                 
enum { 
	SDnosense	= 0x00000001, 
	SDvalidsense	= 0x00010000, 
}; 
                 
enum { 
2000/0607    
	SDretry		= -5,		/* internal to controllers */ 
2000/0515    
	SDmalloc	= -4, 
	SDeio		= -3, 
	SDtimeout	= -2, 
	SDnostatus	= -1, 
                 
	SDok		= 0, 
                 
	SDcheck		= 0x02,		/* check condition */ 
	SDbusy		= 0x08,		/* busy */ 
                 
	SDmaxio		= 2048*1024, 
	SDnpart		= 16, 
}; 
                 
#define sdmalloc(n)	malloc(n) 
#define sdfree(p)	free(p) 
                 
/* sdscsi.c */ 
extern int scsiverify(SDunit*); 
extern int scsionline(SDunit*); 
extern long scsibio(SDunit*, int, int, void*, long, long); 
extern SDev* scsiid(SDev*, SDifc*); 


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