xref: /freebsd/sbin/camcontrol/camcontrol.8 (revision b601c69bdbe8755d26570261d7fd4c02ee4eff74)
1.\"
2.\" Copyright (c) 1998, 1999, 2000 Kenneth D. Merry.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. The name of the author may not be used to endorse or promote products
14.\"    derived from this software without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" $FreeBSD$
29.\"
30.Dd September 14, 1998
31.Dt CAMCONTROL 8
32.Os
33.Sh NAME
34.Nm camcontrol
35.Nd CAM control program
36.Sh SYNOPSIS
37.Nm camcontrol
38.Aq Ar command
39.Op device id
40.Op generic args
41.Op command args
42.Nm camcontrol
43.Ic devlist
44.Op Fl v
45.Nm camcontrol
46.Ic periphlist
47.Op device id
48.Op Fl n Ar dev_name
49.Op Fl u Ar unit_number
50.Nm camcontrol
51.Ic tur
52.Op device id
53.Op generic args
54.Nm camcontrol
55.Ic inquiry
56.Op device id
57.Op generic args
58.Op Fl D
59.Op Fl S
60.Op Fl R
61.Nm camcontrol
62.Ic start
63.Op device id
64.Op generic args
65.Nm camcontrol
66.Ic stop
67.Op device id
68.Op generic args
69.Nm camcontrol
70.Ic eject
71.Op device id
72.Op generic args
73.Nm camcontrol
74.Ic rescan
75.Aq bus Ns Op :target:lun
76.Nm camcontrol
77.Ic reset
78.Aq bus Ns Op :target:lun
79.Nm camcontrol
80.Ic defects
81.Op device id
82.Op generic args
83.Aq Fl f Ar format
84.Op Fl P
85.Op Fl G
86.Nm camcontrol
87.Ic modepage
88.Op device id
89.Op generic args
90.Aq Fl m Ar page
91.Op Fl P Ar pgctl
92.Op Fl e
93.Op Fl d
94.Nm camcontrol
95.Ic cmd
96.Op device id
97.Op generic args
98.Aq Fl c Ar cmd Op args
99.Op Fl i Ar len Ar fmt
100.Bk -words
101.Op Fl o Ar len Ar fmt Op args
102.Ek
103.Nm camcontrol
104.Ic debug
105.Op Fl I
106.Op Fl T
107.Op Fl S
108.Op Fl c
109.Aq all|off|bus Ns Op :target Ns Op :lun
110.Nm camcontrol
111.Ic tags
112.Op device id
113.Op generic args
114.Op Fl N Ar tags
115.Op Fl q
116.Op Fl v
117.Nm camcontrol
118.Ic negotiate
119.Op device id
120.Op generic args
121.Op Fl c
122.Op Fl D Ar enable|disable
123.Op Fl O Ar offset
124.Op Fl q
125.Op Fl R Ar syncrate
126.Op Fl T Ar enable|disable
127.Op Fl U
128.Op Fl W Ar bus_width
129.Op Fl v
130.Nm camcontrol
131.Ic format
132.Op device id
133.Op generic args
134.Op Fl q
135.Op Fl w
136.Op Fl y
137.Nm camcontrol
138.Ic help
139.Sh DESCRIPTION
140.Nm camcontrol
141is a utility designed to provide a way for users to access and control the
142.Fx
143CAM subsystem.
144.Pp
145.Nm camcontrol
146can cause a loss of data and/or system crashes if used improperly.  Even
147expert users are encouraged to exercise caution when using this command.
148Novice users should stay away from this utility.
149.Pp
150.Nm camcontrol
151has a number of primary functions, many of which support an optional
152device identifier.  A device identifier can take one of three forms:
153.Bl -tag -width 01234567890123
154.It deviceUNIT
155Specify a device name and unit number combination, like "da5" or "cd3".
156Note that character device node names (e.g. /dev/rsd0.ctl) are
157.Em not
158allowed here.
159.It bus:target
160Specify a bus number and target id.  The bus number can be determined from
161the output of
162.Dq camcontrol devlist .
163The lun defaults to 0.
164.It bus:target:lun
165Specify the bus, target and lun for a device.  (e.g. 1:2:0)
166.El
167.Pp
168The device identifier, if it is specified,
169.Em must
170come immediately after the function name, and before any generic or
171function-specific arguments.  Note that the
172.Fl n
173and
174.Fl u
175arguments described below will override any device name or unit number
176specified beforehand.  The
177.Fl n
178and
179.Fl u
180arguments will
181.Em not
182override a specified bus:target or bus:target:lun, however.
183.Pp
184Most of the
185.Nm camcontrol
186primary functions support these generic arguments:
187.Bl -tag -width 01234567890123
188.It Fl C Ar count
189SCSI command retry count.  In order for this to work, error recovery
190.Po
191.Fl E
192.Pc
193must be turned on.
194.It Fl E
195Instruct the kernel to perform generic SCSI error recovery for the given
196command.  This is needed in order for the retry count
197.Po
198.Fl C
199.Pc
200to be honored.  Other than retrying commands, the generic error recovery in
201the code will generally attempt to spin up drives that are not spinning.
202It may take some other actions, depending upon the sense code returned from
203the command.
204.It Fl n Ar dev_name
205Specify the device type to operate on, e.g. "da", "cd".
206.It Fl t Ar timeout
207SCSI command timeout in seconds.  This overrides the default timeout for
208any given command.
209.It Fl u Ar unit_number
210Specify the device unit number, e.g. "1", "5".
211.It Fl v
212Be verbose, print out sense information for failed SCSI commands.
213.El
214.Pp
215Primary command functions:
216.Bl -tag -width periphlist
217.It Ic devlist
218List all physical devices (logical units) attached to the CAM subsystem.
219This also includes a list of peripheral drivers attached to each device.
220With the
221.Fl v
222argument, SCSI bus number, adapter name and unit numbers are printed as
223well.
224.It Ic periphlist
225List all peripheral drivers attached to a given physical device (logical
226unit).
227.It Ic tur
228Send the SCSI test unit ready (0x00) command to the given device.
229.Nm camcontrol
230will report whether the device is ready or not.
231.It Ic inquiry
232Send a SCSI inquiry command (0x12) to a device.  By default,
233.Nm camcontrol
234will print out the standard inquiry data, device serial number, and
235transfer rate information.  The user can specify that only certain types of
236inquiry data be printed:
237.Bl -tag -width 1234
238.It Fl D
239Get the standard inquiry data.
240.It Fl S
241Print out the serial number.  If this flag is the only one specified,
242.Nm camcontrol
243will not print out "Serial Number" before the value returned by the drive.
244This is to aid in script writing.
245.It Fl R
246Print out transfer rate information.
247.El
248.It Ic start
249Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
250start bit set.
251.It Ic stop
252Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
253start bit cleared.
254.It Ic eject
255Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
256start bit cleared and the eject bit set.
257.It Ic rescan
258Tell the kernel to scan the given bus (XPT_SCAN_BUS), or bus:target:lun
259(XPT_SCAN_LUN) for new devices or devices that have gone away.  The user
260may only specify a bus to scan, or a lun.  Scanning all luns on a target
261isn't supported.
262.It Ic reset
263Tell the kernel to reset the given bus (XPT_RESET_BUS) by issuing a SCSI bus
264reset for that bus, or to reset the given bus:target:lun
265(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after
266connecting to that device.
267Note that this can have a destructive impact
268on the system.
269.It Ic defects
270Send the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and
271print out any combination of: the total number of defects, the primary
272defect list (PLIST), and the grown defect list (GLIST).
273.Bl -tag -width 01234567890
274.It Fl f Ar format
275The three format options are:
276.Em block ,
277to print out the list as logical blocks,
278.Em bfi ,
279to print out the list in bytes from index format, and
280.Em phys ,
281to print out the list in physical sector format.  The format argument is
282required.  Most drives support the physical sector format.  Some drives
283support the logical block format.  Many drives, if they don't support the
284requested format, return the data in an alternate format, along with sense
285information indicating that the requested data format isn't supported.
286.Nm camcontrol
287attempts to detect this, and print out whatever format the drive returns.
288If the drive uses a non-standard sense code to report that it doesn't
289support the requested format,
290.Nm camcontrol
291will probably see the error as a failure to complete the request.
292.It Fl G
293Print out the grown defect list.  This is a list of bad blocks that have
294been remapped since the disk left the factory.
295.It Fl P
296Print out the primary defect list.
297.El
298.Pp
299If neither
300.Fl P
301nor
302.Fl G
303is specified,
304.Nm camcontrol
305will print out the number of defects given in the READ DEFECT DATA header
306returned from the drive.
307.It Ic modepage
308Allows the user to display and optionally edit a SCSI mode page.  The mode
309page formats are located in
310.Pa /usr/share/misc/scsi_modes .
311This can be overridden by specifying a different file in the
312.Ev SCSI_MODES
313environment variable.
314The
315.Ic modepage
316command takes several arguments:
317.Bl -tag -width 012345678901
318.It Fl d
319Disable block descriptors for mode sense.
320.It Fl e
321This flag allows the user to edit values in the mode page.
322.It Fl m Ar mode_page
323This specifies the number of the mode page the user would like to view
324and/or edit.  This argument is mandatory.
325.It Fl P Ar pgctl
326This allows the user to specify the page control field.  Possible values are:
327.Bl -tag -width xxx -compact
328.It 0
329Current values
330.It 1
331Changeable values
332.It 2
333Default values
334.It 3
335Saved values
336.El
337.El
338.It Ic cmd
339Allows the user to send an arbitrary SCSI CDB to any device.
340The
341.Ic cmd
342function requires the
343.Fl c
344argument to specify the CDB.  Other arguments are optional, depending on
345the command type.  The command and data specification syntax is documented
346in
347.Xr cam_cdbparse 3 .
348NOTE:  If the CDB specified causes data to be transfered to or from the
349SCSI device in question, you MUST specify either
350.Fl i
351or
352.Fl o .
353.Bl -tag -width 01234567890123456
354.It Fl c Ar cmd Op args
355This specifies the SCSI CDB.  CDBs may be 6, 10, 12 or 16 bytes.
356.It Fl i Ar len Ar fmt
357This specifies the amount of data to read, and how it should be displayed.
358If the format is
359.Sq - ,
360.Ar len
361bytes of data will be read from the device and written to standard output.
362.It Fl o Ar len Ar fmt Op args
363This specifies the amount of data to be written to a device, and the data
364that is to be written.  If the format is
365.Sq - ,
366.Ar len
367bytes of data will be read from standard input and written to the device.
368.El
369.It Ic debug
370Turn on CAM debugging printfs in the kernel.  This requires options CAMDEBUG
371in your kernel config file.  WARNING:  enabling debugging printfs currently
372causes an EXTREME number of kernel printfs.  You may have difficulty
373turning off the debugging printfs once they start, since the kernel will be
374busy printing messages and unable to service other requests quickly.
375The
376.Ic debug
377function takes a number of arguments:
378.Bl -tag -width 012345678901234567
379.It Fl I
380Enable CAM_DEBUG_INFO printfs.
381.It Fl T
382Enable CAM_DEBUG_TRACE printfs.
383.It Fl S
384Enable CAM_DEBUG_SUBTRACE printfs.
385.It Fl c
386Enable CAM_DEBUG_CDB printfs.  This will cause the kernel to print out the
387SCSI CDBs sent to the specified device(s).
388.It all
389Enable debugging for all devices.
390.It off
391Turn off debugging for all devices
392.It bus Ns Op :target Ns Op :lun
393Turn on debugging for the given bus, target or lun.  If the lun or target
394and lun are not specified, they are wildcarded.  (i.e., just specifying a
395bus turns on debugging printfs for all devices on that bus.)
396.El
397.It Ic tags
398Show or set the number of "tagged openings" or simultaneous transactions
399we attempt to queue to a particular device.  By default, the
400.Ic tags
401command, with no command-specific arguments (i.e. only generic arguments)
402prints out the "soft" maximum number of transactions that can be queued to
403the device in question.  For more detailed information, use the
404.Fl v
405argument described below.
406.Bl -tag -width 0123456
407.It Fl N Ar tags
408Set the number of tags for the given device.  This must be between the
409minimum and maximum number set in the kernel quirk table.  The default for
410most devices that support tagged queueing is a minimum of 2 and a maximum
411of 255.  The minimum and maximum values for a given device may be
412determined by using the
413.Fl v
414switch.  The meaning of the
415.Fl v
416switch for this
417.Nm camcontrol
418subcommand is described below.
419.It Fl q
420Be quiet, and don't report the number of tags.  This is generally used when
421setting the number of tags.
422.It Fl v
423The verbose flag has special functionality for the
424.Em tags
425argument.  It causes
426.Nm camcontrol
427to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB:
428.Bl -tag -width 0123456789012
429.It dev_openings
430This is the amount of capacity for transactions queued to a given device.
431.It dev_active
432This is the number of transactions currently queued to a device.
433.It devq_openings
434This is the kernel queue space for transactions.  This count usually mirrors
435dev_openings except during error recovery operations when
436the device queue is frozen (device is not allowed to receive
437commands), the number of dev_openings is reduced, or transaction
438replay is occurring.
439.It devq_queued
440This is the number of transactions waiting in the kernel queue for capacity
441on the device.  This number is usually zero unless error recovery is in
442progress.
443.It held
444The held count is the number of CCBs held by peripheral drivers that have
445either just been completed or are about to be released to the transport
446layer for service by a device.  Held CCBs reserve capacity on a given
447device.
448.It mintags
449This is the current "hard" minimum number of transactions that can be
450queued to a device at once.  The
451.Ar dev_openings
452value above cannot go below this number.  The default value for
453.Ar mintags
454is 2, although it may be set higher or lower for various devices.
455.It maxtags
456This is the "hard" maximum number of transactions that can be queued to a
457device at one time.  The
458.Ar dev_openings
459value cannot go above this number.  The default value for
460.Ar maxtags
461is 255, although it may be set higher or lower for various devices.
462.El
463.El
464.It Ic negotiate
465Show or negotiate various communication parameters.  Some controllers may
466not support setting or changing some of these values.  For instance, the
467Adaptec 174x controllers do not support changing a device's sync rate or
468offset.
469.Nm camcontrol
470will not attempt to set the parameter if the controller indicates that it
471does not support setting the parameter.  To find out what the controller
472supports, use the
473.Fl v
474flag.  The meaning of the
475.Fl v
476flag for the
477.Ic negotiate
478command is described below.  Also, some controller drivers don't support
479setting negotiation parameters, even if the underlying controller supports
480negotiation changes.  Some controllers, such as the Advansys wide
481controllers, support enabling and disabling synchronous negotiation for
482a device, but do not support setting the synchronous negotiation rate.
483.Bl -tag -width 01234567890123456
484.It Fl a
485Attempt to make the negotiation settings take effect immediately by sending
486a Test Unit Ready command to the device.
487.It Fl c
488Show or set current negotiation settings.  This is the default.
489.It Fl D Ar enable|disable
490Enable or disable disconnection.
491.It Fl O Ar offset
492Set the command delay offset.
493.It Fl q
494Be quiet, don't print anything.  This is generally useful when you want to
495set a parameter, but don't want any status information.
496.It Fl R Ar syncrate
497Change the synchronization rate for a device.  The sync rate is a floating
498point value specified in MHz.  So, for instance,
499.Sq 20.000
500is a legal value, as is
501.Sq 20 .
502.It Fl T Ar enable|disable
503Enable or disable tagged queueing for a device.
504.It Fl U
505Show or set user negotiation settings.  The default is to show or set
506current negotiation settings.
507.It Fl v
508The verbose switch has special meaning for the
509.Ic negotiate
510subcommand.  It causes
511.Nm camcontrol
512to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the
513controller driver.
514.It Fl W Ar bus_width
515Specify the bus width to negotiate with a device.  The bus width is
516specified in bits.  The only useful values to specify are 8, 16, and 32
517bits.  The controller must support the bus width in question in order for
518the setting to take effect.
519.El
520.Pp
521In general, sync rate and offset settings will not take effect for a
522device until a command has been sent to the device.  The
523.Fl a
524switch above will automatically send a Test Unit Ready to the device so
525negotiation parameters will take effect.
526.It Ic format
527Issue the
528.Tn SCSI
529FORMAT UNIT command to the named device.
530.Pp
531.Em WARNING! WARNING! WARNING!
532.Pp
533Low level formatting a disk will destroy ALL data on the disk.  Use
534extreme caution when issuing this command.  Many users low-level format
535disks that do not really need to be low-level formatted.  There are
536relatively few scenarios that call for low-level formatting a disk.
537One reason for
538low-level formatting a disk is to initialize the disk after changing
539its physical sector size.  Another reason for low-level formatting a disk
540is to revive the disk if you are getting "medium format corrupted" errors
541from the disk in response to read and write requests.
542.Pp
543Some disks take longer than others to format.  Users should specify a
544timeout long enough to allow the format to complete.  The default format
545timeout is 3 hours, which should be long enough for most disks.  Some hard
546disks will complete a format operation in a very short period of time
547(on the order of 5 minutes or less).  This is often because the drive
548doesn't really support the FORMAT UNIT command -- it just accepts the
549command, waits a few minutes and then returns it.
550.Pp
551The
552.Sq format
553subcommand takes several arguments that modify its default behavior.  The
554.Fl q
555and
556.Fl y
557arguments can be useful for scripts.
558.Pp
559.Bl -tag -width 123456
560.It Fl q
561Be quiet, don't print any status messages.  This option will not disable
562the questions, however.  To disable questions, use the
563.Fl y
564argument, below.
565.It Fl w
566Issue a non-immediate format command.  By default,
567.Nm camcontrol
568issues the FORMAT UNIT command with the immediate bit set.  This tells the
569device to immediately return the format command, before the format has
570actually completed.  Then,
571.Nm camcontrol
572gathers
573.Tn SCSI
574sense information from the device every second to determine how far along
575in the format process it is.  If the
576.Fl w
577argument is specified,
578.Nm camcontrol
579will issue a non-immediate format command, and will be unable to print any
580information to let the user know what percentage of the disk has been
581formatted.
582.It Fl y
583Don't ask any questions.  By default,
584.Nm camcontrol
585will ask the user if he/she really wants to format the disk in question,
586and also if the default format command timeout is acceptable.  The user
587will not be asked about the timeout if a timeout is specified on the
588command line.
589.El
590.It Ic help
591Print out verbose usage information.
592.El
593.Sh ENVIRONMENT
594The
595.Ev SCSI_MODES
596variable allows the user to specify an alternate mode page format file.
597.Pp
598The
599.Ev EDITOR
600variable determines which text editor
601.Nm camcontrol
602starts when editing mode pages.
603.Sh FILES
604.Bl -tag -width /usr/share/misc/scsi_modes -compact
605.It Pa /usr/share/misc/scsi_modes
606is the SCSI mode format database.
607.It Pa /dev/xpt0
608is the transport layer device.
609.It Pa /dev/pass*
610are the CAM application passthrough devices.
611.El
612.Sh EXAMPLES
613.Dl camcontrol eject -n cd -u 1 -v
614.Pp
615Eject the CD from cd1, and print SCSI sense information if the command
616fails.
617.Pp
618.Dl camcontrol tur da0
619.Pp
620Send the SCSI test unit ready command to da0.
621.Nm camcontrol
622will report whether the disk is ready, but will not display sense
623information if the command fails since the
624.Fl v
625switch was not specified.
626.Pp
627.Bd -literal -offset indent
628camcontrol tur da1 -E -C 4 -t 50 -v
629.Ed
630.Pp
631Send a test unit ready command to da1.  Enable kernel error recovery.
632Specify a retry count of 4, and a timeout of 50 seconds.  Enable sense
633printing (with the
634.Fl v
635flag) if the command fails.  Since error recovery is turned on, the
636disk will be spun up if it is not currently spinning.
637.Nm camcontrol
638will report whether the disk is ready.
639.Bd -literal -offset indent
640camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e
641	-i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1"
642.Ed
643.Pp
644Issue a READ BUFFER command (0x3C) to cd1.  Display the buffer size of cd1,
645and display the first 10 bytes from the cache on cd1.  Display SCSI sense
646information if the command fails.
647.Pp
648.Bd -literal -offset indent
649camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e
650	-o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8
651.Ed
652.Pp
653Issue a WRITE BUFFER (0x3B) command to cd1.  Write out 10 bytes of data,
654not including the (reserved) 4 byte header.  Print out sense information if
655the command fails.  Be very careful with this command, improper use may
656cause data corruption.
657.Pp
658.Bd -literal -offset indent
659camcontrol modepage da3 -m 1 -e -P 3
660.Ed
661.Pp
662Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the
663settings on the drive.  Mode page 1 contains a disk drive's auto read and
664write reallocation settings, among other things.
665.Pp
666.Dl camcontrol rescan 0
667.Pp
668Rescan SCSI bus 0 for devices that have been added, removed or changed.
669.Pp
670.Dl camcontrol rescan 0:1:0
671.Pp
672Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or
673changed.
674.Pp
675.Dl camcontrol tags da5 -N 24
676.Pp
677Set the number of concurrent transactions for da5 to 24.
678.Pp
679.Bd -literal -offset indent
680camcontrol negotiate -n da -u 4 -T disable
681.Ed
682.Pp
683Disable tagged queueing for da4.
684.Pp
685.Bd -literal -offset indent
686camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a
687.Ed
688.Pp
689Negotiate a sync rate of 20MHz and an offset of 15 with da3.  Then send a
690Test Unit Ready command to make the settings take effect.
691.Sh SEE ALSO
692.Xr cam 3 ,
693.Xr cam_cdbparse 3 ,
694.Xr cam 4 ,
695.Xr pass 4 ,
696.Xr xpt 4
697.Sh HISTORY
698The
699.Nm camcontrol
700command first appeared in
701.Fx 3.0 .
702.Pp
703The mode page editing code and arbitrary SCSI command code are based upon
704code in the old
705.Xr scsi 8
706utility and
707.Xr scsi 3
708library, written by Julian Elischer and Peter Dufault.  The
709.Xr scsi 8
710program first appeared in 386BSD 0.1.2.4, and first appeared in
711.Fx
712in
713.Fx 2.0.5 .
714.Sh AUTHORS
715.An Kenneth Merry Aq ken@FreeBSD.org
716.Sh BUGS
717The code that parses the generic command line arguments doesn't know that
718some of the subcommands take multiple arguments.  So if, for instance, you
719tried something like this:
720.Bd -literal -offset indent
721camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v
722.Ed
723.Pp
724The sense information from the test unit ready command would not get
725printed out, since the first
726.Xr getopt 3
727call in
728.Nm camcontrol
729bails out when it sees the second argument to
730.Fl c
731.Po
7320x00
733.Pc ,
734above.  Fixing this behavior would take some gross code, or changes to the
735.Xr getopt 3
736interface.  The best way to circumvent this problem is to always make sure
737to specify generic
738.Nm camcontrol
739arguments before any command-specific arguments.
740