summaryrefslogtreecommitdiff
path: root/scsi/adapters/scsi_dma.h
blob: 9401a16480c2aea1cf0157956be429bf30bf75d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* 
 * Mach Operating System
 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS AS-IS
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 *	File: scsi_dma.h
 * 	Author: Alessandro Forin, Carnegie Mellon University
 *	Date:	7/91
 *
 *	DMA operations that an HBA driver might invoke.
 *
 */

/*
 * This defines much more than usually needed, mainly
 * to cover for the case of no DMA at all and/or only
 * DMA from/to a specialized buffer ( which means the
 * CPU has to copy data into/outof it ).
 */

typedef struct {
	opaque_t	(*init)(
				int 		dev_unit,
				vm_offset_t 	base,
				int		*dma_bsizep,
				boolean_t	*oddbp);

	void		(*new_target)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	void		(*map)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	int		(*start_cmd)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	void		(*end_xfer)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	void		(*end_cmd)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				io_req_t	ior);

	int		(*start_datain)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	int		(*start_msgin)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	void		(*end_msgin)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	boolean_t	(*start_dataout)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				volatile unsigned *regp,
				unsigned	value,
				unsigned char	*prefetch_count);

	int		(*restart_datain_1)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	int		(*restart_datain_2)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	void		(*restart_datain_3)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	int		(*restart_dataout_1)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	int		(*restart_dataout_2)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	int		(*restart_dataout_3)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				volatile unsigned *regp);

	void		(*restart_dataout_4)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	boolean_t	(*disconn_1)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	boolean_t	(*disconn_2)(
				opaque_t	dma_state,
				target_info_t	*tgt);

	boolean_t	(*disconn_3)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	boolean_t	(*disconn_4)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	boolean_t	(*disconn_5)(
				opaque_t	dma_state,
				target_info_t	*tgt,
				int		xferred);

	void		(*disconn_callback)(
				opaque_t	dma_state,
				target_info_t	*tgt);

} scsi_dma_ops_t;