xref: /freebsd/sys/cam/ctl/README.ctl.txt (revision d36c6176161e31d945d8adbb2aae1ccffb632bd7)
1130f4520SKenneth D. Merry/* $FreeBSD$ */
2130f4520SKenneth D. Merry
3130f4520SKenneth D. MerryCTL - CAM Target Layer Description
4130f4520SKenneth D. Merry
5130f4520SKenneth D. MerryRevision 1.4 (December 29th, 2011)
6130f4520SKenneth D. MerryKen Merry <ken@FreeBSD.org>
7130f4520SKenneth D. Merry
8130f4520SKenneth D. MerryTable of Contents:
9130f4520SKenneth D. Merry=================
10130f4520SKenneth D. Merry
11130f4520SKenneth D. MerryIntroduction
12130f4520SKenneth D. MerryFeatures
13130f4520SKenneth D. MerryConfiguring and Running CTL
14130f4520SKenneth D. MerryRevision 1.N Changes
15130f4520SKenneth D. MerryTo Do List
16130f4520SKenneth D. MerryCode Roadmap
17130f4520SKenneth D. MerryUserland Commands
18130f4520SKenneth D. Merry
19130f4520SKenneth D. MerryIntroduction:
20130f4520SKenneth D. Merry============
21130f4520SKenneth D. Merry
22130f4520SKenneth D. MerryCTL is a disk and processor device emulation subsystem originally written
23130f4520SKenneth D. Merryfor Copan Systems under Linux starting in 2003.  It has been shipping in
24130f4520SKenneth D. MerryCopan (now SGI) products since 2005.
25130f4520SKenneth D. Merry
26130f4520SKenneth D. MerryIt was ported to FreeBSD in 2008, and thanks to an agreement between SGI
27130f4520SKenneth D. Merry(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is
28130f4520SKenneth D. Merryavailable under a BSD-style license.  The intent behind the agreement was
29130f4520SKenneth D. Merrythat Spectra would work to get CTL into the FreeBSD tree.
30130f4520SKenneth D. Merry
31130f4520SKenneth D. MerryFeatures:
32130f4520SKenneth D. Merry========
33130f4520SKenneth D. Merry
34130f4520SKenneth D. Merry - Disk and processor device emulation.
35130f4520SKenneth D. Merry - Tagged queueing
36130f4520SKenneth D. Merry - SCSI task attribute support (ordered, head of queue, simple tags)
37130f4520SKenneth D. Merry - SCSI implicit command ordering support.  (e.g. if a read follows a mode
38130f4520SKenneth D. Merry   select, the read will be blocked until the mode select completes.)
39130f4520SKenneth D. Merry - Full task management support (abort, LUN reset, target reset, etc.)
40130f4520SKenneth D. Merry - Support for multiple ports
41130f4520SKenneth D. Merry - Support for multiple simultaneous initiators
42130f4520SKenneth D. Merry - Support for multiple simultaneous backing stores
43*d36c6176SAlexander Motin - Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME and
44*d36c6176SAlexander Motin   UNMAP commands
45*d36c6176SAlexander Motin - Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME
46*d36c6176SAlexander Motin   and UNMAP commands
47130f4520SKenneth D. Merry - Persistent reservation support
48130f4520SKenneth D. Merry - Mode sense/select support
49130f4520SKenneth D. Merry - Error injection support
50*d36c6176SAlexander Motin - High Availability clustering support with ALUA
51130f4520SKenneth D. Merry - All I/O handled in-kernel, no userland context switch overhead.
52130f4520SKenneth D. Merry
53130f4520SKenneth D. MerryConfiguring and Running CTL:
54130f4520SKenneth D. Merry===========================
55130f4520SKenneth D. Merry
56*d36c6176SAlexander Motin - Add 'device ctl' to your kernel configuration file or load the module.
57130f4520SKenneth D. Merry
58130f4520SKenneth D. Merry - If you're running with a 8Gb or 4Gb Qlogic FC board, add
59*d36c6176SAlexander Motin   'options ISP_TARGET_MODE' to your kernel config file. 'device ispfw' or
60*d36c6176SAlexander Motin   loading the ispfw module is also recommended.
61130f4520SKenneth D. Merry
62130f4520SKenneth D. Merry - Rebuild and install a new kernel.
63130f4520SKenneth D. Merry
64130f4520SKenneth D. Merry - Reboot with the new kernel.
65130f4520SKenneth D. Merry
66130f4520SKenneth D. Merry - To add a LUN with the RAM disk backend:
67130f4520SKenneth D. Merry
68130f4520SKenneth D. Merry	ctladm create -b ramdisk -s 10485760000000000000
69130f4520SKenneth D. Merry	ctladm port -o on
70130f4520SKenneth D. Merry
71130f4520SKenneth D. Merry - You should now see the CTL disk LUN through camcontrol devlist:
72130f4520SKenneth D. Merry
73130f4520SKenneth D. Merryscbus6 on ctl2cam0 bus 0:
74130f4520SKenneth D. Merry<FREEBSD CTLDISK 0001>             at scbus6 target 1 lun 0 (da24,pass32)
75130f4520SKenneth D. Merry<>                                 at scbus6 target -1 lun -1 ()
76130f4520SKenneth D. Merry
77130f4520SKenneth D. Merry   This is visible through the CTL CAM SIM.  This allows using CTL without
78130f4520SKenneth D. Merry   any physical hardware.  You should be able to issue any normal SCSI
79130f4520SKenneth D. Merry   commands to the device via the pass(4)/da(4) devices.
80130f4520SKenneth D. Merry
81130f4520SKenneth D. Merry   If any target-capable HBAs are in the system (e.g. isp(4)), and have
82130f4520SKenneth D. Merry   target mode enabled, you should now also be able to see the CTL LUNs via
83130f4520SKenneth D. Merry   that target interface.
84130f4520SKenneth D. Merry
85130f4520SKenneth D. Merry   Note that all CTL LUNs are presented to all frontends.  There is no
86130f4520SKenneth D. Merry   LUN masking, or separate, per-port configuration.
87130f4520SKenneth D. Merry
88130f4520SKenneth D. Merry - Note that the ramdisk backend is a "fake" ramdisk.  That is, it is
89130f4520SKenneth D. Merry   backed by a small amount of RAM that is used for all I/O requests.  This
90130f4520SKenneth D. Merry   is useful for performance testing, but not for any data integrity tests.
91130f4520SKenneth D. Merry
92130f4520SKenneth D. Merry - To add a LUN with the block/file backend:
93130f4520SKenneth D. Merry
94130f4520SKenneth D. Merry	truncate -s +1T myfile
95130f4520SKenneth D. Merry	ctladm create -b block -o file=myfile
96130f4520SKenneth D. Merry	ctladm port -o on
97130f4520SKenneth D. Merry
98130f4520SKenneth D. Merry - You can also see a list of LUNs and their backends like this:
99130f4520SKenneth D. Merry
100130f4520SKenneth D. Merry# ctladm devlist
101130f4520SKenneth D. MerryLUN Backend       Size (Blocks)   BS Serial Number    Device ID
102130f4520SKenneth D. Merry  0 block            2147483648  512 MYSERIAL   0     MYDEVID   0
103130f4520SKenneth D. Merry  1 block            2147483648  512 MYSERIAL   1     MYDEVID   1
104130f4520SKenneth D. Merry  2 block            2147483648  512 MYSERIAL   2     MYDEVID   2
105130f4520SKenneth D. Merry  3 block            2147483648  512 MYSERIAL   3     MYDEVID   3
106130f4520SKenneth D. Merry  4 block            2147483648  512 MYSERIAL   4     MYDEVID   4
107130f4520SKenneth D. Merry  5 block            2147483648  512 MYSERIAL   5     MYDEVID   5
108130f4520SKenneth D. Merry  6 block            2147483648  512 MYSERIAL   6     MYDEVID   6
109130f4520SKenneth D. Merry  7 block            2147483648  512 MYSERIAL   7     MYDEVID   7
110130f4520SKenneth D. Merry  8 block            2147483648  512 MYSERIAL   8     MYDEVID   8
111130f4520SKenneth D. Merry  9 block            2147483648  512 MYSERIAL   9     MYDEVID   9
112130f4520SKenneth D. Merry 10 block            2147483648  512 MYSERIAL  10     MYDEVID  10
113130f4520SKenneth D. Merry 11 block            2147483648  512 MYSERIAL  11     MYDEVID  11
114130f4520SKenneth D. Merry
115130f4520SKenneth D. Merry - You can see the LUN type and backing store for block/file backend LUNs
116130f4520SKenneth D. Merry   like this:
117130f4520SKenneth D. Merry
118130f4520SKenneth D. Merry# ctladm devlist -v
119130f4520SKenneth D. MerryLUN Backend       Size (Blocks)   BS Serial Number    Device ID
120130f4520SKenneth D. Merry  0 block            2147483648  512 MYSERIAL   0     MYDEVID   0
121130f4520SKenneth D. Merry      lun_type=0
122130f4520SKenneth D. Merry      num_threads=14
123130f4520SKenneth D. Merry      file=testdisk0
124130f4520SKenneth D. Merry  1 block            2147483648  512 MYSERIAL   1     MYDEVID   1
125130f4520SKenneth D. Merry      lun_type=0
126130f4520SKenneth D. Merry      num_threads=14
127130f4520SKenneth D. Merry      file=testdisk1
128130f4520SKenneth D. Merry  2 block            2147483648  512 MYSERIAL   2     MYDEVID   2
129130f4520SKenneth D. Merry      lun_type=0
130130f4520SKenneth D. Merry      num_threads=14
131130f4520SKenneth D. Merry      file=testdisk2
132130f4520SKenneth D. Merry  3 block            2147483648  512 MYSERIAL   3     MYDEVID   3
133130f4520SKenneth D. Merry      lun_type=0
134130f4520SKenneth D. Merry      num_threads=14
135130f4520SKenneth D. Merry      file=testdisk3
136130f4520SKenneth D. Merry  4 block            2147483648  512 MYSERIAL   4     MYDEVID   4
137130f4520SKenneth D. Merry      lun_type=0
138130f4520SKenneth D. Merry      num_threads=14
139130f4520SKenneth D. Merry      file=testdisk4
140130f4520SKenneth D. Merry  5 block            2147483648  512 MYSERIAL   5     MYDEVID   5
141130f4520SKenneth D. Merry      lun_type=0
142130f4520SKenneth D. Merry      num_threads=14
143130f4520SKenneth D. Merry      file=testdisk5
144130f4520SKenneth D. Merry  6 block            2147483648  512 MYSERIAL   6     MYDEVID   6
145130f4520SKenneth D. Merry      lun_type=0
146130f4520SKenneth D. Merry      num_threads=14
147130f4520SKenneth D. Merry      file=testdisk6
148130f4520SKenneth D. Merry  7 block            2147483648  512 MYSERIAL   7     MYDEVID   7
149130f4520SKenneth D. Merry      lun_type=0
150130f4520SKenneth D. Merry      num_threads=14
151130f4520SKenneth D. Merry      file=testdisk7
152130f4520SKenneth D. Merry  8 block            2147483648  512 MYSERIAL   8     MYDEVID   8
153130f4520SKenneth D. Merry      lun_type=0
154130f4520SKenneth D. Merry      num_threads=14
155130f4520SKenneth D. Merry      file=testdisk8
156130f4520SKenneth D. Merry  9 block            2147483648  512 MYSERIAL   9     MYDEVID   9
157130f4520SKenneth D. Merry      lun_type=0
158130f4520SKenneth D. Merry      num_threads=14
159130f4520SKenneth D. Merry      file=testdisk9
160130f4520SKenneth D. Merry 10 ramdisk                   0    0 MYSERIAL   0     MYDEVID   0
161130f4520SKenneth D. Merry      lun_type=3
162130f4520SKenneth D. Merry 11 ramdisk     204800000000000  512 MYSERIAL   1     MYDEVID   1
163130f4520SKenneth D. Merry      lun_type=0
164130f4520SKenneth D. Merry
165130f4520SKenneth D. Merry
166130f4520SKenneth D. MerryRevision 1.4 Changes
167130f4520SKenneth D. Merry====================
168130f4520SKenneth D. Merry - Added in the second HA mode (where CTL does the data transfers instead
169130f4520SKenneth D. Merry   of having data transfers done below CTL), and abstracted out the Copan
170130f4520SKenneth D. Merry   HA API.
171130f4520SKenneth D. Merry
172130f4520SKenneth D. Merry - Fixed the phantom device problem in the CTL CAM SIM and improved the
173130f4520SKenneth D. Merry   CAM SIM to automatically trigger a rescan when the port is enabled and
174130f4520SKenneth D. Merry   disabled.
175130f4520SKenneth D. Merry
176130f4520SKenneth D. Merry - Made the number of threads in the block backend configurable via sysctl,
177130f4520SKenneth D. Merry   loader tunable and the ctladm command line.  (You can now specify
178130f4520SKenneth D. Merry   -o num_threads=4 when creating a LUN with ctladm create.)
179130f4520SKenneth D. Merry
180130f4520SKenneth D. Merry - Fixed some LUN selection issues in ctlstat(8) and allowed for selection
181130f4520SKenneth D. Merry   of LUN numbers up to 1023.
182130f4520SKenneth D. Merry
183130f4520SKenneth D. Merry - General cleanup.
184130f4520SKenneth D. Merry
185130f4520SKenneth D. Merry - This version intended for public release.
186130f4520SKenneth D. Merry
187130f4520SKenneth D. MerryRevision 1.3 Changes
188130f4520SKenneth D. Merry====================
189130f4520SKenneth D. Merry - Added descriptor sense support to CTL.  It can be enabled through the
190130f4520SKenneth D. Merry   control mode page (10), but is disabled by default.
191130f4520SKenneth D. Merry
192130f4520SKenneth D. Merry - Improved error injection support.  The number of errors that can be
193130f4520SKenneth D. Merry   injected with 'ctladm inject' has been increased, and any arbitrary
194130f4520SKenneth D. Merry   sense data may now be injected as well.
195130f4520SKenneth D. Merry
196130f4520SKenneth D. Merry - The port infrastructure has been revamped.  Individual ports and types
197130f4520SKenneth D. Merry   of ports may now be enabled and disabled from the command line.  ctladm
198130f4520SKenneth D. Merry   now has the ability to set the WWNN and WWPN for each port.
199130f4520SKenneth D. Merry
200130f4520SKenneth D. Merry - The block backend can now send multiple I/Os to backing files.  Multiple
201130f4520SKenneth D. Merry   writes are only allowed for ZFS, but multiple readers are allowed for
202130f4520SKenneth D. Merry   any filesystem.
203130f4520SKenneth D. Merry
204130f4520SKenneth D. Merry - The block and ramdisk backends now support setting the LUN blocksize.
205130f4520SKenneth D. Merry   There are some restrictions when the backing device is a block device,
206130f4520SKenneth D. Merry   but otherwise the blocksize may be set to anything.
207130f4520SKenneth D. Merry
208130f4520SKenneth D. MerryRevision 1.2 Changes
209130f4520SKenneth D. Merry====================
210130f4520SKenneth D. Merry
211130f4520SKenneth D. Merry - CTL initialization process has been revamped.  Instead of using an
212130f4520SKenneth D. Merry   ad-hoc method, it is now sequenced through SYSINIT() calls.
213130f4520SKenneth D. Merry
214130f4520SKenneth D. Merry - A block/file backend has been added.  This allows using arbitrary files
215130f4520SKenneth D. Merry   or block devices as a backing store.
216130f4520SKenneth D. Merry
217130f4520SKenneth D. Merry - The userland LUN configuration interface has been completely rewritten.
218130f4520SKenneth D. Merry   Configuration is now done out of band.
219130f4520SKenneth D. Merry
220130f4520SKenneth D. Merry - The ctladm(8) command line interface has been revamped, and is now
221130f4520SKenneth D. Merry   similar to camcontrol(8).
222130f4520SKenneth D. Merry
223130f4520SKenneth D. MerryTo Do List:
224130f4520SKenneth D. Merry==========
225130f4520SKenneth D. Merry
226130f4520SKenneth D. Merry - Use devstat(9) for CTL's statistics collection.  CTL uses a home-grown
227130f4520SKenneth D. Merry   statistics collection system that is similar to devstat(9).  ctlstat
228130f4520SKenneth D. Merry   should be retired in favor of iostat, etc., once aggregation modes are
229130f4520SKenneth D. Merry   available in iostat to match the behavior of ctlstat -t and dump modes
230130f4520SKenneth D. Merry   are available to match the behavior of ctlstat -d/ctlstat -J.
231130f4520SKenneth D. Merry
232130f4520SKenneth D. Merry - ZFS ARC backend for CTL.  Since ZFS copies all I/O into the ARC
233130f4520SKenneth D. Merry   (Adaptive Replacement Cache), running the block/file backend on top of a
234130f4520SKenneth D. Merry   ZFS-backed zdev or file will involve an extra set of copies.  The
235130f4520SKenneth D. Merry   optimal solution for backing targets served by CTL with ZFS would be to
236130f4520SKenneth D. Merry   allocate buffers out of the ARC directly, and DMA to/from them directly.
237130f4520SKenneth D. Merry   That would eliminate an extra data buffer allocation and copy.
238130f4520SKenneth D. Merry
239130f4520SKenneth D. Merry - Switch CTL over to using CAM CCBs instead of its own union ctl_io.  This
240130f4520SKenneth D. Merry   will likely require a significant amount of work, but will eliminate
241130f4520SKenneth D. Merry   another data structure in the stack, more memory allocations, etc.  This
242130f4520SKenneth D. Merry   will also require changes to the CAM CCB structure to support CTL.
243130f4520SKenneth D. Merry
244130f4520SKenneth D. MerryCode Roadmap:
245130f4520SKenneth D. Merry============
246130f4520SKenneth D. Merry
247130f4520SKenneth D. MerryCTL has the concept of pluggable frontend ports and backends.  All
248130f4520SKenneth D. Merryfrontends and backends can be active at the same time.  You can have a
249130f4520SKenneth D. Merryramdisk-backed LUN present along side a file backed LUN.
250130f4520SKenneth D. Merry
251130f4520SKenneth D. Merryctl.c:
252130f4520SKenneth D. Merry-----
253130f4520SKenneth D. Merry
254130f4520SKenneth D. MerryThis is the core of CTL, where all of the command handlers and a lot of
255130f4520SKenneth D. Merryother things live.  Yes, it is large.  It started off small and grew to its
256130f4520SKenneth D. Merrycurrent size over time.  Perhaps it can be split into more files at some
257130f4520SKenneth D. Merrypoint.
258130f4520SKenneth D. Merry
259130f4520SKenneth D. MerryHere is a roadmap of some of the primary functions in ctl.c.  Starting here
260130f4520SKenneth D. Merryand following the various leaf functions will show the command flow.
261130f4520SKenneth D. Merry
262130f4520SKenneth D. Merryctl_queue() 		This is where commands from the frontend ports come
263130f4520SKenneth D. Merry			in.
264130f4520SKenneth D. Merry
265130f4520SKenneth D. Merryctl_queue_sense()	This is only used for non-packetized SCSI.  i.e.
266130f4520SKenneth D. Merry			parallel SCSI prior to U320 and perhaps U160.
267130f4520SKenneth D. Merry
268130f4520SKenneth D. Merryctl_work_thread() 	This is the primary work thread, and everything gets
269130f4520SKenneth D. Merry			executed from there.
270130f4520SKenneth D. Merry
271130f4520SKenneth D. Merryctl_scsiio_precheck() 	This where all of the initial checks are done, and I/O
272130f4520SKenneth D. Merry			is either queued for execution or blocked.
273130f4520SKenneth D. Merry
274130f4520SKenneth D. Merryctl_scsiio() 		This is where the command handler is actually
275130f4520SKenneth D. Merry			executed.  (See ctl_cmd_table.c for the mapping of
276130f4520SKenneth D. Merry			SCSI opcode to command handler function.)
277130f4520SKenneth D. Merry
278130f4520SKenneth D. Merryctl_done()		This is the routine called (or ctl_done_lock()) to
279130f4520SKenneth D. Merry			initiate the command completion process.
280130f4520SKenneth D. Merry
281130f4520SKenneth D. Merryctl_process_done()	This is where command completion actually happens.
282130f4520SKenneth D. Merry
283130f4520SKenneth D. Merryctl.h:
284130f4520SKenneth D. Merry-----
285130f4520SKenneth D. Merry
286130f4520SKenneth D. MerryBasic function declarations and data structures.
287130f4520SKenneth D. Merry
288130f4520SKenneth D. Merryctl_backend.c,
289130f4520SKenneth D. Merryctl_backend.h:
290130f4520SKenneth D. Merry-------------
291130f4520SKenneth D. Merry
292130f4520SKenneth D. MerryThese files define the basic CTL backend API.  The comments in the header
293130f4520SKenneth D. Merryexplain the API.
294130f4520SKenneth D. Merry
295130f4520SKenneth D. Merryctl_backend_block.c
296130f4520SKenneth D. Merry-------------------
297130f4520SKenneth D. Merry
298130f4520SKenneth D. MerryThe block and file backend.  This allows for using a disk or a file as the
299130f4520SKenneth D. Merrybacking store for a LUN.  Multiple threads are started to do I/O to the
300130f4520SKenneth D. Merrybacking device, primarily because the VFS API requires that to get any
301130f4520SKenneth D. Merryconcurrency.
302130f4520SKenneth D. Merry
303130f4520SKenneth D. Merryctl_backend_ramdisk.c:
304130f4520SKenneth D. Merry---------------------
305130f4520SKenneth D. Merry
306130f4520SKenneth D. MerryA "fake" ramdisk backend.  It only allocates a small amount of memory to
307130f4520SKenneth D. Merryact as a source and sink for reads and writes from an initiator.  Therefore
308130f4520SKenneth D. Merryit cannot be used for any real data, but it can be used to test for
309130f4520SKenneth D. Merrythroughput.  It can also be used to test initiators' support for extremely
310130f4520SKenneth D. Merrylarge LUNs.
311130f4520SKenneth D. Merry
312130f4520SKenneth D. Merryctl_cmd_table.c:
313130f4520SKenneth D. Merry---------------
314130f4520SKenneth D. Merry
315130f4520SKenneth D. MerryThis is a table with all 256 possible SCSI opcodes, and command handler
316130f4520SKenneth D. Merryfunctions defined for supported opcodes.  It is included in ctl.c.
317130f4520SKenneth D. Merry
318130f4520SKenneth D. Merryctl_debug.h:
319130f4520SKenneth D. Merry-----------
320130f4520SKenneth D. Merry
321130f4520SKenneth D. MerrySimplistic debugging support.
322130f4520SKenneth D. Merry
323130f4520SKenneth D. Merryctl_error.c,
324130f4520SKenneth D. Merryctl_error.h:
325130f4520SKenneth D. Merry-----------
326130f4520SKenneth D. Merry
327130f4520SKenneth D. MerryCTL-specific wrappers around the CAM sense building functions.
328130f4520SKenneth D. Merry
329130f4520SKenneth D. Merryctl_frontend.c,
330130f4520SKenneth D. Merryctl_frontend.h:
331130f4520SKenneth D. Merry--------------
332130f4520SKenneth D. Merry
333130f4520SKenneth D. MerryThese files define the basic CTL frontend port API.  The comments in the
334130f4520SKenneth D. Merryheader explain the API.
335130f4520SKenneth D. Merry
336130f4520SKenneth D. Merryctl_frontend_cam_sim.c:
337130f4520SKenneth D. Merry----------------------
338130f4520SKenneth D. Merry
339130f4520SKenneth D. MerryThis is a CTL frontend port that is also a CAM SIM.  The idea is that this
340130f4520SKenneth D. Merryfrontend allows for using CTL without any target-capable hardware.  So any
341130f4520SKenneth D. MerryLUNs you create in CTL are visible via this port.
342130f4520SKenneth D. Merry
3437ac58230SAlexander Motinctl_ha.c:
344130f4520SKenneth D. Merryctl_ha.h:
345130f4520SKenneth D. Merry--------
346130f4520SKenneth D. Merry
3477ac58230SAlexander MotinThis is a High Availability API and TCP-based interlink implementation.
348130f4520SKenneth D. Merry
349130f4520SKenneth D. Merryctl_io.h:
350130f4520SKenneth D. Merry--------
351130f4520SKenneth D. Merry
352130f4520SKenneth D. MerryThis defines most of the core CTL I/O structures.  union ctl_io is
353130f4520SKenneth D. Merryconceptually very similar to CAM's union ccb.
354130f4520SKenneth D. Merry
355130f4520SKenneth D. Merryctl_ioctl.h:
356130f4520SKenneth D. Merry-----------
357130f4520SKenneth D. Merry
358130f4520SKenneth D. MerryThis defines all ioctls available through the CTL character device, and
359130f4520SKenneth D. Merrythe data structures needed for those ioctls.
360130f4520SKenneth D. Merry
361130f4520SKenneth D. Merryctl_private.h:
362130f4520SKenneth D. Merry-------------
363130f4520SKenneth D. Merry
364130f4520SKenneth D. MerryPrivate data structres (e.g. CTL softc) and function prototypes.  This also
365130f4520SKenneth D. Merryincludes the SCSI vendor and product names used by CTL.
366130f4520SKenneth D. Merry
367130f4520SKenneth D. Merryctl_scsi_all.c
368130f4520SKenneth D. Merryctl_scsi_all.h:
369130f4520SKenneth D. Merry--------------
370130f4520SKenneth D. Merry
371130f4520SKenneth D. MerryCTL wrappers around CAM sense printing functions.
372130f4520SKenneth D. Merry
373130f4520SKenneth D. Merryctl_ser_table.c:
374130f4520SKenneth D. Merry---------------
375130f4520SKenneth D. Merry
376130f4520SKenneth D. MerryCommand serialization table.  This defines what happens when one type of
377130f4520SKenneth D. Merrycommand is followed by another type of command.  e.g., what do you do when
378130f4520SKenneth D. Merryyou have a mode select followed by a write?  You block the write until the
379130f4520SKenneth D. Merrymode select is complete.  That is defined in this table.
380130f4520SKenneth D. Merry
381130f4520SKenneth D. Merryctl_util.c
382130f4520SKenneth D. Merryctl_util.h:
383130f4520SKenneth D. Merry----------
384130f4520SKenneth D. Merry
385130f4520SKenneth D. MerryCTL utility functions, primarily designed to be used from userland.  See
386130f4520SKenneth D. Merryctladm for the primary consumer of these functions.  These include CDB
387130f4520SKenneth D. Merrybuilding functions.
388130f4520SKenneth D. Merry
389130f4520SKenneth D. Merryscsi_ctl.c:
390130f4520SKenneth D. Merry----------
391130f4520SKenneth D. Merry
392130f4520SKenneth D. MerryCAM target peripheral driver and CTL frontend port.  This is the path into
393130f4520SKenneth D. MerryCTL for commands from target-capable hardware/SIMs.
394130f4520SKenneth D. Merry
395130f4520SKenneth D. MerryUserland Commands:
396130f4520SKenneth D. Merry=================
397130f4520SKenneth D. Merry
398130f4520SKenneth D. Merryctladm(8) fills a role similar to camcontrol(8).  It allow configuring LUNs,
399130f4520SKenneth D. Merryissuing commands, injecting errors and various other control functions.
400130f4520SKenneth D. Merry
401130f4520SKenneth D. Merryctlstat(8) fills a role similar to iostat(8).  It reports I/O statistics
402130f4520SKenneth D. Merryfor CTL.
403