1.\" 2.\" Copyright (c) 1998, 1999, 2000, 2002 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 38.Aq Ar command 39.Op device id 40.Op generic args 41.Op command args 42.Nm 43.Ic devlist 44.Op Fl v 45.Nm 46.Ic periphlist 47.Op device id 48.Op Fl n Ar dev_name 49.Op Fl u Ar unit_number 50.Nm 51.Ic tur 52.Op device id 53.Op generic args 54.Nm 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 62.Ic start 63.Op device id 64.Op generic args 65.Nm 66.Ic stop 67.Op device id 68.Op generic args 69.Nm 70.Ic eject 71.Op device id 72.Op generic args 73.Nm 74.Ic rescan 75.Aq all | bus Ns Op :target:lun 76.Nm 77.Ic reset 78.Aq all | bus Ns Op :target:lun 79.Nm 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 87.Ic modepage 88.Op device id 89.Op generic args 90.Aq Fl m Ar page | Fl l 91.Op Fl P Ar pgctl 92.Op Fl b | Fl e 93.Op Fl d 94.Nm 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 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 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 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 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 138.Ic help 139.Sh DESCRIPTION 140.Nm 141is a utility designed to provide a way for users to access and control the 142.Fx 143CAM subsystem. 144.Pp 145.Nm 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 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 14n 154.It deviceUNIT 155Specify a device name and unit number combination, like "da5" or "cd3". 156Note that character device node names (e.g. /dev/da0) 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 186primary functions support these generic arguments: 187.Bl -tag -width 14n 188.It Fl C Ar count 189SCSI command retry count. In order for this to work, error recovery 190.Pq Fl E 191must be turned on. 192.It Fl E 193Instruct the kernel to perform generic SCSI error recovery for the given 194command. This is needed in order for the retry count 195.Pq Fl C 196to be honored. Other than retrying commands, the generic error recovery in 197the code will generally attempt to spin up drives that are not spinning. 198It may take some other actions, depending upon the sense code returned from 199the command. 200.It Fl n Ar dev_name 201Specify the device type to operate on, e.g. "da", "cd". 202.It Fl t Ar timeout 203SCSI command timeout in seconds. This overrides the default timeout for 204any given command. 205.It Fl u Ar unit_number 206Specify the device unit number, e.g. "1", "5". 207.It Fl v 208Be verbose, print out sense information for failed SCSI commands. 209.El 210.Pp 211Primary command functions: 212.Bl -tag -width periphlist 213.It Ic devlist 214List all physical devices (logical units) attached to the CAM subsystem. 215This also includes a list of peripheral drivers attached to each device. 216With the 217.Fl v 218argument, SCSI bus number, adapter name and unit numbers are printed as 219well. 220.It Ic periphlist 221List all peripheral drivers attached to a given physical device (logical 222unit). 223.It Ic tur 224Send the SCSI test unit ready (0x00) command to the given device. 225.Nm 226will report whether the device is ready or not. 227.It Ic inquiry 228Send a SCSI inquiry command (0x12) to a device. By default, 229.Nm 230will print out the standard inquiry data, device serial number, and 231transfer rate information. The user can specify that only certain types of 232inquiry data be printed: 233.Bl -tag -width 4n 234.It Fl D 235Get the standard inquiry data. 236.It Fl S 237Print out the serial number. If this flag is the only one specified, 238.Nm 239will not print out "Serial Number" before the value returned by the drive. 240This is to aid in script writing. 241.It Fl R 242Print out transfer rate information. 243.El 244.It Ic start 245Send the SCSI Start/Stop Unit (0x1B) command to the given device with the 246start bit set. 247.It Ic stop 248Send the SCSI Start/Stop Unit (0x1B) command to the given device with the 249start bit cleared. 250.It Ic eject 251Send the SCSI Start/Stop Unit (0x1B) command to the given device with the 252start bit cleared and the eject bit set. 253.It Ic rescan 254Tell the kernel to scan all busses in the system (with the 255.Ar all 256argument), the given bus (XPT_SCAN_BUS), or bus:target:lun 257(XPT_SCAN_LUN) for new devices or devices that have gone away. The user 258may specify a scan of all busses, a single bus, or a lun. Scanning all luns 259on a target isn't supported. 260.It Ic reset 261Tell the kernel to reset all busses in the system (with the 262.Ar all 263argument) or 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 11n 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 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 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 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 12n 318.It Fl d 319Disable block descriptors for mode sense. 320.It Fl b 321Displays mode page data in binary format. 322.It Fl e 323This flag allows the user to edit values in the mode page. The user may 324either edit mode page values with the text editor pointed to by his 325.Ev EDITOR 326environment variable, or supply mode page values via standard input, using 327the same format that 328.Nm 329uses to display mode page values. The editor will be invoked if 330.Nm 331detects that standard input is terminal. 332.It Fl l 333Lists all available mode pages. 334.It Fl m Ar mode_page 335This specifies the number of the mode page the user would like to view 336and/or edit. This argument is mandatory unless 337.Fl l 338is specified. 339.It Fl P Ar pgctl 340This allows the user to specify the page control field. Possible values are: 341.Bl -tag -width xxx -compact 342.It 0 343Current values 344.It 1 345Changeable values 346.It 2 347Default values 348.It 3 349Saved values 350.El 351.El 352.It Ic cmd 353Allows the user to send an arbitrary SCSI CDB to any device. 354The 355.Ic cmd 356function requires the 357.Fl c 358argument to specify the CDB. Other arguments are optional, depending on 359the command type. The command and data specification syntax is documented 360in 361.Xr cam_cdbparse 3 . 362NOTE: If the CDB specified causes data to be transfered to or from the 363SCSI device in question, you MUST specify either 364.Fl i 365or 366.Fl o . 367.Bl -tag -width 17n 368.It Fl c Ar cmd Op args 369This specifies the SCSI CDB. CDBs may be 6, 10, 12 or 16 bytes. 370.It Fl i Ar len Ar fmt 371This specifies the amount of data to read, and how it should be displayed. 372If the format is 373.Sq - , 374.Ar len 375bytes of data will be read from the device and written to standard output. 376.It Fl o Ar len Ar fmt Op args 377This specifies the amount of data to be written to a device, and the data 378that is to be written. If the format is 379.Sq - , 380.Ar len 381bytes of data will be read from standard input and written to the device. 382.El 383.It Ic debug 384Turn on CAM debugging printfs in the kernel. This requires options CAMDEBUG 385in your kernel config file. WARNING: enabling debugging printfs currently 386causes an EXTREME number of kernel printfs. You may have difficulty 387turning off the debugging printfs once they start, since the kernel will be 388busy printing messages and unable to service other requests quickly. 389The 390.Ic debug 391function takes a number of arguments: 392.Bl -tag -width 18n 393.It Fl I 394Enable CAM_DEBUG_INFO printfs. 395.It Fl T 396Enable CAM_DEBUG_TRACE printfs. 397.It Fl S 398Enable CAM_DEBUG_SUBTRACE printfs. 399.It Fl c 400Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the 401SCSI CDBs sent to the specified device(s). 402.It all 403Enable debugging for all devices. 404.It off 405Turn off debugging for all devices 406.It bus Ns Op :target Ns Op :lun 407Turn on debugging for the given bus, target or lun. If the lun or target 408and lun are not specified, they are wildcarded. (i.e., just specifying a 409bus turns on debugging printfs for all devices on that bus.) 410.El 411.It Ic tags 412Show or set the number of "tagged openings" or simultaneous transactions 413we attempt to queue to a particular device. By default, the 414.Ic tags 415command, with no command-specific arguments (i.e. only generic arguments) 416prints out the "soft" maximum number of transactions that can be queued to 417the device in question. For more detailed information, use the 418.Fl v 419argument described below. 420.Bl -tag -width 7n 421.It Fl N Ar tags 422Set the number of tags for the given device. This must be between the 423minimum and maximum number set in the kernel quirk table. The default for 424most devices that support tagged queueing is a minimum of 2 and a maximum 425of 255. The minimum and maximum values for a given device may be 426determined by using the 427.Fl v 428switch. The meaning of the 429.Fl v 430switch for this 431.Nm 432subcommand is described below. 433.It Fl q 434Be quiet, and don't report the number of tags. This is generally used when 435setting the number of tags. 436.It Fl v 437The verbose flag has special functionality for the 438.Em tags 439argument. It causes 440.Nm 441to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB: 442.Bl -tag -width 13n 443.It dev_openings 444This is the amount of capacity for transactions queued to a given device. 445.It dev_active 446This is the number of transactions currently queued to a device. 447.It devq_openings 448This is the kernel queue space for transactions. This count usually mirrors 449dev_openings except during error recovery operations when 450the device queue is frozen (device is not allowed to receive 451commands), the number of dev_openings is reduced, or transaction 452replay is occurring. 453.It devq_queued 454This is the number of transactions waiting in the kernel queue for capacity 455on the device. This number is usually zero unless error recovery is in 456progress. 457.It held 458The held count is the number of CCBs held by peripheral drivers that have 459either just been completed or are about to be released to the transport 460layer for service by a device. Held CCBs reserve capacity on a given 461device. 462.It mintags 463This is the current "hard" minimum number of transactions that can be 464queued to a device at once. The 465.Ar dev_openings 466value above cannot go below this number. The default value for 467.Ar mintags 468is 2, although it may be set higher or lower for various devices. 469.It maxtags 470This is the "hard" maximum number of transactions that can be queued to a 471device at one time. The 472.Ar dev_openings 473value cannot go above this number. The default value for 474.Ar maxtags 475is 255, although it may be set higher or lower for various devices. 476.El 477.El 478.It Ic negotiate 479Show or negotiate various communication parameters. Some controllers may 480not support setting or changing some of these values. For instance, the 481Adaptec 174x controllers do not support changing a device's sync rate or 482offset. 483.Nm 484will not attempt to set the parameter if the controller indicates that it 485does not support setting the parameter. To find out what the controller 486supports, use the 487.Fl v 488flag. The meaning of the 489.Fl v 490flag for the 491.Ic negotiate 492command is described below. Also, some controller drivers don't support 493setting negotiation parameters, even if the underlying controller supports 494negotiation changes. Some controllers, such as the Advansys wide 495controllers, support enabling and disabling synchronous negotiation for 496a device, but do not support setting the synchronous negotiation rate. 497.Bl -tag -width 17n 498.It Fl a 499Attempt to make the negotiation settings take effect immediately by sending 500a Test Unit Ready command to the device. 501.It Fl c 502Show or set current negotiation settings. This is the default. 503.It Fl D Ar enable|disable 504Enable or disable disconnection. 505.It Fl O Ar offset 506Set the command delay offset. 507.It Fl q 508Be quiet, don't print anything. This is generally useful when you want to 509set a parameter, but don't want any status information. 510.It Fl R Ar syncrate 511Change the synchronization rate for a device. The sync rate is a floating 512point value specified in MHz. So, for instance, 513.Sq 20.000 514is a legal value, as is 515.Sq 20 . 516.It Fl T Ar enable|disable 517Enable or disable tagged queueing for a device. 518.It Fl U 519Show or set user negotiation settings. The default is to show or set 520current negotiation settings. 521.It Fl v 522The verbose switch has special meaning for the 523.Ic negotiate 524subcommand. It causes 525.Nm 526to print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the 527controller driver. 528.It Fl W Ar bus_width 529Specify the bus width to negotiate with a device. The bus width is 530specified in bits. The only useful values to specify are 8, 16, and 32 531bits. The controller must support the bus width in question in order for 532the setting to take effect. 533.El 534.Pp 535In general, sync rate and offset settings will not take effect for a 536device until a command has been sent to the device. The 537.Fl a 538switch above will automatically send a Test Unit Ready to the device so 539negotiation parameters will take effect. 540.It Ic format 541Issue the 542.Tn SCSI 543FORMAT UNIT command to the named device. 544.Pp 545.Em WARNING! WARNING! WARNING! 546.Pp 547Low level formatting a disk will destroy ALL data on the disk. Use 548extreme caution when issuing this command. Many users low-level format 549disks that do not really need to be low-level formatted. There are 550relatively few scenarios that call for low-level formatting a disk. 551One reason for 552low-level formatting a disk is to initialize the disk after changing 553its physical sector size. Another reason for low-level formatting a disk 554is to revive the disk if you are getting "medium format corrupted" errors 555from the disk in response to read and write requests. 556.Pp 557Some disks take longer than others to format. Users should specify a 558timeout long enough to allow the format to complete. The default format 559timeout is 3 hours, which should be long enough for most disks. Some hard 560disks will complete a format operation in a very short period of time 561(on the order of 5 minutes or less). This is often because the drive 562doesn't really support the FORMAT UNIT command -- it just accepts the 563command, waits a few minutes and then returns it. 564.Pp 565The 566.Sq format 567subcommand takes several arguments that modify its default behavior. The 568.Fl q 569and 570.Fl y 571arguments can be useful for scripts. 572.Pp 573.Bl -tag -width 6n 574.It Fl q 575Be quiet, don't print any status messages. This option will not disable 576the questions, however. To disable questions, use the 577.Fl y 578argument, below. 579.It Fl w 580Issue a non-immediate format command. By default, 581.Nm 582issues the FORMAT UNIT command with the immediate bit set. This tells the 583device to immediately return the format command, before the format has 584actually completed. Then, 585.Nm 586gathers 587.Tn SCSI 588sense information from the device every second to determine how far along 589in the format process it is. If the 590.Fl w 591argument is specified, 592.Nm 593will issue a non-immediate format command, and will be unable to print any 594information to let the user know what percentage of the disk has been 595formatted. 596.It Fl y 597Don't ask any questions. By default, 598.Nm 599will ask the user if he/she really wants to format the disk in question, 600and also if the default format command timeout is acceptable. The user 601will not be asked about the timeout if a timeout is specified on the 602command line. 603.El 604.It Ic help 605Print out verbose usage information. 606.El 607.Sh ENVIRONMENT 608The 609.Ev SCSI_MODES 610variable allows the user to specify an alternate mode page format file. 611.Pp 612The 613.Ev EDITOR 614variable determines which text editor 615.Nm 616starts when editing mode pages. 617.Sh FILES 618.Bl -tag -width /usr/share/misc/scsi_modes -compact 619.It Pa /usr/share/misc/scsi_modes 620is the SCSI mode format database. 621.It Pa /dev/xpt0 622is the transport layer device. 623.It Pa /dev/pass* 624are the CAM application passthrough devices. 625.El 626.Sh EXAMPLES 627.Dl camcontrol eject -n cd -u 1 -v 628.Pp 629Eject the CD from cd1, and print SCSI sense information if the command 630fails. 631.Pp 632.Dl camcontrol tur da0 633.Pp 634Send the SCSI test unit ready command to da0. 635.Nm 636will report whether the disk is ready, but will not display sense 637information if the command fails since the 638.Fl v 639switch was not specified. 640.Pp 641.Bd -literal -offset indent 642camcontrol tur da1 -E -C 4 -t 50 -v 643.Ed 644.Pp 645Send a test unit ready command to da1. Enable kernel error recovery. 646Specify a retry count of 4, and a timeout of 50 seconds. Enable sense 647printing (with the 648.Fl v 649flag) if the command fails. Since error recovery is turned on, the 650disk will be spun up if it is not currently spinning. 651.Nm 652will report whether the disk is ready. 653.Bd -literal -offset indent 654camcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e 655 -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1" 656.Ed 657.Pp 658Issue a READ BUFFER command (0x3C) to cd1. Display the buffer size of cd1, 659and display the first 10 bytes from the cache on cd1. Display SCSI sense 660information if the command fails. 661.Pp 662.Bd -literal -offset indent 663camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e 664 -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 665.Ed 666.Pp 667Issue a WRITE BUFFER (0x3B) command to cd1. Write out 10 bytes of data, 668not including the (reserved) 4 byte header. Print out sense information if 669the command fails. Be very careful with this command, improper use may 670cause data corruption. 671.Pp 672.Bd -literal -offset indent 673camcontrol modepage da3 -m 1 -e -P 3 674.Ed 675.Pp 676Edit mode page 1 (the Read-Write Error Recover page) for da3, and save the 677settings on the drive. Mode page 1 contains a disk drive's auto read and 678write reallocation settings, among other things. 679.Pp 680.Dl camcontrol rescan all 681.Pp 682Rescan all SCSI busses in the system for devices that have been added, 683removed or changed. 684.Pp 685.Dl camcontrol rescan 0 686.Pp 687Rescan SCSI bus 0 for devices that have been added, removed or changed. 688.Pp 689.Dl camcontrol rescan 0:1:0 690.Pp 691Rescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or 692changed. 693.Pp 694.Dl camcontrol tags da5 -N 24 695.Pp 696Set the number of concurrent transactions for da5 to 24. 697.Pp 698.Bd -literal -offset indent 699camcontrol negotiate -n da -u 4 -T disable 700.Ed 701.Pp 702Disable tagged queueing for da4. 703.Pp 704.Bd -literal -offset indent 705camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a 706.Ed 707.Pp 708Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a 709Test Unit Ready command to make the settings take effect. 710.Sh SEE ALSO 711.Xr cam 3 , 712.Xr cam_cdbparse 3 , 713.Xr cam 4 , 714.Xr pass 4 , 715.Xr xpt 4 716.Sh HISTORY 717The 718.Nm 719command first appeared in 720.Fx 3.0 . 721.Pp 722The mode page editing code and arbitrary SCSI command code are based upon 723code in the old 724.Xr scsi 8 725utility and 726.Xr scsi 3 727library, written by Julian Elischer and Peter Dufault. The 728.Xr scsi 8 729program first appeared in 730.Bx 386 0.1.2.4 , 731and first appeared in 732.Fx 733in 734.Fx 2.0.5 . 735.Sh AUTHORS 736.An Kenneth Merry Aq ken@FreeBSD.org 737.Sh BUGS 738The code that parses the generic command line arguments doesn't know that 739some of the subcommands take multiple arguments. So if, for instance, you 740tried something like this: 741.Bd -literal -offset indent 742camcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v 743.Ed 744.Pp 745The sense information from the test unit ready command would not get 746printed out, since the first 747.Xr getopt 3 748call in 749.Nm 750bails out when it sees the second argument to 751.Fl c 752(0x00), 753above. Fixing this behavior would take some gross code, or changes to the 754.Xr getopt 3 755interface. The best way to circumvent this problem is to always make sure 756to specify generic 757.Nm 758arguments before any command-specific arguments. 759