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