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