1 /* @(#)scgops.h 1.6 06/11/26 Copyright 2000 J. Schilling */ 2 /* 3 * Copyright (c) 2000 J. Schilling 4 */ 5 /* 6 * The contents of this file are subject to the terms of the 7 * Common Development and Distribution License, Version 1.0 only 8 * (the "License"). You may not use this file except in compliance 9 * with the License. 10 * 11 * See the file CDDL.Schily.txt in this distribution for details. 12 * A copy of the CDDL is also available via the Internet at 13 * http://www.opensource.org/licenses/cddl1.txt 14 * 15 * The following exceptions apply: 16 * CDDL �3.6 needs to be replaced by: "You may create a Larger Work by 17 * combining Covered Software with other code if all other code is governed by 18 * the terms of a license that is OSI approved (see www.opensource.org) and 19 * you may distribute the Larger Work as a single product. In such a case, 20 * You must make sure the requirements of this License are fulfilled for 21 * the Covered Software." 22 * 23 * When distributing Covered Code, include this CDDL HEADER in each 24 * file and include the License file CDDL.Schily.txt from this distribution. 25 */ 26 27 #ifndef _SCG_SCGOPS_H 28 #define _SCG_SCGOPS_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 typedef struct scg_ops { 35 int (*scgo_send) __PR((SCSI *scgp)); 36 37 char * (*scgo_version) __PR((SCSI *scgp, int what)); 38 #ifdef EOF /* stdio.h has been included */ 39 int (*scgo_help) __PR((SCSI *scgp, FILE *f)); 40 #else 41 int (*scgo_help) __PR((SCSI *scgp, void *f)); 42 #endif 43 int (*scgo_open) __PR((SCSI *scgp, char *device)); 44 int (*scgo_close) __PR((SCSI *scgp)); 45 long (*scgo_maxdma) __PR((SCSI *scgp, long amt)); 46 void * (*scgo_getbuf) __PR((SCSI *scgp, long amt)); 47 void (*scgo_freebuf) __PR((SCSI *scgp)); 48 49 50 int (*scgo_numbus) __PR((SCSI *scgp)); 51 BOOL (*scgo_havebus) __PR((SCSI *scgp, int busno)); 52 int (*scgo_fileno) __PR((SCSI *scgp, int busno, int tgt, int tlun)); 53 int (*scgo_initiator_id) __PR((SCSI *scgp)); 54 int (*scgo_isatapi) __PR((SCSI *scgp)); 55 int (*scgo_reset) __PR((SCSI *scgp, int what)); 56 } scg_ops_t; 57 58 #define SCGO_SEND(scgp) (*(scgp)->ops->scgo_send)(scgp) 59 #define SCGO_VERSION(scgp, what) (*(scgp)->ops->scgo_version)(scgp, what) 60 #define SCGO_HELP(scgp, f) (*(scgp)->ops->scgo_help)(scgp, f) 61 #define SCGO_OPEN(scgp, device) (*(scgp)->ops->scgo_open)(scgp, device) 62 #define SCGO_CLOSE(scgp) (*(scgp)->ops->scgo_close)(scgp) 63 #define SCGO_MAXDMA(scgp, amt) (*(scgp)->ops->scgo_maxdma)(scgp, amt) 64 #define SCGO_GETBUF(scgp, amt) (*(scgp)->ops->scgo_getbuf)(scgp, amt) 65 #define SCGO_FREEBUF(scgp) (*(scgp)->ops->scgo_freebuf)(scgp) 66 #define SCGO_NUMBUS(scgp) (*(scgp)->ops->scgo_numbus)(scgp) 67 #define SCGO_HAVEBUS(scgp, busno) (*(scgp)->ops->scgo_havebus)(scgp, busno) 68 #define SCGO_FILENO(scgp, busno, tgt, tlun) (*(scgp)->ops->scgo_fileno)(scgp, busno, tgt, tlun) 69 #define SCGO_INITIATOR_ID(scgp) (*(scgp)->ops->scgo_initiator_id)(scgp) 70 #define SCGO_ISATAPI(scgp) (*(scgp)->ops->scgo_isatapi)(scgp) 71 #define SCGO_RESET(scgp, what) (*(scgp)->ops->scgo_reset)(scgp, what) 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* _SCG_SCGOPS_H */ 78