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