[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH][1/7] Export SCSIDRV interface to kentry



Commit message:

Export SCSIDRV interface to kentry.
Contributed by David Galvez.
diff -r f4057833e369 -r 6368cc306846 sys/kentry.c
--- a/sys/kentry.c	Sun Apr 19 20:08:07 2015 +0200
+++ b/sys/kentry.c	Sun Apr 26 10:17:24 2015 +0200
@@ -55,6 +55,7 @@
 # include "proc.h"		/* sleep, wake, wakeselect, iwake */
 # include "proc_help.h"		/* proc_extensions */
 # include "proc_wakeup.h"	/* addprocwakeup */
+# include "scsidrv.h"
 # include "semaphores.h"	/* semaphore_* */
 # include "signal.h"		/* ikill */
 # include "syscall_vectors.h"	/* bios_tab, dos_tab */
diff -r f4057833e369 -r 6368cc306846 sys/libkern/kernel_module.h
--- a/sys/libkern/kernel_module.h	Sun Apr 19 20:08:07 2015 +0200
+++ b/sys/libkern/kernel_module.h	Sun Apr 26 10:17:24 2015 +0200
@@ -1181,4 +1181,28 @@
 # define xhlastaccess		(*KENTRY->vec_xhdi.XHLastAccess)
 # define xhreaccess			(*KENTRY->vec_xhdi.XHReaccess)
 
+
+/*
+ * kentry_scsidrv
+ */
+
+# define scsidrv_In				(*KENTRY->vec_scsidrv.scsidrv_In)
+# define scsidrv_Out			(*KENTRY->vec_scsidrv.scsidrv_Out)
+# define scsidrv_InquireSCSI	(*KENTRY->vec_scsidrv.scsidrv_InquireSCSI)
+# define scsidrv_InquireBus		(*KENTRY->vec_scsidrv.scsidrv_InquireBus)
+# define scsidrv_CheckDev		(*KENTRY->vec_scsidrv.scsidrv_CheckDev)
+# define scsidrv_RescanBus		(*KENTRY->vec_scsidrv.scsidrv_RescanBus)
+# define scsidrv_Open			(*KENTRY->vec_scsidrv.scsidrv_Open)
+# define scsidrv_Close			(*KENTRY->vec_scsidrv.scsidrv_Close)
+# define scsidrv_Error			(*KENTRY->vec_scsidrv.scsidrv_Error)
+# define scsidrv_Install		(*KENTRY->vec_scsidrv.scsidrv_Install)
+# define scsidrv_Deinstall		(*KENTRY->vec_scsidrv.scsidrv_Deinstall)
+# define scsidrv_GetCmd			(*KENTRY->vec_scsidrv.scsidrv_GetCmd)
+# define scsidrv_SendData		(*KENTRY->vec_scsidrv.scsidrv_SendData)
+# define scsidrv_GetData		(*KENTRY->vec_scsidrv.scsidrv_GetData)
+# define scsidrv_SendStatus		(*KENTRY->vec_scsidrv.scsidrv_SendStatus)
+# define scsidrv_SendMsg		(*KENTRY->vec_scsidrv.scsidrv_SendMsg)
+# define scsidrv_GetMsg			(*KENTRY->vec_scsidrv.scsidrv_GetMsg)
+# define scsidrv_InstallNewDriver	(*KENTRY->vec_scsidrv.scsidrv_InstallNewDriver)
+
 # endif /* _libkern_kernel_module_h */
diff -r f4057833e369 -r 6368cc306846 sys/mint/kentry.h
--- a/sys/mint/kentry.h	Sun Apr 19 20:08:07 2015 +0200
+++ b/sys/mint/kentry.h	Sun Apr 26 10:17:24 2015 +0200
@@ -50,8 +50,11 @@
 struct basepage;
 struct bio;
 struct bpb;
+struct businfo;
 struct create_process_opts;
+struct devinfo;
 struct dirstruct;
+struct dlong;
 struct dma;
 struct file;
 struct global;
@@ -64,7 +67,10 @@
 struct parser_item;
 struct parsinf;
 struct pci_conv_adr;
+struct scsicmd;
+struct scsidrv;
 struct semaphore;
+struct target;
 struct timeout;
 struct timeval;
 
@@ -111,7 +117,7 @@
  * versions are enough :-)
  */
 #define KENTRY_MAJ_VERSION	0
-#define KENTRY_MIN_VERSION	20
+#define KENTRY_MIN_VERSION	21
 
 /* hardware dependant vector
  */
@@ -1018,6 +1024,49 @@
 	XHReaccess, \
 }
 
+struct kentry_scsidrv
+{
+long _cdecl (*scsidrv_In)(struct scsicmd *par);
+long _cdecl (*scsidrv_Out)(struct scsicmd *par);
+long _cdecl (*scsidrv_InquireSCSI)(short what, struct businfo *info);
+long _cdecl (*scsidrv_InquireBus)(short what, short BusNo, struct devinfo *dev);
+long _cdecl (*scsidrv_CheckDev)(short BusNo, const struct dlong *SCSIId, char *Name, ushort *Features);
+long _cdecl (*scsidrv_RescanBus)(short BusNo);
+long _cdecl (*scsidrv_Open)(short BusNo, const struct dlong *SCSIId, ulong *MaxLen);
+long _cdecl (*scsidrv_Close)(short *handle);
+long _cdecl (*scsidrv_Error)(short *handle, short rwflag, short ErrNo);
+long _cdecl (*scsidrv_Install)(ushort bus, struct target *handler);
+long _cdecl (*scsidrv_Deinstall)(ushort bus, struct target *handler);
+long _cdecl (*scsidrv_GetCmd)(ushort bus, char *cmd);
+long _cdecl (*scsidrv_SendData)(ushort bus, char *buf, ulong len);
+long _cdecl (*scsidrv_GetData)(ushort bus, void *buf, ulong len);
+long _cdecl (*scsidrv_SendStatus)(ushort bus, ushort status);
+long _cdecl (*scsidrv_SendMsg)(ushort bus, ushort msg);
+long _cdecl (*scsidrv_GetMsg)(ushort bus, ushort *msg);
+long _cdecl (*scsidrv_InstallNewDriver)(struct scsidrv *newdrv);
+};
+#define DEFAULTS_kentry_scsidrv \
+{ \
+	scsidrv_In, \
+	scsidrv_Out, \
+	scsidrv_InquireSCSI, \
+	scsidrv_InquireBus, \
+	scsidrv_CheckDev, \
+	scsidrv_RescanBus, \
+	scsidrv_Open, \
+	scsidrv_Close, \
+	scsidrv_Error, \
+	scsidrv_Install, \
+	scsidrv_Deinstall, \
+	scsidrv_GetCmd, \
+	scsidrv_SendData, \
+	scsidrv_GetData, \
+	scsidrv_SendStatus, \
+	scsidrv_SendMsg, \
+	scsidrv_GetMsg, \
+	scsidrv_InstallNewDriver, \
+}
+
 /* the complete kernel entry
  */
 struct kentry
@@ -1055,6 +1104,7 @@
 
 	struct kentry_pcibios vec_pcibios;
 	struct kentry_xhdi vec_xhdi;
+	struct kentry_scsidrv vec_scsidrv;
 };
 # define DEFAULTS_kentry \
 { \
@@ -1087,6 +1137,7 @@
 	DEFAULTS_kentry_xdd, \
 	DEFAULTS_kentry_pcibios, \
 	DEFAULTS_kentry_xhdi, \
+	DEFAULTS_kentry_scsidrv, \
 }
 
 # endif /* _mint_kentry_h */
diff -r f4057833e369 -r 6368cc306846 sys/mint/scsidrv.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/mint/scsidrv.h	Sun Apr 26 10:17:24 2015 +0200
@@ -0,0 +1,196 @@
+/*
+ * $Id: scsidrv.h,v 1.4 2007/07/13 21:32:49 ozk Exp $
+ * 
+ * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
+ * distribution. See the file CHANGES for a detailed log of changes.
+ * 
+ * 
+ * Copyright 2000 Frank Naumann <fnaumann@freemint.de>
+ * All rights reserved.
+ * 
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * 
+ * Author: Frank Naumann <fnaumann@freemint.de>
+ * Started: 2000-03-24
+ * 
+ * please send suggestions, patches or bug reports to me or
+ * the MiNT mailing list
+ * 
+ */
+
+
+# ifndef mint_scsidrv_h
+# define mint_scsidrv_h
+
+#define SCSIRevision 0x0100                     /* Version 1.00 */
+
+/* forward definitions
+ */
+
+typedef struct scsidrv	SCSIDRV;
+typedef struct scsicmd	SCSICMD;
+typedef struct businfo	BUSINFO;
+typedef struct devinfo	DEVINFO;
+typedef struct target	TARGET;
+typedef struct dlong	DLONG;
+
+typedef char REQDATA [18];
+
+
+/* the struct definitions
+ */
+
+struct dlong
+{
+	ulong hi;
+	ulong lo;
+};
+
+struct scsicmd
+{
+	short	*handle;		/* Handle for bus and device */
+	char	*cmd;			/* Pointer to CmdBlock */
+	ushort	cmdlen;			/* Length of Cmd-Block (needed for ACSI) */
+	void	*buf;			/* Data buffer */
+	ulong	transferlen;	/* Transfer length */
+	char	*sense;			/* Buffer for ReqSense (18 Bytes) */
+	ulong	timeout;		/* Timeout in 1/200 sec */
+	ushort	flags;			/* Bit-vector for desired sequence of transfer */
+# define Disconnect 0x10	/* Try to disconnect */
+};
+
+struct businfo
+{
+	ulong	busids;
+	char	res [28];	/* for extensions */
+	
+	char	busname [20];	/* 'SCSI', 'ACSI', 'PAK-SCSI' */
+	ushort	busno;			/* Number with which the bus is to be addressed */
+	
+	/* Up to 16 features that the bus is capable of, e.g. Arbit,
+	 * Full-SCSI (all SCSI-Cmds, in contrast to ACSI where the upper
+	 * 3 bits of the first command are reserved for the target
+	 * address, so only <$1F) Target or Initiator controlled
+	 * Can service all addresses (say: ACSI-port in a TT!)
+	 * A SCSI-handle is also a pointer to a copy of this information!
+	 */
+	ushort	features;
+# define cArbit		0x01	/* Arbitration will take place on the bus */
+# define cAllCmds	0x02	/* All SCSI-Cmds can be transmitted */
+# define cTargCtrl	0x04	/* The target controls the procedure (so it should!) */
+# define cTarget	0x08	/* One can install oneself as a target on this bus */
+# define cCanDisconnect	0x10	/* Disconnect is possible */
+# define cScatterGather	0x20	/* Scatter gather possible with virtual RAM */
+	
+	/* Maximum transfer length on this bus (in bytes)
+	 * corresponds e.g. with ACSI to the size of the FRB
+	 * minimum 64kB (one FRB-size)
+	 */
+	ulong	maxlen;
+};
+
+struct devinfo
+{
+	char priv [32];
+	DLONG SCSIId;
+};
+
+struct target
+{
+	TARGET *next;
+	ushort	_cdecl (*TSel)		(ushort bus, ushort CSB, ushort CSD);
+	ushort	_cdecl (*TCmd)		(ushort bus, char *cmd);
+	ushort	_cdecl (*TCmdLen)	(ushort bus, ushort cmd);
+	void	_cdecl (*TReset)	(ushort bus);
+	void	_cdecl (*TEOP)		(ushort bus);
+	void	_cdecl (*TPErr)		(ushort bus);
+	void	_cdecl (*TPMism)	(ushort bus);
+	void	_cdecl (*TBLoss)	(ushort bus);
+	void	_cdecl (*TUnknownInt)	(ushort bus);
+};
+
+struct scsidrv
+{
+	ushort	version;		/* Revision in BCD: $0100 = 1.00 */
+	/* Routines as Initiator */
+	long _cdecl (*In)		(SCSICMD *par);
+	long _cdecl (*Out)		(SCSICMD *par);
+	/* error codes for In and Out */
+# define NOSCSIERROR		  0L /* no error */
+# define SELECTERROR		 -1L /* selection error */
+# define STATUSERROR		 -2L /* default error */
+# define PHASEERROR			 -3L /* invalid phase */
+# define BSYERROR			 -4L /* BSY lost */
+# define BUSERROR			 -5L /* bus failure by DMA transfer */
+# define TRANSERROR			 -6L /* error during DMA transfer */
+# define FREEERROR			 -7L /* bus isn't free */
+# define TIMEOUTERROR		 -8L /* timeout */
+# define DATATOOLONG		 -9L /* data to long for ACSI softtransfer */
+# define LINKERROR			-10L /* error during linked-command (ACSI) sending */
+# define TIMEOUTARBIT		-11L /* arbitration timeout */
+# define PENDINGERROR		-12L /* pending error on this handle */
+# define PARITYERROR		-13L /* parity error during transfer */
+	long _cdecl (*InquireSCSI)	(short what, BUSINFO *info);
+# define cInqFirst	0
+# define cInqNext	1
+	long _cdecl (*InquireBus)	(short what, short busno, DEVINFO *dev);
+	long _cdecl (*CheckDev)		(short busno, const DLONG *SCSIId, char *name, ushort *features);
+	long _cdecl (*RescanBus)	(short busno);
+	long _cdecl (*Open)		(short busno, const DLONG *SCSIId, ulong *maxlen);
+	long _cdecl (*Close)		(short *handle);
+	long _cdecl (*Error)		(short *handle, short rwflag, short ErrNo);
+# define cErrRead	0
+# define cErrWrite	1
+# define cErrMediach	0
+# define cErrReset	1
+	/* Routines as Target (optional) */
+	long _cdecl (*Install)		(ushort bus, TARGET *handler);
+	long _cdecl (*Deinstall)	(ushort bus, TARGET *handler);
+	long _cdecl (*GetCmd)		(ushort bus, char *cmd);
+	long _cdecl (*SendData)		(ushort bus, char *buf, ulong len);
+	long _cdecl (*GetData)		(ushort bus, void *buf, ulong len);
+	long _cdecl (*SendStatus)	(ushort bus, ushort status);
+	long _cdecl (*SendMsg)		(ushort bus, ushort msg);
+	long _cdecl (*GetMsg)		(ushort bus, ushort *msg);
+	/* global Variables (for Target routines) */
+	REQDATA *ReqData;
+};
+
+
+/* Functions prototypes. Only for drivers built in the kernel.
+ * Module drivers use kentry fucntion declarations.
+ */
+#if __KERNEL == 1
+long	scsidrv_In		(SCSICMD *par);
+long	scsidrv_Out		(SCSICMD *par);
+long	scsidrv_InquireSCSI	(short what, BUSINFO *info);
+long	scsidrv_InquireBus	(short what, short BusNo, DEVINFO *dev);
+long	scsidrv_CheckDev	(short BusNo, const DLONG *SCSIId, char *Name, ushort *Features);
+long	scsidrv_RescanBus	(short BusNo);
+long	scsidrv_Open		(short BusNo, const DLONG *SCSIId, ulong *MaxLen);
+long	scsidrv_Close		(short *handle);
+long	scsidrv_Error		(short *handle, short rwflag, short ErrNo);
+long	scsidrv_Install		(ushort bus, TARGET *handler);
+long	scsidrv_Deinstall	(ushort bus, TARGET *handler);
+long	scsidrv_GetCmd		(ushort bus, char *cmd);
+long	scsidrv_SendData	(ushort bus, char *buf, ulong len);
+long	scsidrv_GetData		(ushort bus, void *buf, ulong len);
+long	scsidrv_SendStatus	(ushort bus, ushort status);
+long	scsidrv_SendMsg		(ushort bus, ushort msg);
+long	scsidrv_GetMsg		(ushort bus, ushort *msg);
+#endif
+
+# endif /* mint_scsidrv_h */
diff -r f4057833e369 -r 6368cc306846 sys/scsidrv.c
--- a/sys/scsidrv.c	Sun Apr 19 20:08:07 2015 +0200
+++ b/sys/scsidrv.c	Sun Apr 26 10:17:24 2015 +0200
@@ -232,9 +232,40 @@
 
 
 long
+scsidrv_InstallNewDriver (SCSIDRV *newdrv)
+{
+	long olddrv = NULL;
+
+	if (!scsidrv)
+	{
+		scsidrv = newdrv;
+		scsidrv_installed = scsidrv->version;
+
+		emu_scsidrv.version = scsidrv_installed;
+		if (emu_scsidrv.version > 0x0101)
+			emu_scsidrv.version = 0x0101;
+
+		set_cookie (NULL, COOKIE_SCSI, (long) &emu_scsidrv);
+	}
+	else
+	{
+		if (newdrv->version < 0x0101)
+			emu_scsidrv.version = newdrv->version;
+
+		olddrv = (long) scsidrv;
+		scsidrv = newdrv;
+	}
+	return olddrv;
+}
+
+long
 scsidrv_In (SCSICMD *par)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_In (%lx)", par));
 	ret = (*scsidrv->In)(par);
 	SCSIDRV_DEBUG (("scsidrv_In (...) -> %li", ret));
@@ -245,6 +276,10 @@
 scsidrv_Out (SCSICMD *par)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_Out (%lx)", par));
 	ret = (*scsidrv->Out)(par);
 	SCSIDRV_DEBUG (("scsidrv_Out (...) -> %li", ret));
@@ -255,6 +290,10 @@
 scsidrv_InquireSCSI (short what, BUSINFO *info)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_InquireSCSI (%i, %lx)", what, info));
 	ret = (*scsidrv->InquireSCSI)(what, info);
 	SCSIDRV_DEBUG (("scsidrv_InquireSCSI (...) -> %li", ret));
@@ -265,6 +304,10 @@
 scsidrv_InquireBus (short what, short busno, DEVINFO *dev)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_InquireBUS (%i, %i, %lx)", what, busno, dev));
 	ret = (*scsidrv->InquireBus)(what, busno, dev);
 	SCSIDRV_DEBUG (("scsidrv_InquireBUS (...) -> %li", ret));
@@ -275,6 +318,10 @@
 scsidrv_CheckDev (short busno, const DLONG *SCSIId, char *name, ushort *features)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_CheckDev (%i, %lx, %lx, %lx)", busno, SCSIId, name, features));
 	ret = (*scsidrv->CheckDev)(busno, SCSIId, name, features);
 	SCSIDRV_DEBUG (("scsidrv_CheckDev (...) -> %li", ret));
@@ -285,6 +332,10 @@
 scsidrv_RescanBus (short busno)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_RescanBus (%i)", busno));
 	ret = (*scsidrv->RescanBus)(busno);
 	SCSIDRV_DEBUG (("scsidrv_RescanBus (...) -> %li", ret));
@@ -295,6 +346,10 @@
 scsidrv_Open (short busno, const DLONG *SCSIId, ulong *maxlen)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_Open (%i, %lx, %lx)", busno, SCSIId, maxlen));
 	ret = (*scsidrv->Open)(busno, SCSIId, maxlen);
 	SCSIDRV_DEBUG (("scsidrv_Open (...) -> %li", ret));
@@ -305,6 +360,10 @@
 scsidrv_Close (short *handle)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_Close (%lx)", handle));
 	ret = (*scsidrv->Close)(handle);
 	SCSIDRV_DEBUG (("scsidrv_Close (...) -> %li", ret));
@@ -315,6 +374,10 @@
 scsidrv_Error (short *handle, short rwflag, short ErrNo)
 {
 	register long ret;
+
+	if (!scsidrv)
+		return ENOSYS;
+
 	SCSIDRV_DEBUG (("scsidrv_Error (%lx, %i, %i)", handle, rwflag, ErrNo));
 	ret = (*scsidrv->Error)(handle, rwflag, ErrNo);
 	SCSIDRV_DEBUG (("scsidrv_Error (...) -> %li", ret));
@@ -325,48 +388,72 @@
 long
 scsidrv_Install (ushort bus, TARGET *handler)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->Install)(bus, handler);
 }
 
 long
 scsidrv_Deinstall (ushort bus, TARGET *handler)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->Deinstall)(bus, handler);
 }
 
 long
 scsidrv_GetCmd (ushort bus, char *cmd)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->GetCmd)(bus, cmd);
 }
 
 long
 scsidrv_SendData (ushort bus, char *buf, ulong len)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->SendData)(bus, buf, len);
 }
 
 long
 scsidrv_GetData (ushort bus, void *buf, ulong len)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->GetData)(bus, buf, len);
 }
 
 long
 scsidrv_SendStatus (ushort bus, ushort status)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->SendStatus)(bus, status);
 }
 
 long
 scsidrv_SendMsg (ushort bus, ushort msg)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->SendMsg)(bus, msg);
 }
 
 long
 scsidrv_GetMsg (ushort bus, ushort *msg)
 {
+	if (!scsidrv)
+		return ENOSYS;
+
 	return (*scsidrv->GetMsg)(bus, msg);
 }
 
diff -r f4057833e369 -r 6368cc306846 sys/scsidrv.h
--- a/sys/scsidrv.h	Sun Apr 19 20:08:07 2015 +0200
+++ b/sys/scsidrv.h	Sun Apr 26 10:17:24 2015 +0200
@@ -31,23 +31,15 @@
  * 
  */
 
+/* Header only for SCSIDRV system call emulation.
+ * IMPORTANT: Drivers must use /mint/scsidrv.h
+ */
 
 # ifndef _scsidrv_h
 # define _scsidrv_h
 
 # include "mint/mint.h"
-
-
-/* forward definitions
- */
-
-typedef struct scsicmd	SCSICMD;
-typedef struct businfo	BUSINFO;
-typedef struct scsidrv	SCSIDRV;
-typedef struct target	TARGET;
-typedef struct dlong	DLONG;
-typedef struct devinfo	DEVINFO;
-
+# include "mint/scsidrv.h"
 
 /* exported data
  */
@@ -59,31 +51,15 @@
  */
 
 long	scsidrv_init		(void);
-
 long	_cdecl sys_scsidrv	(ushort op,
 				 long a1, long a2, long a3, long a4,
 				 long a5, long a6, long a7);
 
+long	scsidrv_InstallNewDriver	(SCSIDRV *newdrv);
+
+/* SCSIDRV interface functions */
 long	scsidrv_In		(SCSICMD *par);
 long	scsidrv_Out		(SCSICMD *par);
-
-/* error codes ffor In and Out */
-
-# define NOSCSIERROR		  0L /* no error */
-# define SELECTERROR		 -1L /* selection error */
-# define STATUSERROR		 -2L /* default error */
-# define PHASEERROR		 -3L /* invalid phase */
-# define BSYERROR		 -4L /* BSY lost */
-# define BUSERROR		 -5L /* bus failure by DMA transfer */
-# define TRANSERROR		 -6L /* error during DMA transfer */
-# define FREEERROR		 -7L /* bus isn't free */
-# define TIMEOUTERROR		 -8L /* timeout */
-# define DATATOOLONG		 -9L /* data to long for ACSI softtransfer */
-# define LINKERROR		-10L /* error during linked-command (ACSI) sending */
-# define TIMEOUTARBIT		-11L /* arbitration timeout */
-# define PENDINGERROR		-12L /* pending error on this handle */
-# define PARITYERROR		-13L /* parity error during transfer */
-
 long	scsidrv_InquireSCSI	(short what, BUSINFO *info);
 long	scsidrv_InquireBus	(short what, short BusNo, DEVINFO *dev);
 long	scsidrv_CheckDev	(short BusNo, const DLONG *SCSIId, char *Name, ushort *Features);
@@ -101,117 +77,4 @@
 long	scsidrv_GetMsg		(ushort bus, ushort *msg);
 
 
-/* the struct definitions
- */
-
-struct scsicmd
-{
-	short	*handle;		/* Handle f�r Bus und Ger�t */
-	char	*cmd;			/* Zeiger auf CmdBlock */
-	ushort	cmdlen;			/* L�nge des Cmd-Block (f�r ACSI n�tig) */
-	void	*buf;			/* Datenpuffer */
-	ulong	transferlen;		/* �bertragungsl�nge */
-	char	*sense;			/* Puffer f�r ReqSense (18 Bytes) */
-	ulong	timeout;		/* Timeout in 1/200 sec */
-	ushort	flags;			/* Bitvektor f�r Ablaufw�nsche */
-# define Disconnect 0x10		/* versuche disconnect */
-};
-
-struct businfo
-{
-	/* abgearbeitete Busnummern
-	 * jeder Treiber mu� bei InuireSCSI das
-	 * mit seiner Busnummer korrespondierende
-	 * Bit setzen.
-	 */
-	ulong	BusIds;
-	char	res [28];	/* f�r Erweiterungen */
-	
-	char	BusName [20];	/* 'SCSI', 'ACSI', 'PAK-SCSI' */
-	ushort	BusNo;		/* Nummer, unter der der Bus anzusprechen ist */
-	
-	/* bis zu 16 Features, die der Bus kann, zB Arbit,
-	 * Full-SCSI (alle SCSI-Cmds im Gegensatz zu ACSI)
-	 * Target oder Initiator gesteuert
-	 * Ein SCSI-Handle ist auch ein Zeiger auf eine Kopie dieser Information!
-	 */
-	ushort	features;
-# define cArbit		0x01	/* auf dem Bus wird arbitriert */
-# define cAllCmds	0x02	/* hier k�nnen ale SCSI-Cmds abgesetzt werden */
-# define cTargCtrl	0x04	/* Das Target steuert den Ablauf (so soll's sein!) */
-# define cTarget	0x08	/* auf diesem Bus kann man sich als Target installieren */
-# define cCanDisconnect	0x10	/* Disconnect ist m�glich */
-# define cScatterGather	0x20	/* scatter gather bei virtuellem RAM m�glich */
-	
-	/* maximale Transferl�nge auf diesem Bus (in Bytes)
-	 * entspricht zB bei ACSI der Gr��e des FRB
-	 */
-	ulong	MaxLen;
-};
-
-struct dlong
-{
-	ulong hi;
-	ulong lo;
-};
-
-struct devinfo
-{
-	char priv [32];
-	DLONG SCSIId;
-};
-
-struct target
-{
-	TARGET *next;
-	ushort	_cdecl (*TSel)		(ushort bus, ushort CSB, ushort CSD);
-	ushort	_cdecl (*TCmd)		(ushort bus, char *cmd);
-	ushort	_cdecl (*TCmdLen)	(ushort bus, ushort cmd);
-	void	_cdecl (*TReset)	(ushort bus);
-	void	_cdecl (*TEOP)		(ushort bus);
-	void	_cdecl (*TPErr)		(ushort bus);
-	void	_cdecl (*TPMism)	(ushort bus);
-	void	_cdecl (*TBLoss)	(ushort bus);
-	void	_cdecl (*TUnknownInt)	(ushort bus);
-};
-
-typedef char REQDATA [18];
-
-struct scsidrv
-{
-	ushort	version;		/* Revision in BCD: $0100 = 1.00 */
-	
-	/* Routinen als Initiator */
-	long _cdecl (*In)		(SCSICMD *par);
-	long _cdecl (*Out)		(SCSICMD *par);
-	
-	long _cdecl (*InquireSCSI)	(short what, BUSINFO *info);
-# define cInqFirst	0
-# define cInqNext	1
-	long _cdecl (*InquireBus)	(short what, short busno, DEVINFO *dev);
-	long _cdecl (*CheckDev)		(short busno, const DLONG *SCSIId, char *name, ushort *features);
-	long _cdecl (*RescanBus)	(short busno);
-	long _cdecl (*Open)		(short busno, const DLONG *SCSIId, ulong *maxlen);
-	long _cdecl (*Close)		(short *handle);
-	long _cdecl (*Error)		(short *handle, short rwflag, short ErrNo);
-# define cErrRead	0
-# define cErrWrite	1
-# define cErrMediach	0
-# define cErrReset	1
-	
-	/* Routinen als Target (optional) */
-	long _cdecl (*Install)		(ushort bus, TARGET *handler);
-	long _cdecl (*Deinstall)	(ushort bus, TARGET *handler);
-	long _cdecl (*GetCmd)		(ushort bus, char *cmd);
-	long _cdecl (*SendData)		(ushort bus, char *buf, ulong len);
-	long _cdecl (*GetData)		(ushort bus, void *buf, ulong len);
-	long _cdecl (*SendStatus)	(ushort bus, ushort status);
-	long _cdecl (*SendMsg)		(ushort bus, ushort msg);
-	long _cdecl (*GetMsg)		(ushort bus, ushort *msg);
-	
-	/* globale Variablen (f�r Targetroutinen) */
-	REQDATA *ReqData;
-};
-
-
 # endif /* _scsidrv_h */