Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/alphapc/sd.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname alphapc/sd.h 2000/0515
## diff -e /dev/null /n/emeliedump/2000/0515/sys/src/9/alphapc/sd.h
0a
/*
 * Storage Device.
 */
typedef struct SDev SDev;
typedef struct SDifc SDifc;
typedef struct SDpart SDpart;
typedef struct SDreq SDreq;
typedef struct SDunit SDunit;

typedef struct SDpart {
	ulong	start;
	ulong	end;
	char	name[NAMELEN];
	char	user[NAMELEN];
	ulong	perm;
	int	valid;
	int	nopen;			/* of this partition */
} SDpart;

typedef struct SDunit {
	SDev*	dev;
	int	subno;
	uchar	inquiry[256];		/* format follows SCSI spec */
	char	name[NAMELEN];
	Rendez	rendez;

	QLock	ctl;
	ulong	sectors;
	ulong	secsize;
	SDpart*	part;
	int	npart;			/* of valid partitions */
	int	nopen;			/* of partitions on this unit */
	int	changed;

	QLock	raw;
	int	state;
	ulong	pid;
	SDreq*	req;
} 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 {
	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*);
.
## diffname alphapc/sd.h 2000/0607
## diff -e /n/emeliedump/2000/0515/sys/src/9/alphapc/sd.h /n/emeliedump/2000/0607/sys/src/9/alphapc/sd.h
93a
	SDretry		= -5,		/* internal to controllers */
.
37d
35c
	Lock	rawinuse;		/* really just a test-and-set */
.
## diffname alphapc/sd.h 2000/0618
## diff -e /n/emeliedump/2000/0607/sys/src/9/alphapc/sd.h /n/emeliedump/2000/0618/sys/src/9/alphapc/sd.h
30,33c
	SDpart*	part;		/* either nil or points at array of size SDnpart */
	ulong	vers;
.
17c
	ulong	vers;
.
## diffname alphapc/sd.h 2000/0706
## diff -e /n/emeliedump/2000/0618/sys/src/9/alphapc/sd.h /n/emeliedump/2000/0706/sys/src/9/alphapc/sd.h
35a
	SDperm	rawperm;
.
31a
	SDperm	ctlperm;
.
30c
	SDpart*	part;			/* nil or array of size SDnpart */
.
24c
	SDperm;
.
15a
} SDperm;

typedef struct SDpart {
	ulong	start;
	ulong	end;
	SDperm;
.
10,12c
typedef struct SDperm {
.
6a
typedef struct SDperm SDperm;
.
## diffname alphapc/sd.h 2000/0809
## diff -e /n/emeliedump/2000/0706/sys/src/9/alphapc/sd.h /n/emeliedump/2000/0809/sys/src/9/alphapc/sd.h
35c
	SDpart*	part;			/* nil or array of size npart */
	int	npart;
.
## diffname alphapc/sd.h 2000/1129 # deleted
## diff -e /n/emeliedump/2000/0809/sys/src/9/alphapc/sd.h /n/emeliedump/2000/1129/sys/src/9/alphapc/sd.h
1,121d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].