FreeBSD/Linux Kernel Cross Reference
sys/scsi/rz_host.c
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 Software.Distribution@CS.CMU.EDU
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 * HISTORY
28 * $Log: rz_host.c,v $
29 * Revision 2.6 93/05/15 19:43:31 mrt
30 * machparam.h -> machspl.h
31 *
32 * Revision 2.5 93/03/09 10:57:46 danner
33 * Protos, start routine is void.
34 * [93/03/07 af]
35 *
36 * Revision 2.4 93/01/14 17:55:27 danner
37 * Checkpoint.
38 * [92/12/10 20:23:33 af]
39 *
40 * Revision 2.3 92/02/23 22:44:29 elf
41 * Changed the interface of a number of functions not to
42 * require the scsi_softc pointer any longer. It was
43 * mostly unused, now it can be found via tgt->masterno.
44 * [92/02/22 19:30:24 af]
45 *
46 * Revision 2.2 91/08/24 12:28:02 af
47 * Created.
48 * [91/08/02 03:47:02 af]
49 *
50 */
51 /*
52 * File: rz_host.c
53 * Author: Alessandro Forin, Carnegie Mellon University
54 * Date: 7/91
55 *
56 * Top layer of the SCSI driver: interface with the MI.
57 * This file contains operations specific to CPU-like devices.
58 *
59 * We handle here the case of other hosts that are capable of
60 * sophisticated host-to-host communication protocols, we make
61 * them look like... you'll see.
62 *
63 * There are two sides of the coin here: when we take the initiative
64 * and when the other host does it. Code for handling both cases is
65 * provided in this one file.
66 */
67
68 #include <mach/std_types.h>
69 #include <machine/machspl.h> /* spl definitions */
70 #include <scsi/compat_30.h>
71
72 #include <scsi/scsi.h>
73 #include <scsi/scsi_defs.h>
74 #include <scsi/rz.h>
75
76 /* Since we have invented a new "device" this cannot go into the
77 the 'official' scsi_devsw table. Too bad. */
78
79 extern char *schost_name();
80 extern scsi_ret_t
81 schost_open(), schost_close();
82 extern int schost_strategy();
83 extern void schost_start();
84
85 scsi_devsw_t scsi_host = {
86 schost_name, 0, schost_open, schost_close, schost_strategy,
87 schost_start, 0, 0
88 };
89
90 char *schost_name(internal)
91 boolean_t internal;
92 {
93 return internal ? "sh" : "host";
94 }
95
96 scsi_ret_t
97 schost_open(tgt)
98 target_info_t *tgt;
99 {
100 return SCSI_RET_SUCCESS; /* XXX if this is it, drop it */
101 }
102
103 scsi_ret_t
104 schost_close(tgt)
105 target_info_t *tgt;
106 {
107 return SCSI_RET_SUCCESS; /* XXX if this is it, drop it */
108 }
109
110 schost_strategy(ior)
111 register io_req_t ior;
112 {
113 return rz_simpleq_strategy( ior, schost_start);
114 }
115
116 void
117 schost_start( tgt, done)
118 target_info_t *tgt;
119 boolean_t done;
120 {
121 io_req_t head, ior;
122 scsi_ret_t ret;
123
124 if (done || (!tgt->dev_info.cpu.req_pending)) {
125 sccpu_start( tgt, done);
126 return;
127 }
128
129 ior = tgt->ior;
130 }
131
Cache object: 9e096e41991cacca1a1ac4780af37b6e
|