Annotation of Gnu-Mach/scsi/rz_host.c, revision 1.1

1.1     ! root        1: /* 
        !             2:  * Mach Operating System
        !             3:  * Copyright (c) 1991,1990 Carnegie Mellon University
        !             4:  * All Rights Reserved.
        !             5:  * 
        !             6:  * Permission to use, copy, modify and distribute this software and its
        !             7:  * documentation is hereby granted, provided that both the copyright
        !             8:  * notice and this permission notice appear in all copies of the
        !             9:  * software, derivative works or modified versions, and any portions
        !            10:  * thereof, and that both notices appear in supporting documentation.
        !            11:  * 
        !            12:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            13:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            14:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            15:  * 
        !            16:  * Carnegie Mellon requests users of this software to return to
        !            17:  * 
        !            18:  *  Software Distribution Coordinator  or  [email protected]
        !            19:  *  School of Computer Science
        !            20:  *  Carnegie Mellon University
        !            21:  *  Pittsburgh PA 15213-3890
        !            22:  * 
        !            23:  * any improvements or extensions that they make and grant Carnegie Mellon
        !            24:  * the rights to redistribute these changes.
        !            25:  */
        !            26: /*
        !            27:  *     File: rz_host.c
        !            28:  *     Author: Alessandro Forin, Carnegie Mellon University
        !            29:  *     Date:   7/91
        !            30:  *
        !            31:  *     Top layer of the SCSI driver: interface with the MI.
        !            32:  *     This file contains operations specific to CPU-like devices.
        !            33:  *
        !            34:  * We handle here the case of other hosts that are capable of
        !            35:  * sophisticated host-to-host communication protocols, we make
        !            36:  * them look like... you'll see.
        !            37:  *
        !            38:  * There are two sides of the coin here: when we take the initiative
        !            39:  * and when the other host does it.  Code for handling both cases is
        !            40:  * provided in this one file.
        !            41:  */
        !            42: 
        !            43: #include <mach/std_types.h>
        !            44: #include <machine/machspl.h>           /* spl definitions */
        !            45: #include <scsi/compat_30.h>
        !            46: 
        !            47: #include <scsi/scsi.h>
        !            48: #include <scsi/scsi_defs.h>
        !            49: #include <scsi/rz.h>
        !            50: 
        !            51: #if  (NSCSI > 0)
        !            52: /* Since we have invented a new "device" this cannot go into the
        !            53:    the 'official' scsi_devsw table.  Too bad. */
        !            54: 
        !            55: extern char    *schost_name();
        !            56: extern scsi_ret_t
        !            57:                schost_open(), schost_close();
        !            58: extern int     schost_strategy();
        !            59: extern void    schost_start();
        !            60: 
        !            61: scsi_devsw_t   scsi_host = {
        !            62:        schost_name, 0, schost_open, schost_close, schost_strategy,
        !            63:        schost_start, 0, 0
        !            64: };
        !            65: 
        !            66: char *schost_name(internal)
        !            67:        boolean_t       internal;
        !            68: {
        !            69:        return internal ? "sh" : "host";
        !            70: }
        !            71: 
        !            72: scsi_ret_t
        !            73: schost_open(tgt)
        !            74:        target_info_t   *tgt;
        !            75: {
        !            76:        return SCSI_RET_SUCCESS;        /* XXX if this is it, drop it */
        !            77: }
        !            78: 
        !            79: scsi_ret_t
        !            80: schost_close(tgt)
        !            81:        target_info_t   *tgt;
        !            82: {
        !            83:        return SCSI_RET_SUCCESS;        /* XXX if this is it, drop it */
        !            84: }
        !            85: 
        !            86: schost_strategy(ior)
        !            87:        register io_req_t       ior;
        !            88: {
        !            89:        return rz_simpleq_strategy( ior, schost_start);
        !            90: }
        !            91: 
        !            92: void
        !            93: schost_start( tgt, done)
        !            94:        target_info_t   *tgt;
        !            95:        boolean_t       done;
        !            96: {
        !            97:        io_req_t                head, ior;
        !            98:        scsi_ret_t              ret;
        !            99: 
        !           100:        if (done || (!tgt->dev_info.cpu.req_pending)) {
        !           101:                sccpu_start( tgt, done);
        !           102:                return;
        !           103:        }
        !           104: 
        !           105:        ior = tgt->ior;
        !           106: }
        !           107: 
        !           108: #endif  /* NSCSI > 0 */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.