1 /* @(#)scgops.h	1.5 02/10/19 Copyright 2000 J. Schilling */
2 /*
3  *	Copyright (c) 2000 J. Schilling
4  */
5 /*
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; see the file COPYING.  If not, write to
18  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 
21 #ifndef	_SCG_SCGOPS_H
22 #define	_SCG_SCGOPS_H
23 
24 #ifdef	__cplusplus
25 extern "C" {
26 #endif
27 
28 typedef struct scg_ops {
29 	int	(*scgo_send)		__PR((SCSI *scgp));
30 
31 	char *	(*scgo_version)		__PR((SCSI *scgp, int what));
32 #ifdef	EOF	/* stdio.h has been included */
33 	int	(*scgo_help)		__PR((SCSI *scgp, FILE *f));
34 #else
35 	int	(*scgo_help)		__PR((SCSI *scgp, void *f));
36 #endif
37 	int	(*scgo_open)		__PR((SCSI *scgp, char *device));
38 	int	(*scgo_close)		__PR((SCSI *scgp));
39 	long	(*scgo_maxdma)		__PR((SCSI *scgp, long amt));
40 	void *	(*scgo_getbuf)		__PR((SCSI *scgp, long amt));
41 	void	(*scgo_freebuf)		__PR((SCSI *scgp));
42 
43 
44 	BOOL	(*scgo_havebus)		__PR((SCSI *scgp, int busno));
45 	int	(*scgo_fileno)		__PR((SCSI *scgp, int busno, int tgt, int tlun));
46 	int	(*scgo_initiator_id)	__PR((SCSI *scgp));
47 	int	(*scgo_isatapi)		__PR((SCSI *scgp));
48 	int	(*scgo_reset)		__PR((SCSI *scgp, int what));
49 } scg_ops_t;
50 
51 #define	SCGO_SEND(scgp)				(*(scgp)->ops->scgo_send)(scgp)
52 #define	SCGO_VERSION(scgp, what)		(*(scgp)->ops->scgo_version)(scgp, what)
53 #define	SCGO_HELP(scgp, f)			(*(scgp)->ops->scgo_help)(scgp, f)
54 #define	SCGO_OPEN(scgp, device)			(*(scgp)->ops->scgo_open)(scgp, device)
55 #define	SCGO_CLOSE(scgp)			(*(scgp)->ops->scgo_close)(scgp)
56 #define	SCGO_MAXDMA(scgp, amt)			(*(scgp)->ops->scgo_maxdma)(scgp, amt)
57 #define	SCGO_GETBUF(scgp, amt)			(*(scgp)->ops->scgo_getbuf)(scgp, amt)
58 #define	SCGO_FREEBUF(scgp)			(*(scgp)->ops->scgo_freebuf)(scgp)
59 #define	SCGO_HAVEBUS(scgp, busno)		(*(scgp)->ops->scgo_havebus)(scgp, busno)
60 #define	SCGO_FILENO(scgp, busno, tgt, tlun)	(*(scgp)->ops->scgo_fileno)(scgp, busno, tgt, tlun)
61 #define	SCGO_INITIATOR_ID(scgp)			(*(scgp)->ops->scgo_initiator_id)(scgp)
62 #define	SCGO_ISATAPI(scgp)			(*(scgp)->ops->scgo_isatapi)(scgp)
63 #define	SCGO_RESET(scgp, what)			(*(scgp)->ops->scgo_reset)(scgp, what)
64 
65 #ifdef	__cplusplus
66 }
67 #endif
68 
69 #endif	/* _SCG_SCGOPS_H */
70