1525689f1SJustin T. Gibbs.\" 25710d224SKenneth D. Merry.\" Copyright (c) 1998, 1999, 2000, 2002 Kenneth D. Merry. 3525689f1SJustin T. Gibbs.\" All rights reserved. 4525689f1SJustin T. Gibbs.\" 5525689f1SJustin T. Gibbs.\" Redistribution and use in source and binary forms, with or without 6525689f1SJustin T. Gibbs.\" modification, are permitted provided that the following conditions 7525689f1SJustin T. Gibbs.\" are met: 8525689f1SJustin T. Gibbs.\" 1. Redistributions of source code must retain the above copyright 9525689f1SJustin T. Gibbs.\" notice, this list of conditions and the following disclaimer. 10525689f1SJustin T. Gibbs.\" 2. Redistributions in binary form must reproduce the above copyright 11525689f1SJustin T. Gibbs.\" notice, this list of conditions and the following disclaimer in the 12525689f1SJustin T. Gibbs.\" documentation and/or other materials provided with the distribution. 13525689f1SJustin T. Gibbs.\" 3. The name of the author may not be used to endorse or promote products 14525689f1SJustin T. Gibbs.\" derived from this software without specific prior written permission. 15525689f1SJustin T. Gibbs.\" 16525689f1SJustin T. Gibbs.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17525689f1SJustin T. Gibbs.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18525689f1SJustin T. Gibbs.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19525689f1SJustin T. Gibbs.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20525689f1SJustin T. Gibbs.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21525689f1SJustin T. Gibbs.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22525689f1SJustin T. Gibbs.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23525689f1SJustin T. Gibbs.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24525689f1SJustin T. Gibbs.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25525689f1SJustin T. Gibbs.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26525689f1SJustin T. Gibbs.\" SUCH DAMAGE. 27525689f1SJustin T. Gibbs.\" 287f3dea24SPeter Wemm.\" $FreeBSD$ 29525689f1SJustin T. Gibbs.\" 30525689f1SJustin T. Gibbs.Dd September 14, 1998 31525689f1SJustin T. Gibbs.Dt CAMCONTROL 8 3233fab22eSKenneth D. Merry.Os 33525689f1SJustin T. Gibbs.Sh NAME 34525689f1SJustin T. Gibbs.Nm camcontrol 35525689f1SJustin T. Gibbs.Nd CAM control program 36525689f1SJustin T. Gibbs.Sh SYNOPSIS 377c7fb079SRuslan Ermilov.Nm 3833fab22eSKenneth D. Merry.Aq Ar command 39c60e19a8SKenneth D. Merry.Op device id 40525689f1SJustin T. Gibbs.Op generic args 41525689f1SJustin T. Gibbs.Op command args 427c7fb079SRuslan Ermilov.Nm 4333fab22eSKenneth D. Merry.Ic devlist 44525689f1SJustin T. Gibbs.Op Fl v 457c7fb079SRuslan Ermilov.Nm 4633fab22eSKenneth D. Merry.Ic periphlist 47c60e19a8SKenneth D. Merry.Op device id 48525689f1SJustin T. Gibbs.Op Fl n Ar dev_name 49525689f1SJustin T. Gibbs.Op Fl u Ar unit_number 507c7fb079SRuslan Ermilov.Nm 5133fab22eSKenneth D. Merry.Ic tur 52c60e19a8SKenneth D. Merry.Op device id 53525689f1SJustin T. Gibbs.Op generic args 547c7fb079SRuslan Ermilov.Nm 5533fab22eSKenneth D. Merry.Ic inquiry 56c60e19a8SKenneth D. Merry.Op device id 57525689f1SJustin T. Gibbs.Op generic args 58525689f1SJustin T. Gibbs.Op Fl D 59525689f1SJustin T. Gibbs.Op Fl S 60525689f1SJustin T. Gibbs.Op Fl R 617c7fb079SRuslan Ermilov.Nm 6233fab22eSKenneth D. Merry.Ic start 63c60e19a8SKenneth D. Merry.Op device id 64525689f1SJustin T. Gibbs.Op generic args 657c7fb079SRuslan Ermilov.Nm 6633fab22eSKenneth D. Merry.Ic stop 67c60e19a8SKenneth D. Merry.Op device id 68525689f1SJustin T. Gibbs.Op generic args 697c7fb079SRuslan Ermilov.Nm 70f9cecca2SMatthew N. Dodd.Ic load 71f9cecca2SMatthew N. Dodd.Op device id 72f9cecca2SMatthew N. Dodd.Op generic args 73f9cecca2SMatthew N. Dodd.Nm 7433fab22eSKenneth D. Merry.Ic eject 75c60e19a8SKenneth D. Merry.Op device id 76525689f1SJustin T. Gibbs.Op generic args 777c7fb079SRuslan Ermilov.Nm 7833fab22eSKenneth D. Merry.Ic rescan 795710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 807c7fb079SRuslan Ermilov.Nm 8133fab22eSKenneth D. Merry.Ic reset 825710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 837c7fb079SRuslan Ermilov.Nm 8433fab22eSKenneth D. Merry.Ic defects 85c60e19a8SKenneth D. Merry.Op device id 86525689f1SJustin T. Gibbs.Op generic args 87525689f1SJustin T. Gibbs.Aq Fl f Ar format 88525689f1SJustin T. Gibbs.Op Fl P 89525689f1SJustin T. Gibbs.Op Fl G 907c7fb079SRuslan Ermilov.Nm 9133fab22eSKenneth D. Merry.Ic modepage 92c60e19a8SKenneth D. Merry.Op device id 93525689f1SJustin T. Gibbs.Op generic args 949916c5d2SRuslan Ermilov.Aq Fl m Ar page | Fl l 951ac2383cSBill Fumerola.Op Fl P Ar pgctl 967e32b20dSKelly Yancey.Op Fl b | Fl e 97525689f1SJustin T. Gibbs.Op Fl d 987c7fb079SRuslan Ermilov.Nm 9933fab22eSKenneth D. Merry.Ic cmd 100c60e19a8SKenneth D. Merry.Op device id 101525689f1SJustin T. Gibbs.Op generic args 102525689f1SJustin T. Gibbs.Aq Fl c Ar cmd Op args 103525689f1SJustin T. Gibbs.Op Fl i Ar len Ar fmt 104525689f1SJustin T. Gibbs.Bk -words 105525689f1SJustin T. Gibbs.Op Fl o Ar len Ar fmt Op args 106525689f1SJustin T. Gibbs.Ek 1077c7fb079SRuslan Ermilov.Nm 10833fab22eSKenneth D. Merry.Ic debug 109525689f1SJustin T. Gibbs.Op Fl I 110a7e5261eSNate Lawson.Op Fl P 111525689f1SJustin T. Gibbs.Op Fl T 112525689f1SJustin T. Gibbs.Op Fl S 113a7e5261eSNate Lawson.Op Fl X 11494d09127SKenneth D. Merry.Op Fl c 115525689f1SJustin T. Gibbs.Aq all|off|bus Ns Op :target Ns Op :lun 1167c7fb079SRuslan Ermilov.Nm 11733fab22eSKenneth D. Merry.Ic tags 118c60e19a8SKenneth D. Merry.Op device id 1199deea857SKenneth D. Merry.Op generic args 1209deea857SKenneth D. Merry.Op Fl N Ar tags 1219deea857SKenneth D. Merry.Op Fl q 1229deea857SKenneth D. Merry.Op Fl v 1237c7fb079SRuslan Ermilov.Nm 12433fab22eSKenneth D. Merry.Ic negotiate 125c60e19a8SKenneth D. Merry.Op device id 1269deea857SKenneth D. Merry.Op generic args 1279deea857SKenneth D. Merry.Op Fl c 1289deea857SKenneth D. Merry.Op Fl D Ar enable|disable 1299deea857SKenneth D. Merry.Op Fl O Ar offset 1309deea857SKenneth D. Merry.Op Fl q 1319deea857SKenneth D. Merry.Op Fl R Ar syncrate 1329deea857SKenneth D. Merry.Op Fl T Ar enable|disable 1339deea857SKenneth D. Merry.Op Fl U 1349deea857SKenneth D. Merry.Op Fl W Ar bus_width 1359deea857SKenneth D. Merry.Op Fl v 1367c7fb079SRuslan Ermilov.Nm 13733fab22eSKenneth D. Merry.Ic format 13896a93c63SKenneth D. Merry.Op device id 13996a93c63SKenneth D. Merry.Op generic args 14096a93c63SKenneth D. Merry.Op Fl q 14196a93c63SKenneth D. Merry.Op Fl w 14296a93c63SKenneth D. Merry.Op Fl y 1437c7fb079SRuslan Ermilov.Nm 14433fab22eSKenneth D. Merry.Ic help 145525689f1SJustin T. Gibbs.Sh DESCRIPTION 146e1205e80SPhilippe CharnierThe 1477c7fb079SRuslan Ermilov.Nm 148e1205e80SPhilippe Charnierutility is designed to provide a way for users to access and control the 14933fab22eSKenneth D. Merry.Fx 150525689f1SJustin T. GibbsCAM subsystem. 151525689f1SJustin T. Gibbs.Pp 152e1205e80SPhilippe CharnierThe 1537c7fb079SRuslan Ermilov.Nm 154e1205e80SPhilippe Charnierutility 155525689f1SJustin T. Gibbscan cause a loss of data and/or system crashes if used improperly. Even 1569deea857SKenneth D. Merryexpert users are encouraged to exercise caution when using this command. 157525689f1SJustin T. GibbsNovice users should stay away from this utility. 158525689f1SJustin T. Gibbs.Pp 159e1205e80SPhilippe CharnierThe 1607c7fb079SRuslan Ermilov.Nm 161e1205e80SPhilippe Charnierutility has a number of primary functions, many of which support an optional 162c60e19a8SKenneth D. Merrydevice identifier. A device identifier can take one of three forms: 1631252c1bbSRuslan Ermilov.Bl -tag -width 14n 164c60e19a8SKenneth D. Merry.It deviceUNIT 165c60e19a8SKenneth D. MerrySpecify a device name and unit number combination, like "da5" or "cd3". 166e9ef556dSMaxim KonovalovNote that character device node names (e.g. /dev/da0) are 167c60e19a8SKenneth D. Merry.Em not 168c60e19a8SKenneth D. Merryallowed here. 169c60e19a8SKenneth D. Merry.It bus:target 170c60e19a8SKenneth D. MerrySpecify a bus number and target id. The bus number can be determined from 171c60e19a8SKenneth D. Merrythe output of 172c60e19a8SKenneth D. Merry.Dq camcontrol devlist . 173c60e19a8SKenneth D. MerryThe lun defaults to 0. 174c60e19a8SKenneth D. Merry.It bus:target:lun 175c60e19a8SKenneth D. MerrySpecify the bus, target and lun for a device. (e.g. 1:2:0) 176c60e19a8SKenneth D. Merry.El 177c60e19a8SKenneth D. Merry.Pp 178c60e19a8SKenneth D. MerryThe device identifier, if it is specified, 179c60e19a8SKenneth D. Merry.Em must 180c60e19a8SKenneth D. Merrycome immediately after the function name, and before any generic or 181c60e19a8SKenneth D. Merryfunction-specific arguments. Note that the 182c60e19a8SKenneth D. Merry.Fl n 183c60e19a8SKenneth D. Merryand 184c60e19a8SKenneth D. Merry.Fl u 185c60e19a8SKenneth D. Merryarguments described below will override any device name or unit number 186c60e19a8SKenneth D. Merryspecified beforehand. The 187c60e19a8SKenneth D. Merry.Fl n 188c60e19a8SKenneth D. Merryand 189c60e19a8SKenneth D. Merry.Fl u 190c60e19a8SKenneth D. Merryarguments will 191c60e19a8SKenneth D. Merry.Em not 19296a93c63SKenneth D. Merryoverride a specified bus:target or bus:target:lun, however. 193c60e19a8SKenneth D. Merry.Pp 194c60e19a8SKenneth D. MerryMost of the 1957c7fb079SRuslan Ermilov.Nm 196c60e19a8SKenneth D. Merryprimary functions support these generic arguments: 1971252c1bbSRuslan Ermilov.Bl -tag -width 14n 198525689f1SJustin T. Gibbs.It Fl C Ar count 199525689f1SJustin T. GibbsSCSI command retry count. In order for this to work, error recovery 2001252c1bbSRuslan Ermilov.Pq Fl E 201525689f1SJustin T. Gibbsmust be turned on. 202525689f1SJustin T. Gibbs.It Fl E 203525689f1SJustin T. GibbsInstruct the kernel to perform generic SCSI error recovery for the given 204525689f1SJustin T. Gibbscommand. This is needed in order for the retry count 2051252c1bbSRuslan Ermilov.Pq Fl C 206525689f1SJustin T. Gibbsto be honored. Other than retrying commands, the generic error recovery in 207525689f1SJustin T. Gibbsthe code will generally attempt to spin up drives that are not spinning. 208525689f1SJustin T. GibbsIt may take some other actions, depending upon the sense code returned from 209525689f1SJustin T. Gibbsthe command. 210525689f1SJustin T. Gibbs.It Fl n Ar dev_name 211b3550398SKenneth D. MerrySpecify the device type to operate on, e.g. "da", "cd". 212525689f1SJustin T. Gibbs.It Fl t Ar timeout 213525689f1SJustin T. GibbsSCSI command timeout in seconds. This overrides the default timeout for 214525689f1SJustin T. Gibbsany given command. 215525689f1SJustin T. Gibbs.It Fl u Ar unit_number 216b3550398SKenneth D. MerrySpecify the device unit number, e.g. "1", "5". 217525689f1SJustin T. Gibbs.It Fl v 218525689f1SJustin T. GibbsBe verbose, print out sense information for failed SCSI commands. 219525689f1SJustin T. Gibbs.El 220525689f1SJustin T. Gibbs.Pp 221d13d1cd2SKenneth D. MerryPrimary command functions: 222525689f1SJustin T. Gibbs.Bl -tag -width periphlist 22333fab22eSKenneth D. Merry.It Ic devlist 224525689f1SJustin T. GibbsList all physical devices (logical units) attached to the CAM subsystem. 225525689f1SJustin T. GibbsThis also includes a list of peripheral drivers attached to each device. 226525689f1SJustin T. GibbsWith the 227525689f1SJustin T. Gibbs.Fl v 228525689f1SJustin T. Gibbsargument, SCSI bus number, adapter name and unit numbers are printed as 229525689f1SJustin T. Gibbswell. 23033fab22eSKenneth D. Merry.It Ic periphlist 231525689f1SJustin T. GibbsList all peripheral drivers attached to a given physical device (logical 232525689f1SJustin T. Gibbsunit). 23333fab22eSKenneth D. Merry.It Ic tur 234525689f1SJustin T. GibbsSend the SCSI test unit ready (0x00) command to the given device. 235e1205e80SPhilippe CharnierThe 2367c7fb079SRuslan Ermilov.Nm 237e1205e80SPhilippe Charnierutility will report whether the device is ready or not. 23833fab22eSKenneth D. Merry.It Ic inquiry 239525689f1SJustin T. GibbsSend a SCSI inquiry command (0x12) to a device. By default, 2407c7fb079SRuslan Ermilov.Nm 241525689f1SJustin T. Gibbswill print out the standard inquiry data, device serial number, and 242525689f1SJustin T. Gibbstransfer rate information. The user can specify that only certain types of 243525689f1SJustin T. Gibbsinquiry data be printed: 2441252c1bbSRuslan Ermilov.Bl -tag -width 4n 245525689f1SJustin T. Gibbs.It Fl D 246525689f1SJustin T. GibbsGet the standard inquiry data. 247525689f1SJustin T. Gibbs.It Fl S 248525689f1SJustin T. GibbsPrint out the serial number. If this flag is the only one specified, 2497c7fb079SRuslan Ermilov.Nm 250525689f1SJustin T. Gibbswill not print out "Serial Number" before the value returned by the drive. 251525689f1SJustin T. GibbsThis is to aid in script writing. 252525689f1SJustin T. Gibbs.It Fl R 253525689f1SJustin T. GibbsPrint out transfer rate information. 254525689f1SJustin T. Gibbs.El 25533fab22eSKenneth D. Merry.It Ic start 256525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 257525689f1SJustin T. Gibbsstart bit set. 25833fab22eSKenneth D. Merry.It Ic stop 259525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 260525689f1SJustin T. Gibbsstart bit cleared. 261f9cecca2SMatthew N. Dodd.It Ic load 262f9cecca2SMatthew N. DoddSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 263f9cecca2SMatthew N. Doddstart bit set and the load/eject bit set. 26433fab22eSKenneth D. Merry.It Ic eject 265525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 266f9cecca2SMatthew N. Doddstart bit cleared and the load/eject bit set. 26733fab22eSKenneth D. Merry.It Ic rescan 2685710d224SKenneth D. MerryTell the kernel to scan all busses in the system (with the 2695710d224SKenneth D. Merry.Ar all 2705710d224SKenneth D. Merryargument), the given bus (XPT_SCAN_BUS), or bus:target:lun 271525689f1SJustin T. Gibbs(XPT_SCAN_LUN) for new devices or devices that have gone away. The user 2725710d224SKenneth D. Merrymay specify a scan of all busses, a single bus, or a lun. Scanning all luns 2735710d224SKenneth D. Merryon a target isn't supported. 27433fab22eSKenneth D. Merry.It Ic reset 2755710d224SKenneth D. MerryTell the kernel to reset all busses in the system (with the 2765710d224SKenneth D. Merry.Ar all 2775710d224SKenneth D. Merryargument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus 278a2a44836SMatt Jacobreset for that bus, or to reset the given bus:target:lun 279a2a44836SMatt Jacob(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after 280ef8f7ac9SSheldon Hearnconnecting to that device. 281ef8f7ac9SSheldon HearnNote that this can have a destructive impact 282a2a44836SMatt Jacobon the system. 28333fab22eSKenneth D. Merry.It Ic defects 284525689f1SJustin T. GibbsSend the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and 285525689f1SJustin T. Gibbsprint out any combination of: the total number of defects, the primary 286525689f1SJustin T. Gibbsdefect list (PLIST), and the grown defect list (GLIST). 2871252c1bbSRuslan Ermilov.Bl -tag -width 11n 288525689f1SJustin T. Gibbs.It Fl f Ar format 289525689f1SJustin T. GibbsThe three format options are: 290525689f1SJustin T. Gibbs.Em block , 291525689f1SJustin T. Gibbsto print out the list as logical blocks, 292525689f1SJustin T. Gibbs.Em bfi , 293525689f1SJustin T. Gibbsto print out the list in bytes from index format, and 294525689f1SJustin T. Gibbs.Em phys , 295525689f1SJustin T. Gibbsto print out the list in physical sector format. The format argument is 296525689f1SJustin T. Gibbsrequired. Most drives support the physical sector format. Some drives 297525689f1SJustin T. Gibbssupport the logical block format. Many drives, if they don't support the 298525689f1SJustin T. Gibbsrequested format, return the data in an alternate format, along with sense 299525689f1SJustin T. Gibbsinformation indicating that the requested data format isn't supported. 300e1205e80SPhilippe CharnierThe 3017c7fb079SRuslan Ermilov.Nm 302e1205e80SPhilippe Charnierutility 303525689f1SJustin T. Gibbsattempts to detect this, and print out whatever format the drive returns. 304525689f1SJustin T. GibbsIf the drive uses a non-standard sense code to report that it doesn't 305525689f1SJustin T. Gibbssupport the requested format, 3067c7fb079SRuslan Ermilov.Nm 307525689f1SJustin T. Gibbswill probably see the error as a failure to complete the request. 308525689f1SJustin T. Gibbs.It Fl G 309525689f1SJustin T. GibbsPrint out the grown defect list. This is a list of bad blocks that have 310525689f1SJustin T. Gibbsbeen remapped since the disk left the factory. 311525689f1SJustin T. Gibbs.It Fl P 312525689f1SJustin T. GibbsPrint out the primary defect list. 313525689f1SJustin T. Gibbs.El 314525689f1SJustin T. Gibbs.Pp 315525689f1SJustin T. GibbsIf neither 316525689f1SJustin T. Gibbs.Fl P 317525689f1SJustin T. Gibbsnor 318525689f1SJustin T. Gibbs.Fl G 319525689f1SJustin T. Gibbsis specified, 3207c7fb079SRuslan Ermilov.Nm 321525689f1SJustin T. Gibbswill print out the number of defects given in the READ DEFECT DATA header 322525689f1SJustin T. Gibbsreturned from the drive. 32333fab22eSKenneth D. Merry.It Ic modepage 324525689f1SJustin T. GibbsAllows the user to display and optionally edit a SCSI mode page. The mode 325525689f1SJustin T. Gibbspage formats are located in 326525689f1SJustin T. Gibbs.Pa /usr/share/misc/scsi_modes . 327525689f1SJustin T. GibbsThis can be overridden by specifying a different file in the 328525689f1SJustin T. Gibbs.Ev SCSI_MODES 32933fab22eSKenneth D. Merryenvironment variable. 33033fab22eSKenneth D. MerryThe 33133fab22eSKenneth D. Merry.Ic modepage 33233fab22eSKenneth D. Merrycommand takes several arguments: 3331252c1bbSRuslan Ermilov.Bl -tag -width 12n 3349deea857SKenneth D. Merry.It Fl d 335525689f1SJustin T. GibbsDisable block descriptors for mode sense. 3367e32b20dSKelly Yancey.It Fl b 3377e32b20dSKelly YanceyDisplays mode page data in binary format. 338525689f1SJustin T. Gibbs.It Fl e 3397e32b20dSKelly YanceyThis flag allows the user to edit values in the mode page. The user may 3407e32b20dSKelly Yanceyeither edit mode page values with the text editor pointed to by his 3417e32b20dSKelly Yancey.Ev EDITOR 3427e32b20dSKelly Yanceyenvironment variable, or supply mode page values via standard input, using 3437e32b20dSKelly Yanceythe same format that 3447c7fb079SRuslan Ermilov.Nm 3457e32b20dSKelly Yanceyuses to display mode page values. The editor will be invoked if 3467c7fb079SRuslan Ermilov.Nm 3477e32b20dSKelly Yanceydetects that standard input is terminal. 3487e32b20dSKelly Yancey.It Fl l 3497e32b20dSKelly YanceyLists all available mode pages. 350525689f1SJustin T. Gibbs.It Fl m Ar mode_page 351525689f1SJustin T. GibbsThis specifies the number of the mode page the user would like to view 3529402dd99SKelly Yanceyand/or edit. This argument is mandatory unless 3539402dd99SKelly Yancey.Fl l 3549402dd99SKelly Yanceyis specified. 3551ac2383cSBill Fumerola.It Fl P Ar pgctl 356525689f1SJustin T. GibbsThis allows the user to specify the page control field. Possible values are: 357525689f1SJustin T. Gibbs.Bl -tag -width xxx -compact 35846a1f3b4SKenneth D. Merry.It 0 359525689f1SJustin T. GibbsCurrent values 36046a1f3b4SKenneth D. Merry.It 1 361525689f1SJustin T. GibbsChangeable values 36246a1f3b4SKenneth D. Merry.It 2 363525689f1SJustin T. GibbsDefault values 36446a1f3b4SKenneth D. Merry.It 3 365525689f1SJustin T. GibbsSaved values 366525689f1SJustin T. Gibbs.El 367525689f1SJustin T. Gibbs.El 36833fab22eSKenneth D. Merry.It Ic cmd 36933fab22eSKenneth D. MerryAllows the user to send an arbitrary SCSI CDB to any device. 37033fab22eSKenneth D. MerryThe 37133fab22eSKenneth D. Merry.Ic cmd 372525689f1SJustin T. Gibbsfunction requires the 373525689f1SJustin T. Gibbs.Fl c 374525689f1SJustin T. Gibbsargument to specify the CDB. Other arguments are optional, depending on 375525689f1SJustin T. Gibbsthe command type. The command and data specification syntax is documented 376525689f1SJustin T. Gibbsin 37796a93c63SKenneth D. Merry.Xr cam_cdbparse 3 . 378525689f1SJustin T. GibbsNOTE: If the CDB specified causes data to be transfered to or from the 379525689f1SJustin T. GibbsSCSI device in question, you MUST specify either 380525689f1SJustin T. Gibbs.Fl i 381525689f1SJustin T. Gibbsor 382525689f1SJustin T. Gibbs.Fl o . 3831252c1bbSRuslan Ermilov.Bl -tag -width 17n 384525689f1SJustin T. Gibbs.It Fl c Ar cmd Op args 385525689f1SJustin T. GibbsThis specifies the SCSI CDB. CDBs may be 6, 10, 12 or 16 bytes. 386525689f1SJustin T. Gibbs.It Fl i Ar len Ar fmt 387525689f1SJustin T. GibbsThis specifies the amount of data to read, and how it should be displayed. 388525689f1SJustin T. GibbsIf the format is 389525689f1SJustin T. Gibbs.Sq - , 390525689f1SJustin T. Gibbs.Ar len 391525689f1SJustin T. Gibbsbytes of data will be read from the device and written to standard output. 392525689f1SJustin T. Gibbs.It Fl o Ar len Ar fmt Op args 393525689f1SJustin T. GibbsThis specifies the amount of data to be written to a device, and the data 394525689f1SJustin T. Gibbsthat is to be written. If the format is 395525689f1SJustin T. Gibbs.Sq - , 396525689f1SJustin T. Gibbs.Ar len 397525689f1SJustin T. Gibbsbytes of data will be read from standard input and written to the device. 398525689f1SJustin T. Gibbs.El 39933fab22eSKenneth D. Merry.It Ic debug 400525689f1SJustin T. GibbsTurn on CAM debugging printfs in the kernel. This requires options CAMDEBUG 401525689f1SJustin T. Gibbsin your kernel config file. WARNING: enabling debugging printfs currently 402525689f1SJustin T. Gibbscauses an EXTREME number of kernel printfs. You may have difficulty 403525689f1SJustin T. Gibbsturning off the debugging printfs once they start, since the kernel will be 404525689f1SJustin T. Gibbsbusy printing messages and unable to service other requests quickly. 40533fab22eSKenneth D. MerryThe 40633fab22eSKenneth D. Merry.Ic debug 40733fab22eSKenneth D. Merryfunction takes a number of arguments: 4081252c1bbSRuslan Ermilov.Bl -tag -width 18n 409525689f1SJustin T. Gibbs.It Fl I 410525689f1SJustin T. GibbsEnable CAM_DEBUG_INFO printfs. 411a7e5261eSNate Lawson.It Fl P 412a7e5261eSNate LawsonEnable CAM_DEBUG_PERIPH printfs. 413525689f1SJustin T. Gibbs.It Fl T 414525689f1SJustin T. GibbsEnable CAM_DEBUG_TRACE printfs. 415525689f1SJustin T. Gibbs.It Fl S 416525689f1SJustin T. GibbsEnable CAM_DEBUG_SUBTRACE printfs. 417a7e5261eSNate Lawson.It Fl X 418a7e5261eSNate LawsonEnable CAM_DEBUG_XPT printfs. 419d05caa00SKenneth D. Merry.It Fl c 420d05caa00SKenneth D. MerryEnable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the 421d05caa00SKenneth D. MerrySCSI CDBs sent to the specified device(s). 422525689f1SJustin T. Gibbs.It all 423525689f1SJustin T. GibbsEnable debugging for all devices. 424525689f1SJustin T. Gibbs.It off 425525689f1SJustin T. GibbsTurn off debugging for all devices 426525689f1SJustin T. Gibbs.It bus Ns Op :target Ns Op :lun 427525689f1SJustin T. GibbsTurn on debugging for the given bus, target or lun. If the lun or target 428525689f1SJustin T. Gibbsand lun are not specified, they are wildcarded. (i.e., just specifying a 429525689f1SJustin T. Gibbsbus turns on debugging printfs for all devices on that bus.) 430525689f1SJustin T. Gibbs.El 43133fab22eSKenneth D. Merry.It Ic tags 4329deea857SKenneth D. MerryShow or set the number of "tagged openings" or simultaneous transactions 4339deea857SKenneth D. Merrywe attempt to queue to a particular device. By default, the 43433fab22eSKenneth D. Merry.Ic tags 4359deea857SKenneth D. Merrycommand, with no command-specific arguments (i.e. only generic arguments) 4369deea857SKenneth D. Merryprints out the "soft" maximum number of transactions that can be queued to 4379deea857SKenneth D. Merrythe device in question. For more detailed information, use the 4389deea857SKenneth D. Merry.Fl v 4399deea857SKenneth D. Merryargument described below. 4401252c1bbSRuslan Ermilov.Bl -tag -width 7n 4419deea857SKenneth D. Merry.It Fl N Ar tags 4429deea857SKenneth D. MerrySet the number of tags for the given device. This must be between the 4439deea857SKenneth D. Merryminimum and maximum number set in the kernel quirk table. The default for 4449deea857SKenneth D. Merrymost devices that support tagged queueing is a minimum of 2 and a maximum 4459deea857SKenneth D. Merryof 255. The minimum and maximum values for a given device may be 4469deea857SKenneth D. Merrydetermined by using the 4479deea857SKenneth D. Merry.Fl v 4489deea857SKenneth D. Merryswitch. The meaning of the 4499deea857SKenneth D. Merry.Fl v 4509deea857SKenneth D. Merryswitch for this 4517c7fb079SRuslan Ermilov.Nm 4529deea857SKenneth D. Merrysubcommand is described below. 4539deea857SKenneth D. Merry.It Fl q 4549deea857SKenneth D. MerryBe quiet, and don't report the number of tags. This is generally used when 4559deea857SKenneth D. Merrysetting the number of tags. 4569deea857SKenneth D. Merry.It Fl v 4579deea857SKenneth D. MerryThe verbose flag has special functionality for the 4589deea857SKenneth D. Merry.Em tags 4599deea857SKenneth D. Merryargument. It causes 4607c7fb079SRuslan Ermilov.Nm 4619deea857SKenneth D. Merryto print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB: 4621252c1bbSRuslan Ermilov.Bl -tag -width 13n 4639deea857SKenneth D. Merry.It dev_openings 4649deea857SKenneth D. MerryThis is the amount of capacity for transactions queued to a given device. 4659deea857SKenneth D. Merry.It dev_active 4669deea857SKenneth D. MerryThis is the number of transactions currently queued to a device. 4679deea857SKenneth D. Merry.It devq_openings 4689deea857SKenneth D. MerryThis is the kernel queue space for transactions. This count usually mirrors 4699deea857SKenneth D. Merrydev_openings except during error recovery operations when 4709deea857SKenneth D. Merrythe device queue is frozen (device is not allowed to receive 4719deea857SKenneth D. Merrycommands), the number of dev_openings is reduced, or transaction 4729deea857SKenneth D. Merryreplay is occurring. 4739deea857SKenneth D. Merry.It devq_queued 4749deea857SKenneth D. MerryThis is the number of transactions waiting in the kernel queue for capacity 4759deea857SKenneth D. Merryon the device. This number is usually zero unless error recovery is in 4769deea857SKenneth D. Merryprogress. 4779deea857SKenneth D. Merry.It held 4789deea857SKenneth D. MerryThe held count is the number of CCBs held by peripheral drivers that have 4799deea857SKenneth D. Merryeither just been completed or are about to be released to the transport 4809deea857SKenneth D. Merrylayer for service by a device. Held CCBs reserve capacity on a given 4819deea857SKenneth D. Merrydevice. 4829deea857SKenneth D. Merry.It mintags 4839deea857SKenneth D. MerryThis is the current "hard" minimum number of transactions that can be 4849deea857SKenneth D. Merryqueued to a device at once. The 4859deea857SKenneth D. Merry.Ar dev_openings 4869deea857SKenneth D. Merryvalue above cannot go below this number. The default value for 4879deea857SKenneth D. Merry.Ar mintags 4889deea857SKenneth D. Merryis 2, although it may be set higher or lower for various devices. 4899deea857SKenneth D. Merry.It maxtags 4909deea857SKenneth D. MerryThis is the "hard" maximum number of transactions that can be queued to a 4919deea857SKenneth D. Merrydevice at one time. The 4929deea857SKenneth D. Merry.Ar dev_openings 4939deea857SKenneth D. Merryvalue cannot go above this number. The default value for 4949deea857SKenneth D. Merry.Ar maxtags 4959deea857SKenneth D. Merryis 255, although it may be set higher or lower for various devices. 4969deea857SKenneth D. Merry.El 4979deea857SKenneth D. Merry.El 49833fab22eSKenneth D. Merry.It Ic negotiate 4999deea857SKenneth D. MerryShow or negotiate various communication parameters. Some controllers may 5009deea857SKenneth D. Merrynot support setting or changing some of these values. For instance, the 5019deea857SKenneth D. MerryAdaptec 174x controllers do not support changing a device's sync rate or 5029deea857SKenneth D. Merryoffset. 503e1205e80SPhilippe CharnierThe 5047c7fb079SRuslan Ermilov.Nm 505e1205e80SPhilippe Charnierutility 5069deea857SKenneth D. Merrywill not attempt to set the parameter if the controller indicates that it 5079deea857SKenneth D. Merrydoes not support setting the parameter. To find out what the controller 5089deea857SKenneth D. Merrysupports, use the 5099deea857SKenneth D. Merry.Fl v 5109deea857SKenneth D. Merryflag. The meaning of the 5119deea857SKenneth D. Merry.Fl v 5129deea857SKenneth D. Merryflag for the 51333fab22eSKenneth D. Merry.Ic negotiate 5149deea857SKenneth D. Merrycommand is described below. Also, some controller drivers don't support 5159deea857SKenneth D. Merrysetting negotiation parameters, even if the underlying controller supports 5169deea857SKenneth D. Merrynegotiation changes. Some controllers, such as the Advansys wide 5179deea857SKenneth D. Merrycontrollers, support enabling and disabling synchronous negotiation for 5189deea857SKenneth D. Merrya device, but do not support setting the synchronous negotiation rate. 5191252c1bbSRuslan Ermilov.Bl -tag -width 17n 5209deea857SKenneth D. Merry.It Fl a 5219deea857SKenneth D. MerryAttempt to make the negotiation settings take effect immediately by sending 5229deea857SKenneth D. Merrya Test Unit Ready command to the device. 5239deea857SKenneth D. Merry.It Fl c 5249deea857SKenneth D. MerryShow or set current negotiation settings. This is the default. 5259deea857SKenneth D. Merry.It Fl D Ar enable|disable 5269deea857SKenneth D. MerryEnable or disable disconnection. 5279deea857SKenneth D. Merry.It Fl O Ar offset 5289deea857SKenneth D. MerrySet the command delay offset. 5299deea857SKenneth D. Merry.It Fl q 5309deea857SKenneth D. MerryBe quiet, don't print anything. This is generally useful when you want to 5319deea857SKenneth D. Merryset a parameter, but don't want any status information. 5329deea857SKenneth D. Merry.It Fl R Ar syncrate 5339deea857SKenneth D. MerryChange the synchronization rate for a device. The sync rate is a floating 5349deea857SKenneth D. Merrypoint value specified in MHz. So, for instance, 5359deea857SKenneth D. Merry.Sq 20.000 5369deea857SKenneth D. Merryis a legal value, as is 5379deea857SKenneth D. Merry.Sq 20 . 5389deea857SKenneth D. Merry.It Fl T Ar enable|disable 5399deea857SKenneth D. MerryEnable or disable tagged queueing for a device. 5409deea857SKenneth D. Merry.It Fl U 5419deea857SKenneth D. MerryShow or set user negotiation settings. The default is to show or set 5429deea857SKenneth D. Merrycurrent negotiation settings. 5439deea857SKenneth D. Merry.It Fl v 5449deea857SKenneth D. MerryThe verbose switch has special meaning for the 54533fab22eSKenneth D. Merry.Ic negotiate 5469deea857SKenneth D. Merrysubcommand. It causes 5477c7fb079SRuslan Ermilov.Nm 5489deea857SKenneth D. Merryto print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the 5499deea857SKenneth D. Merrycontroller driver. 5509deea857SKenneth D. Merry.It Fl W Ar bus_width 5519deea857SKenneth D. MerrySpecify the bus width to negotiate with a device. The bus width is 5529deea857SKenneth D. Merryspecified in bits. The only useful values to specify are 8, 16, and 32 5539deea857SKenneth D. Merrybits. The controller must support the bus width in question in order for 5549deea857SKenneth D. Merrythe setting to take effect. 5559deea857SKenneth D. Merry.El 5569deea857SKenneth D. Merry.Pp 5579deea857SKenneth D. MerryIn general, sync rate and offset settings will not take effect for a 5589deea857SKenneth D. Merrydevice until a command has been sent to the device. The 5599deea857SKenneth D. Merry.Fl a 5609deea857SKenneth D. Merryswitch above will automatically send a Test Unit Ready to the device so 5619deea857SKenneth D. Merrynegotiation parameters will take effect. 56233fab22eSKenneth D. Merry.It Ic format 56396a93c63SKenneth D. MerryIssue the 56496a93c63SKenneth D. Merry.Tn SCSI 56596a93c63SKenneth D. MerryFORMAT UNIT command to the named device. 56696a93c63SKenneth D. Merry.Pp 56796a93c63SKenneth D. Merry.Em WARNING! WARNING! WARNING! 56896a93c63SKenneth D. Merry.Pp 56996a93c63SKenneth D. MerryLow level formatting a disk will destroy ALL data on the disk. Use 57096a93c63SKenneth D. Merryextreme caution when issuing this command. Many users low-level format 57196a93c63SKenneth D. Merrydisks that do not really need to be low-level formatted. There are 57296a93c63SKenneth D. Merryrelatively few scenarios that call for low-level formatting a disk. 57396a93c63SKenneth D. MerryOne reason for 57496a93c63SKenneth D. Merrylow-level formatting a disk is to initialize the disk after changing 57596a93c63SKenneth D. Merryits physical sector size. Another reason for low-level formatting a disk 57696a93c63SKenneth D. Merryis to revive the disk if you are getting "medium format corrupted" errors 57796a93c63SKenneth D. Merryfrom the disk in response to read and write requests. 57896a93c63SKenneth D. Merry.Pp 57996a93c63SKenneth D. MerrySome disks take longer than others to format. Users should specify a 58096a93c63SKenneth D. Merrytimeout long enough to allow the format to complete. The default format 58196a93c63SKenneth D. Merrytimeout is 3 hours, which should be long enough for most disks. Some hard 58296a93c63SKenneth D. Merrydisks will complete a format operation in a very short period of time 58396a93c63SKenneth D. Merry(on the order of 5 minutes or less). This is often because the drive 58496a93c63SKenneth D. Merrydoesn't really support the FORMAT UNIT command -- it just accepts the 58596a93c63SKenneth D. Merrycommand, waits a few minutes and then returns it. 58696a93c63SKenneth D. Merry.Pp 58796a93c63SKenneth D. MerryThe 58896a93c63SKenneth D. Merry.Sq format 58996a93c63SKenneth D. Merrysubcommand takes several arguments that modify its default behavior. The 59096a93c63SKenneth D. Merry.Fl q 59196a93c63SKenneth D. Merryand 59296a93c63SKenneth D. Merry.Fl y 59396a93c63SKenneth D. Merryarguments can be useful for scripts. 59496a93c63SKenneth D. Merry.Pp 5951252c1bbSRuslan Ermilov.Bl -tag -width 6n 59696a93c63SKenneth D. Merry.It Fl q 59796a93c63SKenneth D. MerryBe quiet, don't print any status messages. This option will not disable 59896a93c63SKenneth D. Merrythe questions, however. To disable questions, use the 59996a93c63SKenneth D. Merry.Fl y 60096a93c63SKenneth D. Merryargument, below. 60196a93c63SKenneth D. Merry.It Fl w 60296a93c63SKenneth D. MerryIssue a non-immediate format command. By default, 6037c7fb079SRuslan Ermilov.Nm 60496a93c63SKenneth D. Merryissues the FORMAT UNIT command with the immediate bit set. This tells the 60596a93c63SKenneth D. Merrydevice to immediately return the format command, before the format has 60696a93c63SKenneth D. Merryactually completed. Then, 6077c7fb079SRuslan Ermilov.Nm 60896a93c63SKenneth D. Merrygathers 60996a93c63SKenneth D. Merry.Tn SCSI 61096a93c63SKenneth D. Merrysense information from the device every second to determine how far along 61196a93c63SKenneth D. Merryin the format process it is. If the 61296a93c63SKenneth D. Merry.Fl w 61396a93c63SKenneth D. Merryargument is specified, 6147c7fb079SRuslan Ermilov.Nm 61596a93c63SKenneth D. Merrywill issue a non-immediate format command, and will be unable to print any 61696a93c63SKenneth D. Merryinformation to let the user know what percentage of the disk has been 61796a93c63SKenneth D. Merryformatted. 61896a93c63SKenneth D. Merry.It Fl y 61996a93c63SKenneth D. MerryDon't ask any questions. By default, 6207c7fb079SRuslan Ermilov.Nm 62196a93c63SKenneth D. Merrywill ask the user if he/she really wants to format the disk in question, 62296a93c63SKenneth D. Merryand also if the default format command timeout is acceptable. The user 62396a93c63SKenneth D. Merrywill not be asked about the timeout if a timeout is specified on the 62496a93c63SKenneth D. Merrycommand line. 62596a93c63SKenneth D. Merry.El 62633fab22eSKenneth D. Merry.It Ic help 6275a251d70SKenneth D. MerryPrint out verbose usage information. 628525689f1SJustin T. Gibbs.El 629525689f1SJustin T. Gibbs.Sh ENVIRONMENT 630525689f1SJustin T. GibbsThe 631525689f1SJustin T. Gibbs.Ev SCSI_MODES 632525689f1SJustin T. Gibbsvariable allows the user to specify an alternate mode page format file. 633525689f1SJustin T. Gibbs.Pp 634525689f1SJustin T. GibbsThe 635525689f1SJustin T. Gibbs.Ev EDITOR 636525689f1SJustin T. Gibbsvariable determines which text editor 6377c7fb079SRuslan Ermilov.Nm 638525689f1SJustin T. Gibbsstarts when editing mode pages. 639525689f1SJustin T. Gibbs.Sh FILES 640525689f1SJustin T. Gibbs.Bl -tag -width /usr/share/misc/scsi_modes -compact 641525689f1SJustin T. Gibbs.It Pa /usr/share/misc/scsi_modes 642525689f1SJustin T. Gibbsis the SCSI mode format database. 643525689f1SJustin T. Gibbs.It Pa /dev/xpt0 644525689f1SJustin T. Gibbsis the transport layer device. 645525689f1SJustin T. Gibbs.It Pa /dev/pass* 646525689f1SJustin T. Gibbsare the CAM application passthrough devices. 647525689f1SJustin T. Gibbs.El 648525689f1SJustin T. Gibbs.Sh EXAMPLES 649525689f1SJustin T. Gibbs.Dl camcontrol eject -n cd -u 1 -v 650525689f1SJustin T. Gibbs.Pp 651525689f1SJustin T. GibbsEject the CD from cd1, and print SCSI sense information if the command 652525689f1SJustin T. Gibbsfails. 653525689f1SJustin T. Gibbs.Pp 654b3550398SKenneth D. Merry.Dl camcontrol tur da0 655525689f1SJustin T. Gibbs.Pp 656525689f1SJustin T. GibbsSend the SCSI test unit ready command to da0. 657e1205e80SPhilippe CharnierThe 6587c7fb079SRuslan Ermilov.Nm 659e1205e80SPhilippe Charnierutility will report whether the disk is ready, but will not display sense 660525689f1SJustin T. Gibbsinformation if the command fails since the 661525689f1SJustin T. Gibbs.Fl v 662525689f1SJustin T. Gibbsswitch was not specified. 663525689f1SJustin T. Gibbs.Pp 664c7938743SMike Pritchard.Bd -literal -offset indent 665c60e19a8SKenneth D. Merrycamcontrol tur da1 -E -C 4 -t 50 -v 666525689f1SJustin T. Gibbs.Ed 667525689f1SJustin T. Gibbs.Pp 668525689f1SJustin T. GibbsSend a test unit ready command to da1. Enable kernel error recovery. 669525689f1SJustin T. GibbsSpecify a retry count of 4, and a timeout of 50 seconds. Enable sense 670525689f1SJustin T. Gibbsprinting (with the 671525689f1SJustin T. Gibbs.Fl v 672525689f1SJustin T. Gibbsflag) if the command fails. Since error recovery is turned on, the 673525689f1SJustin T. Gibbsdisk will be spun up if it is not currently spinning. 674e1205e80SPhilippe CharnierThe 6757c7fb079SRuslan Ermilov.Nm 676e1205e80SPhilippe Charnierutility will report whether the disk is ready. 677c7938743SMike Pritchard.Bd -literal -offset indent 678525689f1SJustin T. Gibbscamcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e 679525689f1SJustin T. Gibbs -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1" 680525689f1SJustin T. Gibbs.Ed 681525689f1SJustin T. Gibbs.Pp 682525689f1SJustin T. GibbsIssue a READ BUFFER command (0x3C) to cd1. Display the buffer size of cd1, 683525689f1SJustin T. Gibbsand display the first 10 bytes from the cache on cd1. Display SCSI sense 684525689f1SJustin T. Gibbsinformation if the command fails. 685525689f1SJustin T. Gibbs.Pp 686c7938743SMike Pritchard.Bd -literal -offset indent 6878604fe2eSSADA Kenjicamcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e 688525689f1SJustin T. Gibbs -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 689525689f1SJustin T. Gibbs.Ed 690525689f1SJustin T. Gibbs.Pp 691525689f1SJustin T. GibbsIssue a WRITE BUFFER (0x3B) command to cd1. Write out 10 bytes of data, 692525689f1SJustin T. Gibbsnot including the (reserved) 4 byte header. Print out sense information if 693525689f1SJustin T. Gibbsthe command fails. Be very careful with this command, improper use may 694525689f1SJustin T. Gibbscause data corruption. 695525689f1SJustin T. Gibbs.Pp 696c7938743SMike Pritchard.Bd -literal -offset indent 697c60e19a8SKenneth D. Merrycamcontrol modepage da3 -m 1 -e -P 3 69894d09127SKenneth D. Merry.Ed 699525689f1SJustin T. Gibbs.Pp 700525689f1SJustin T. GibbsEdit mode page 1 (the Read-Write Error Recover page) for da3, and save the 701525689f1SJustin T. Gibbssettings on the drive. Mode page 1 contains a disk drive's auto read and 702525689f1SJustin T. Gibbswrite reallocation settings, among other things. 703525689f1SJustin T. Gibbs.Pp 7045710d224SKenneth D. Merry.Dl camcontrol rescan all 7055710d224SKenneth D. Merry.Pp 7065710d224SKenneth D. MerryRescan all SCSI busses in the system for devices that have been added, 7075710d224SKenneth D. Merryremoved or changed. 7085710d224SKenneth D. Merry.Pp 709525689f1SJustin T. Gibbs.Dl camcontrol rescan 0 710525689f1SJustin T. Gibbs.Pp 711525689f1SJustin T. GibbsRescan SCSI bus 0 for devices that have been added, removed or changed. 712525689f1SJustin T. Gibbs.Pp 713525689f1SJustin T. Gibbs.Dl camcontrol rescan 0:1:0 714525689f1SJustin T. Gibbs.Pp 715525689f1SJustin T. GibbsRescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or 716525689f1SJustin T. Gibbschanged. 7179deea857SKenneth D. Merry.Pp 718c60e19a8SKenneth D. Merry.Dl camcontrol tags da5 -N 24 7199deea857SKenneth D. Merry.Pp 7209deea857SKenneth D. MerrySet the number of concurrent transactions for da5 to 24. 7219deea857SKenneth D. Merry.Pp 722c7938743SMike Pritchard.Bd -literal -offset indent 7239deea857SKenneth D. Merrycamcontrol negotiate -n da -u 4 -T disable 7249deea857SKenneth D. Merry.Ed 7259deea857SKenneth D. Merry.Pp 7269deea857SKenneth D. MerryDisable tagged queueing for da4. 7279deea857SKenneth D. Merry.Pp 728c7938743SMike Pritchard.Bd -literal -offset indent 7299deea857SKenneth D. Merrycamcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a 7309deea857SKenneth D. Merry.Ed 7319deea857SKenneth D. Merry.Pp 7329deea857SKenneth D. MerryNegotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a 7339deea857SKenneth D. MerryTest Unit Ready command to make the settings take effect. 734525689f1SJustin T. Gibbs.Sh SEE ALSO 735525689f1SJustin T. Gibbs.Xr cam 3 , 7369deea857SKenneth D. Merry.Xr cam_cdbparse 3 , 737c0bdb22bSMatthew Hunt.Xr cam 4 , 738525689f1SJustin T. Gibbs.Xr pass 4 , 739c0bdb22bSMatthew Hunt.Xr xpt 4 740525689f1SJustin T. Gibbs.Sh HISTORY 741525689f1SJustin T. GibbsThe 7427c7fb079SRuslan Ermilov.Nm 743e1205e80SPhilippe Charnierutility first appeared in 744525689f1SJustin T. Gibbs.Fx 3.0 . 745525689f1SJustin T. Gibbs.Pp 746525689f1SJustin T. GibbsThe mode page editing code and arbitrary SCSI command code are based upon 747525689f1SJustin T. Gibbscode in the old 748525689f1SJustin T. Gibbs.Xr scsi 8 749525689f1SJustin T. Gibbsutility and 750525689f1SJustin T. Gibbs.Xr scsi 3 751f9d04512SKenneth D. Merrylibrary, written by Julian Elischer and Peter Dufault. The 752525689f1SJustin T. Gibbs.Xr scsi 8 753753d686dSRuslan Ermilovprogram first appeared in 754753d686dSRuslan Ermilov.Bx 386 0.1.2.4 , 755753d686dSRuslan Ermilovand first appeared in 75633fab22eSKenneth D. Merry.Fx 757525689f1SJustin T. Gibbsin 758525689f1SJustin T. Gibbs.Fx 2.0.5 . 759525689f1SJustin T. Gibbs.Sh AUTHORS 760aa7c9adaSMike Pritchard.An Kenneth Merry Aq ken@FreeBSD.org 761525689f1SJustin T. Gibbs.Sh BUGS 762525689f1SJustin T. GibbsThe code that parses the generic command line arguments doesn't know that 763525689f1SJustin T. Gibbssome of the subcommands take multiple arguments. So if, for instance, you 764525689f1SJustin T. Gibbstried something like this: 765c7938743SMike Pritchard.Bd -literal -offset indent 766b9e3972aSKenneth D. Merrycamcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v 767525689f1SJustin T. Gibbs.Ed 768525689f1SJustin T. Gibbs.Pp 769525689f1SJustin T. GibbsThe sense information from the test unit ready command would not get 770525689f1SJustin T. Gibbsprinted out, since the first 771525689f1SJustin T. Gibbs.Xr getopt 3 772525689f1SJustin T. Gibbscall in 7737c7fb079SRuslan Ermilov.Nm 774525689f1SJustin T. Gibbsbails out when it sees the second argument to 775525689f1SJustin T. Gibbs.Fl c 776c4d9468eSRuslan Ermilov(0x00), 777525689f1SJustin T. Gibbsabove. Fixing this behavior would take some gross code, or changes to the 778525689f1SJustin T. Gibbs.Xr getopt 3 779525689f1SJustin T. Gibbsinterface. The best way to circumvent this problem is to always make sure 780525689f1SJustin T. Gibbsto specify generic 7817c7fb079SRuslan Ermilov.Nm 782525689f1SJustin T. Gibbsarguments before any command-specific arguments. 783