FreeBSD/Linux Kernel Cross Reference
sys/scsi/rz.h
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.h,v $
29 * Revision 2.9 93/08/03 12:33:48 mrt
30 * Added rzlun().
31 * [93/07/29 23:40:26 af]
32 *
33 * Revision 2.8 92/04/03 12:09:55 rpd
34 * Fabricate extra partition info to deal with the
35 * first alternate partition range and "PARITITON_ABSOLUTE".
36 * [92/04/01 rvb]
37 *
38 * Revision 2.7 91/06/19 11:56:57 rvb
39 * File moved here from mips/PMAX since it is now "MI" code, also
40 * used by Vax3100 and soon -- the omron luna88k.
41 * [91/06/04 rvb]
42 *
43 * A couple of macros were not fully parenthesized, which screwed
44 * up the second scsi bus on Vaxen. [This was the only bug in the
45 * multi-bus code, amazing].
46 * [91/05/30 af]
47 *
48 * Revision 2.6 91/05/14 17:26:19 mrt
49 * Correcting copyright
50 *
51 * Revision 2.5 91/05/13 06:04:20 af
52 * Redefined naive macro names to avoid conflicts.
53 * [91/05/12 16:08:55 af]
54 *
55 * Revision 2.4 91/02/05 17:43:42 mrt
56 * Added author notices
57 * [91/02/04 11:16:33 mrt]
58 *
59 * Changed to use new Mach copyright
60 * [91/02/02 12:15:29 mrt]
61 *
62 * Revision 2.3 90/12/05 23:33:55 af
63 *
64 *
65 * Revision 2.1.1.1 90/11/01 03:43:37 af
66 * Created.
67 * [90/10/21 af]
68 */
69 /*
70 * File: rz.h
71 * Author: Alessandro Forin, Carnegie Mellon University
72 * Date: 9/90
73 *
74 * Mapping between U*x-like indexing and controller+slave
75 * Each controller handles at most 8 slaves, few controllers.
76 */
77
78 #define rzcontroller(dev) (((dev)>>6)&0x3)
79 #define rzslave(dev) (((dev)>>3)&0x7)
80 #define rzpartition(dev) ((PARTITION_TYPE(dev)==0xf)?MAXPARTITIONS:((dev)&0x7))
81 /* To address the full 256 luns use upper bits 8..12 */
82 /* NOTE: Under U*x this means the next major up.. what a mess */
83 #define rzlun(dev) (((dev)&0x7) | (((dev)>>5)&0xf8))
84
85 #define PARTITION_TYPE(dev) (((dev)>>24)&0xf)
86 #define PARTITION_ABSOLUTE (0xf<<24)
87
88 #ifdef MACH_KERNEL
89 #else /*MACH_KERNEL*/
90 #define tape_unit(dev) ((((dev)&0xe0)>>3)|((dev)&0x3))
91 #define TAPE_UNIT(dev) ((dev)&(~0xff))|(tape_unit((dev))<<3)
92 #define TAPE_REWINDS(dev) (((dev)&0x1c)==0)||(((dev)&0x1c)==8)
93 #endif /*MACH_KERNEL*/
Cache object: 0a8d0d943fa60a8a72f8a8ea3bfb02ed
|