1525689f1SJustin T. Gibbs.\" 2f553b7b3SKenneth D. Merry.\" Copyright (c) 1998, 1999, 2000, 2002, 2005, 2006, 2007 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.\" 30*fbfb753fSAlexander Motin.Dd June 4, 2012 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 6252c9ce25SScott Long.Ic identify 6352c9ce25SScott Long.Op device id 6452c9ce25SScott Long.Op generic args 65757e402dSAlexander Motin.Op Fl v 6652c9ce25SScott Long.Nm 6742cb6a80SKenneth D. Merry.Ic reportluns 6842cb6a80SKenneth D. Merry.Op device id 6942cb6a80SKenneth D. Merry.Op generic args 7042cb6a80SKenneth D. Merry.Op Fl c 7142cb6a80SKenneth D. Merry.Op Fl l 7242cb6a80SKenneth D. Merry.Op Fl r Ar reporttype 7342cb6a80SKenneth D. Merry.Nm 74f553b7b3SKenneth D. Merry.Ic readcap 75f553b7b3SKenneth D. Merry.Op device id 76f553b7b3SKenneth D. Merry.Op generic args 77f553b7b3SKenneth D. Merry.Op Fl b 78f553b7b3SKenneth D. Merry.Op Fl h 79f553b7b3SKenneth D. Merry.Op Fl H 80f553b7b3SKenneth D. Merry.Op Fl N 81f553b7b3SKenneth D. Merry.Op Fl q 82f553b7b3SKenneth D. Merry.Op Fl s 83f553b7b3SKenneth D. Merry.Nm 8433fab22eSKenneth D. Merry.Ic start 85c60e19a8SKenneth D. Merry.Op device id 86525689f1SJustin T. Gibbs.Op generic args 877c7fb079SRuslan Ermilov.Nm 8833fab22eSKenneth D. Merry.Ic stop 89c60e19a8SKenneth D. Merry.Op device id 90525689f1SJustin T. Gibbs.Op generic args 917c7fb079SRuslan Ermilov.Nm 92f9cecca2SMatthew N. Dodd.Ic load 93f9cecca2SMatthew N. Dodd.Op device id 94f9cecca2SMatthew N. Dodd.Op generic args 95f9cecca2SMatthew N. Dodd.Nm 9633fab22eSKenneth D. Merry.Ic eject 97c60e19a8SKenneth D. Merry.Op device id 98525689f1SJustin T. Gibbs.Op generic args 997c7fb079SRuslan Ermilov.Nm 10033fab22eSKenneth D. Merry.Ic rescan 1015710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 1027c7fb079SRuslan Ermilov.Nm 10333fab22eSKenneth D. Merry.Ic reset 1045710d224SKenneth D. Merry.Aq all | bus Ns Op :target:lun 1057c7fb079SRuslan Ermilov.Nm 10633fab22eSKenneth D. Merry.Ic defects 107c60e19a8SKenneth D. Merry.Op device id 108525689f1SJustin T. Gibbs.Op generic args 109525689f1SJustin T. Gibbs.Aq Fl f Ar format 110525689f1SJustin T. Gibbs.Op Fl P 111525689f1SJustin T. Gibbs.Op Fl G 1127c7fb079SRuslan Ermilov.Nm 11333fab22eSKenneth D. Merry.Ic modepage 114c60e19a8SKenneth D. Merry.Op device id 115525689f1SJustin T. Gibbs.Op generic args 1169916c5d2SRuslan Ermilov.Aq Fl m Ar page | Fl l 1171ac2383cSBill Fumerola.Op Fl P Ar pgctl 1187e32b20dSKelly Yancey.Op Fl b | Fl e 119525689f1SJustin T. Gibbs.Op Fl d 1207c7fb079SRuslan Ermilov.Nm 12133fab22eSKenneth D. Merry.Ic cmd 122c60e19a8SKenneth D. Merry.Op device id 123525689f1SJustin T. Gibbs.Op generic args 12480976615SAlexander Motin.Aq Fl a Ar cmd Op args 125525689f1SJustin T. Gibbs.Aq Fl c Ar cmd Op args 126f930c0dbSAlexander Motin.Op Fl d 127f930c0dbSAlexander Motin.Op Fl f 128525689f1SJustin T. Gibbs.Op Fl i Ar len Ar fmt 129525689f1SJustin T. Gibbs.Bk -words 130525689f1SJustin T. Gibbs.Op Fl o Ar len Ar fmt Op args 13180976615SAlexander Motin.Op Fl r Ar fmt 132525689f1SJustin T. Gibbs.Ek 1337c7fb079SRuslan Ermilov.Nm 13406e79492SKenneth D. Merry.Ic smpcmd 13506e79492SKenneth D. Merry.Op device id 13606e79492SKenneth D. Merry.Op generic args 13706e79492SKenneth D. Merry.Aq Fl r Ar len Ar fmt Op args 13806e79492SKenneth D. Merry.Aq Fl R Ar len Ar fmt Op args 13906e79492SKenneth D. Merry.Nm 14006e79492SKenneth D. Merry.Ic smprg 14106e79492SKenneth D. Merry.Op device id 14206e79492SKenneth D. Merry.Op generic args 14306e79492SKenneth D. Merry.Op Fl l 14406e79492SKenneth D. Merry.Nm 14506e79492SKenneth D. Merry.Ic smppc 14606e79492SKenneth D. Merry.Op device id 14706e79492SKenneth D. Merry.Op generic args 14806e79492SKenneth D. Merry.Aq Fl p Ar phy 14906e79492SKenneth D. Merry.Op Fl l 15006e79492SKenneth D. Merry.Op Fl o Ar operation 15106e79492SKenneth D. Merry.Op Fl d Ar name 15206e79492SKenneth D. Merry.Op Fl m Ar rate 15306e79492SKenneth D. Merry.Op Fl M Ar rate 15406e79492SKenneth D. Merry.Op Fl T Ar pp_timeout 15506e79492SKenneth D. Merry.Op Fl a Ar enable|disable 15606e79492SKenneth D. Merry.Op Fl A Ar enable|disable 15706e79492SKenneth D. Merry.Op Fl s Ar enable|disable 15806e79492SKenneth D. Merry.Op Fl S Ar enable|disable 15906e79492SKenneth D. Merry.Nm 16006e79492SKenneth D. Merry.Ic smpphylist 16106e79492SKenneth D. Merry.Op device id 16206e79492SKenneth D. Merry.Op generic args 16306e79492SKenneth D. Merry.Op Fl l 16406e79492SKenneth D. Merry.Op Fl q 16506e79492SKenneth D. Merry.Nm 16606e79492SKenneth D. Merry.Ic smpmaninfo 16706e79492SKenneth D. Merry.Op device id 16806e79492SKenneth D. Merry.Op generic args 16906e79492SKenneth D. Merry.Op Fl l 17006e79492SKenneth D. Merry.Nm 17133fab22eSKenneth D. Merry.Ic debug 172525689f1SJustin T. Gibbs.Op Fl I 173a7e5261eSNate Lawson.Op Fl P 174525689f1SJustin T. Gibbs.Op Fl T 175525689f1SJustin T. Gibbs.Op Fl S 176a7e5261eSNate Lawson.Op Fl X 17794d09127SKenneth D. Merry.Op Fl c 178*fbfb753fSAlexander Motin.Op Fl p 179525689f1SJustin T. Gibbs.Aq all|off|bus Ns Op :target Ns Op :lun 1807c7fb079SRuslan Ermilov.Nm 18133fab22eSKenneth D. Merry.Ic tags 182c60e19a8SKenneth D. Merry.Op device id 1839deea857SKenneth D. Merry.Op generic args 1849deea857SKenneth D. Merry.Op Fl N Ar tags 1859deea857SKenneth D. Merry.Op Fl q 1869deea857SKenneth D. Merry.Op Fl v 1877c7fb079SRuslan Ermilov.Nm 18833fab22eSKenneth D. Merry.Ic negotiate 189c60e19a8SKenneth D. Merry.Op device id 1909deea857SKenneth D. Merry.Op generic args 1919deea857SKenneth D. Merry.Op Fl c 1929deea857SKenneth D. Merry.Op Fl D Ar enable|disable 193b447e682SAlexander Motin.Op Fl M Ar mode 1949deea857SKenneth D. Merry.Op Fl O Ar offset 1959deea857SKenneth D. Merry.Op Fl q 1969deea857SKenneth D. Merry.Op Fl R Ar syncrate 1979deea857SKenneth D. Merry.Op Fl T Ar enable|disable 1989deea857SKenneth D. Merry.Op Fl U 1999deea857SKenneth D. Merry.Op Fl W Ar bus_width 2009deea857SKenneth D. Merry.Op Fl v 2017c7fb079SRuslan Ermilov.Nm 20233fab22eSKenneth D. Merry.Ic format 20396a93c63SKenneth D. Merry.Op device id 20496a93c63SKenneth D. Merry.Op generic args 20596a93c63SKenneth D. Merry.Op Fl q 206e9e4d3e4SKenneth D. Merry.Op Fl r 20796a93c63SKenneth D. Merry.Op Fl w 20896a93c63SKenneth D. Merry.Op Fl y 2097c7fb079SRuslan Ermilov.Nm 21050c9a276SAlexander Motin.Ic idle 21150c9a276SAlexander Motin.Op device id 21250c9a276SAlexander Motin.Op generic args 21350c9a276SAlexander Motin.Op Fl t Ar time 21450c9a276SAlexander Motin.Nm 21550c9a276SAlexander Motin.Ic standby 21650c9a276SAlexander Motin.Op device id 21750c9a276SAlexander Motin.Op generic args 21850c9a276SAlexander Motin.Op Fl t Ar time 21950c9a276SAlexander Motin.Nm 22050c9a276SAlexander Motin.Ic sleep 22150c9a276SAlexander Motin.Op device id 22250c9a276SAlexander Motin.Op generic args 22350c9a276SAlexander Motin.Nm 2241f4782a4SEd Maste.Ic fwdownload 2251f4782a4SEd Maste.Op device id 2261f4782a4SEd Maste.Op generic args 2271f4782a4SEd Maste.Aq Fl f Ar fw_image 2281f4782a4SEd Maste.Op Fl y 2291f4782a4SEd Maste.Op Fl s 2301f4782a4SEd Maste.Nm 23133fab22eSKenneth D. Merry.Ic help 232525689f1SJustin T. Gibbs.Sh DESCRIPTION 233e1205e80SPhilippe CharnierThe 2347c7fb079SRuslan Ermilov.Nm 235e1205e80SPhilippe Charnierutility is designed to provide a way for users to access and control the 23633fab22eSKenneth D. Merry.Fx 237525689f1SJustin T. GibbsCAM subsystem. 238525689f1SJustin T. Gibbs.Pp 239e1205e80SPhilippe CharnierThe 2407c7fb079SRuslan Ermilov.Nm 241e1205e80SPhilippe Charnierutility 2429806e231SRuslan Ermilovcan cause a loss of data and/or system crashes if used improperly. 2439806e231SRuslan ErmilovEven 2449deea857SKenneth D. Merryexpert users are encouraged to exercise caution when using this command. 245525689f1SJustin T. GibbsNovice users should stay away from this utility. 246525689f1SJustin T. Gibbs.Pp 247e1205e80SPhilippe CharnierThe 2487c7fb079SRuslan Ermilov.Nm 249e1205e80SPhilippe Charnierutility has a number of primary functions, many of which support an optional 2509806e231SRuslan Ermilovdevice identifier. 2519806e231SRuslan ErmilovA device identifier can take one of three forms: 2521252c1bbSRuslan Ermilov.Bl -tag -width 14n 253c60e19a8SKenneth D. Merry.It deviceUNIT 254c60e19a8SKenneth D. MerrySpecify a device name and unit number combination, like "da5" or "cd3". 255c60e19a8SKenneth D. Merry.It bus:target 2569806e231SRuslan ErmilovSpecify a bus number and target id. 2579806e231SRuslan ErmilovThe bus number can be determined from 258c60e19a8SKenneth D. Merrythe output of 259c60e19a8SKenneth D. Merry.Dq camcontrol devlist . 260c60e19a8SKenneth D. MerryThe lun defaults to 0. 261c60e19a8SKenneth D. Merry.It bus:target:lun 2629806e231SRuslan ErmilovSpecify the bus, target and lun for a device. 2639806e231SRuslan Ermilov(e.g.\& 1:2:0) 264c60e19a8SKenneth D. Merry.El 265c60e19a8SKenneth D. Merry.Pp 266c60e19a8SKenneth D. MerryThe device identifier, if it is specified, 267c60e19a8SKenneth D. Merry.Em must 268c60e19a8SKenneth D. Merrycome immediately after the function name, and before any generic or 2699806e231SRuslan Ermilovfunction-specific arguments. 2709806e231SRuslan ErmilovNote that the 271c60e19a8SKenneth D. Merry.Fl n 272c60e19a8SKenneth D. Merryand 273c60e19a8SKenneth D. Merry.Fl u 274c60e19a8SKenneth D. Merryarguments described below will override any device name or unit number 2759806e231SRuslan Ermilovspecified beforehand. 2769806e231SRuslan ErmilovThe 277c60e19a8SKenneth D. Merry.Fl n 278c60e19a8SKenneth D. Merryand 279c60e19a8SKenneth D. Merry.Fl u 280c60e19a8SKenneth D. Merryarguments will 281c60e19a8SKenneth D. Merry.Em not 28296a93c63SKenneth D. Merryoverride a specified bus:target or bus:target:lun, however. 283c60e19a8SKenneth D. Merry.Pp 284c60e19a8SKenneth D. MerryMost of the 2857c7fb079SRuslan Ermilov.Nm 286c60e19a8SKenneth D. Merryprimary functions support these generic arguments: 2871252c1bbSRuslan Ermilov.Bl -tag -width 14n 288525689f1SJustin T. Gibbs.It Fl C Ar count 2899806e231SRuslan ErmilovSCSI command retry count. 2909806e231SRuslan ErmilovIn order for this to work, error recovery 2911252c1bbSRuslan Ermilov.Pq Fl E 292525689f1SJustin T. Gibbsmust be turned on. 293525689f1SJustin T. Gibbs.It Fl E 294525689f1SJustin T. GibbsInstruct the kernel to perform generic SCSI error recovery for the given 2959806e231SRuslan Ermilovcommand. 2969806e231SRuslan ErmilovThis is needed in order for the retry count 2971252c1bbSRuslan Ermilov.Pq Fl C 2989806e231SRuslan Ermilovto be honored. 2999806e231SRuslan ErmilovOther than retrying commands, the generic error recovery in 300525689f1SJustin T. Gibbsthe code will generally attempt to spin up drives that are not spinning. 301525689f1SJustin T. GibbsIt may take some other actions, depending upon the sense code returned from 302525689f1SJustin T. Gibbsthe command. 303525689f1SJustin T. Gibbs.It Fl n Ar dev_name 3049806e231SRuslan ErmilovSpecify the device type to operate on, e.g.\& "da", "cd". 305525689f1SJustin T. Gibbs.It Fl t Ar timeout 3069806e231SRuslan ErmilovSCSI command timeout in seconds. 3079806e231SRuslan ErmilovThis overrides the default timeout for 308525689f1SJustin T. Gibbsany given command. 309525689f1SJustin T. Gibbs.It Fl u Ar unit_number 3109806e231SRuslan ErmilovSpecify the device unit number, e.g.\& "1", "5". 311525689f1SJustin T. Gibbs.It Fl v 312525689f1SJustin T. GibbsBe verbose, print out sense information for failed SCSI commands. 313525689f1SJustin T. Gibbs.El 314525689f1SJustin T. Gibbs.Pp 315d13d1cd2SKenneth D. MerryPrimary command functions: 316525689f1SJustin T. Gibbs.Bl -tag -width periphlist 31733fab22eSKenneth D. Merry.It Ic devlist 318525689f1SJustin T. GibbsList all physical devices (logical units) attached to the CAM subsystem. 319525689f1SJustin T. GibbsThis also includes a list of peripheral drivers attached to each device. 320525689f1SJustin T. GibbsWith the 321525689f1SJustin T. Gibbs.Fl v 322525689f1SJustin T. Gibbsargument, SCSI bus number, adapter name and unit numbers are printed as 323525689f1SJustin T. Gibbswell. 32433fab22eSKenneth D. Merry.It Ic periphlist 325525689f1SJustin T. GibbsList all peripheral drivers attached to a given physical device (logical 326525689f1SJustin T. Gibbsunit). 32733fab22eSKenneth D. Merry.It Ic tur 328525689f1SJustin T. GibbsSend the SCSI test unit ready (0x00) command to the given device. 329e1205e80SPhilippe CharnierThe 3307c7fb079SRuslan Ermilov.Nm 331e1205e80SPhilippe Charnierutility will report whether the device is ready or not. 33233fab22eSKenneth D. Merry.It Ic inquiry 3339806e231SRuslan ErmilovSend a SCSI inquiry command (0x12) to a device. 3349806e231SRuslan ErmilovBy default, 3357c7fb079SRuslan Ermilov.Nm 336525689f1SJustin T. Gibbswill print out the standard inquiry data, device serial number, and 3379806e231SRuslan Ermilovtransfer rate information. 3389806e231SRuslan ErmilovThe user can specify that only certain types of 339525689f1SJustin T. Gibbsinquiry data be printed: 3401252c1bbSRuslan Ermilov.Bl -tag -width 4n 341525689f1SJustin T. Gibbs.It Fl D 342525689f1SJustin T. GibbsGet the standard inquiry data. 343525689f1SJustin T. Gibbs.It Fl S 3449806e231SRuslan ErmilovPrint out the serial number. 3459806e231SRuslan ErmilovIf this flag is the only one specified, 3467c7fb079SRuslan Ermilov.Nm 347525689f1SJustin T. Gibbswill not print out "Serial Number" before the value returned by the drive. 348525689f1SJustin T. GibbsThis is to aid in script writing. 349525689f1SJustin T. Gibbs.It Fl R 350525689f1SJustin T. GibbsPrint out transfer rate information. 351525689f1SJustin T. Gibbs.El 35252c9ce25SScott Long.It Ic identify 35352c9ce25SScott LongSend a ATA identify command (0xec) to a device. 35442cb6a80SKenneth D. Merry.It Ic reportluns 35542cb6a80SKenneth D. MerrySend the SCSI REPORT LUNS (0xA0) command to the given device. 35642cb6a80SKenneth D. MerryBy default, 35742cb6a80SKenneth D. Merry.Nm 35842cb6a80SKenneth D. Merrywill print out the list of logical units (LUNs) supported by the target device. 35942cb6a80SKenneth D. MerryThere are a couple of options to modify the output: 3608266d476SRuslan Ermilov.Bl -tag -width 14n 36142cb6a80SKenneth D. Merry.It Fl c 36242cb6a80SKenneth D. MerryJust print out a count of LUNs, not the actual LUN numbers. 36342cb6a80SKenneth D. Merry.It Fl l 36442cb6a80SKenneth D. MerryJust print out the LUNs, and don't print out the count. 36542cb6a80SKenneth D. Merry.It Fl r Ar reporttype 36642cb6a80SKenneth D. MerrySpecify the type of report to request from the target: 36742cb6a80SKenneth D. Merry.Bl -tag -width 012345678 36842cb6a80SKenneth D. Merry.It default 36942cb6a80SKenneth D. MerryReturn the default report. 37042cb6a80SKenneth D. MerryThis is the 37142cb6a80SKenneth D. Merry.Nm 37242cb6a80SKenneth D. Merrydefault. 37342cb6a80SKenneth D. MerryMost targets will support this report if they support the REPORT LUNS 37442cb6a80SKenneth D. Merrycommand. 37542cb6a80SKenneth D. Merry.It wellknown 37642cb6a80SKenneth D. MerryReturn only well known LUNs. 37742cb6a80SKenneth D. Merry.It all 37842cb6a80SKenneth D. MerryReturn all available LUNs. 37942cb6a80SKenneth D. Merry.El 38042cb6a80SKenneth D. Merry.El 38142cb6a80SKenneth D. Merry.Pp 38242cb6a80SKenneth D. Merry.Nm 38342cb6a80SKenneth D. Merrywill try to print out LUN numbers in a reasonable format. 38442cb6a80SKenneth D. MerryIt can understand the peripheral, flat, LUN and extended LUN formats. 385f553b7b3SKenneth D. Merry.It Ic readcap 386f553b7b3SKenneth D. MerrySend the SCSI READ CAPACITY command to the given device and display 387f553b7b3SKenneth D. Merrythe results. 388f553b7b3SKenneth D. MerryIf the device is larger than 2TB, the SCSI READ CAPACITY (16) service 389f553b7b3SKenneth D. Merryaction will be sent to obtain the full size of the device. 390f553b7b3SKenneth D. MerryBy default, 391f553b7b3SKenneth D. Merry.Nm 392f553b7b3SKenneth D. Merrywill print out the last logical block of the device, and the blocksize of 393f553b7b3SKenneth D. Merrythe device in bytes. 394f553b7b3SKenneth D. MerryTo modify the output format, use the following options: 395f553b7b3SKenneth D. Merry.Bl -tag -width 5n 396f553b7b3SKenneth D. Merry.It Fl b 397f553b7b3SKenneth D. MerryJust print out the blocksize, not the last block or device size. 398f553b7b3SKenneth D. MerryThis cannot be used with 399f553b7b3SKenneth D. Merry.Fl N 400f553b7b3SKenneth D. Merryor 401f553b7b3SKenneth D. Merry.Fl s . 402f553b7b3SKenneth D. Merry.It Fl h 403f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 2, 1K == 1024) format. 404f553b7b3SKenneth D. MerryThis implies 405f553b7b3SKenneth D. Merry.Fl N 406f553b7b3SKenneth D. Merryand cannot be used with 407f553b7b3SKenneth D. Merry.Fl q 408f553b7b3SKenneth D. Merryor 409f553b7b3SKenneth D. Merry.Fl b . 410f553b7b3SKenneth D. Merry.It Fl H 411f553b7b3SKenneth D. MerryPrint out the device size in human readable (base 10, 1K == 1000) format. 412f553b7b3SKenneth D. Merry.It Fl N 413f553b7b3SKenneth D. MerryPrint out the number of blocks in the device instead of the last logical 414f553b7b3SKenneth D. Merryblock. 415f553b7b3SKenneth D. Merry.It Fl q 416f553b7b3SKenneth D. MerryQuiet, print out the numbers only (separated by a comma if 417f553b7b3SKenneth D. Merry.Fl b 418f553b7b3SKenneth D. Merryor 419f553b7b3SKenneth D. Merry.Fl s 420f553b7b3SKenneth D. Merryare not specified). 421f553b7b3SKenneth D. Merry.It Fl s 422f553b7b3SKenneth D. MerryPrint out the last logical block or the size of the device only, and omit 423f553b7b3SKenneth D. Merrythe blocksize. 424f553b7b3SKenneth D. Merry.El 42533fab22eSKenneth D. Merry.It Ic start 426525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 427525689f1SJustin T. Gibbsstart bit set. 42833fab22eSKenneth D. Merry.It Ic stop 429525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 430525689f1SJustin T. Gibbsstart bit cleared. 431f9cecca2SMatthew N. Dodd.It Ic load 432f9cecca2SMatthew N. DoddSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 433f9cecca2SMatthew N. Doddstart bit set and the load/eject bit set. 43433fab22eSKenneth D. Merry.It Ic eject 435525689f1SJustin T. GibbsSend the SCSI Start/Stop Unit (0x1B) command to the given device with the 436f9cecca2SMatthew N. Doddstart bit cleared and the load/eject bit set. 43733fab22eSKenneth D. Merry.It Ic rescan 4385710d224SKenneth D. MerryTell the kernel to scan all busses in the system (with the 4395710d224SKenneth D. Merry.Ar all 4405710d224SKenneth D. Merryargument), the given bus (XPT_SCAN_BUS), or bus:target:lun 4419806e231SRuslan Ermilov(XPT_SCAN_LUN) for new devices or devices that have gone away. 4429806e231SRuslan ErmilovThe user 4439806e231SRuslan Ermilovmay specify a scan of all busses, a single bus, or a lun. 4449806e231SRuslan ErmilovScanning all luns 4450227791bSRuslan Ermilovon a target is not supported. 44633fab22eSKenneth D. Merry.It Ic reset 4475710d224SKenneth D. MerryTell the kernel to reset all busses in the system (with the 4485710d224SKenneth D. Merry.Ar all 4495710d224SKenneth D. Merryargument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus 450a2a44836SMatt Jacobreset for that bus, or to reset the given bus:target:lun 451a2a44836SMatt Jacob(XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after 452ef8f7ac9SSheldon Hearnconnecting to that device. 453ef8f7ac9SSheldon HearnNote that this can have a destructive impact 454a2a44836SMatt Jacobon the system. 45533fab22eSKenneth D. Merry.It Ic defects 456525689f1SJustin T. GibbsSend the SCSI READ DEFECT DATA (10) command (0x37) to the given device, and 457525689f1SJustin T. Gibbsprint out any combination of: the total number of defects, the primary 458525689f1SJustin T. Gibbsdefect list (PLIST), and the grown defect list (GLIST). 4591252c1bbSRuslan Ermilov.Bl -tag -width 11n 460525689f1SJustin T. Gibbs.It Fl f Ar format 461525689f1SJustin T. GibbsThe three format options are: 462525689f1SJustin T. Gibbs.Em block , 463525689f1SJustin T. Gibbsto print out the list as logical blocks, 464525689f1SJustin T. Gibbs.Em bfi , 465525689f1SJustin T. Gibbsto print out the list in bytes from index format, and 466525689f1SJustin T. Gibbs.Em phys , 4679806e231SRuslan Ermilovto print out the list in physical sector format. 4689806e231SRuslan ErmilovThe format argument is 4699806e231SRuslan Ermilovrequired. 4709806e231SRuslan ErmilovMost drives support the physical sector format. 4719806e231SRuslan ErmilovSome drives 4729806e231SRuslan Ermilovsupport the logical block format. 4730227791bSRuslan ErmilovMany drives, if they do not support the 474525689f1SJustin T. Gibbsrequested format, return the data in an alternate format, along with sense 4750227791bSRuslan Ermilovinformation indicating that the requested data format is not supported. 476e1205e80SPhilippe CharnierThe 4777c7fb079SRuslan Ermilov.Nm 478e1205e80SPhilippe Charnierutility 479525689f1SJustin T. Gibbsattempts to detect this, and print out whatever format the drive returns. 4800227791bSRuslan ErmilovIf the drive uses a non-standard sense code to report that it does not 481525689f1SJustin T. Gibbssupport the requested format, 4827c7fb079SRuslan Ermilov.Nm 483525689f1SJustin T. Gibbswill probably see the error as a failure to complete the request. 484525689f1SJustin T. Gibbs.It Fl G 4859806e231SRuslan ErmilovPrint out the grown defect list. 4869806e231SRuslan ErmilovThis is a list of bad blocks that have 487525689f1SJustin T. Gibbsbeen remapped since the disk left the factory. 488525689f1SJustin T. Gibbs.It Fl P 489525689f1SJustin T. GibbsPrint out the primary defect list. 490525689f1SJustin T. Gibbs.El 491525689f1SJustin T. Gibbs.Pp 492525689f1SJustin T. GibbsIf neither 493525689f1SJustin T. Gibbs.Fl P 494525689f1SJustin T. Gibbsnor 495525689f1SJustin T. Gibbs.Fl G 496525689f1SJustin T. Gibbsis specified, 4977c7fb079SRuslan Ermilov.Nm 498525689f1SJustin T. Gibbswill print out the number of defects given in the READ DEFECT DATA header 499525689f1SJustin T. Gibbsreturned from the drive. 50033fab22eSKenneth D. Merry.It Ic modepage 5019806e231SRuslan ErmilovAllows the user to display and optionally edit a SCSI mode page. 5029806e231SRuslan ErmilovThe mode 503525689f1SJustin T. Gibbspage formats are located in 504525689f1SJustin T. Gibbs.Pa /usr/share/misc/scsi_modes . 505525689f1SJustin T. GibbsThis can be overridden by specifying a different file in the 506525689f1SJustin T. Gibbs.Ev SCSI_MODES 50733fab22eSKenneth D. Merryenvironment variable. 50833fab22eSKenneth D. MerryThe 50933fab22eSKenneth D. Merry.Ic modepage 51033fab22eSKenneth D. Merrycommand takes several arguments: 5111252c1bbSRuslan Ermilov.Bl -tag -width 12n 5129deea857SKenneth D. Merry.It Fl d 513525689f1SJustin T. GibbsDisable block descriptors for mode sense. 5147e32b20dSKelly Yancey.It Fl b 5157e32b20dSKelly YanceyDisplays mode page data in binary format. 516525689f1SJustin T. Gibbs.It Fl e 5179806e231SRuslan ErmilovThis flag allows the user to edit values in the mode page. 5189806e231SRuslan ErmilovThe user may 5197e32b20dSKelly Yanceyeither edit mode page values with the text editor pointed to by his 5207e32b20dSKelly Yancey.Ev EDITOR 5217e32b20dSKelly Yanceyenvironment variable, or supply mode page values via standard input, using 5227e32b20dSKelly Yanceythe same format that 5237c7fb079SRuslan Ermilov.Nm 5249806e231SRuslan Ermilovuses to display mode page values. 5259806e231SRuslan ErmilovThe editor will be invoked if 5267c7fb079SRuslan Ermilov.Nm 5277e32b20dSKelly Yanceydetects that standard input is terminal. 5287e32b20dSKelly Yancey.It Fl l 5297e32b20dSKelly YanceyLists all available mode pages. 530525689f1SJustin T. Gibbs.It Fl m Ar mode_page 531525689f1SJustin T. GibbsThis specifies the number of the mode page the user would like to view 5329806e231SRuslan Ermilovand/or edit. 5339806e231SRuslan ErmilovThis argument is mandatory unless 5349402dd99SKelly Yancey.Fl l 5359402dd99SKelly Yanceyis specified. 5361ac2383cSBill Fumerola.It Fl P Ar pgctl 5379806e231SRuslan ErmilovThis allows the user to specify the page control field. 5389806e231SRuslan ErmilovPossible values are: 539525689f1SJustin T. Gibbs.Bl -tag -width xxx -compact 54046a1f3b4SKenneth D. Merry.It 0 541525689f1SJustin T. GibbsCurrent values 54246a1f3b4SKenneth D. Merry.It 1 543525689f1SJustin T. GibbsChangeable values 54446a1f3b4SKenneth D. Merry.It 2 545525689f1SJustin T. GibbsDefault values 54646a1f3b4SKenneth D. Merry.It 3 547525689f1SJustin T. GibbsSaved values 548525689f1SJustin T. Gibbs.El 549525689f1SJustin T. Gibbs.El 55033fab22eSKenneth D. Merry.It Ic cmd 55180976615SAlexander MotinAllows the user to send an arbitrary ATA or SCSI CDB to any device. 55233fab22eSKenneth D. MerryThe 55333fab22eSKenneth D. Merry.Ic cmd 554525689f1SJustin T. Gibbsfunction requires the 555525689f1SJustin T. Gibbs.Fl c 55680976615SAlexander Motinargument to specify SCSI CDB or the 55780976615SAlexander Motin.Fl a 55880976615SAlexander Motinargument to specify ATA Command Block registers values. 5599806e231SRuslan ErmilovOther arguments are optional, depending on 5609806e231SRuslan Ermilovthe command type. 5619806e231SRuslan ErmilovThe command and data specification syntax is documented 562525689f1SJustin T. Gibbsin 56396a93c63SKenneth D. Merry.Xr cam_cdbparse 3 . 564a53bb70bSJoel DahlNOTE: If the CDB specified causes data to be transferred to or from the 565525689f1SJustin T. GibbsSCSI device in question, you MUST specify either 566525689f1SJustin T. Gibbs.Fl i 567525689f1SJustin T. Gibbsor 568525689f1SJustin T. Gibbs.Fl o . 5691252c1bbSRuslan Ermilov.Bl -tag -width 17n 57080976615SAlexander Motin.It Fl a Ar cmd Op args 57180976615SAlexander MotinThis specifies the content of 12 ATA Command Block registers (command, 57280976615SAlexander Motinfeatures, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp. 57380976615SAlexander Motinlba_high_exp, features_exp, sector_count, sector_count_exp). 574525689f1SJustin T. Gibbs.It Fl c Ar cmd Op args 5759806e231SRuslan ErmilovThis specifies the SCSI CDB. 57680976615SAlexander MotinSCSI CDBs may be 6, 10, 12 or 16 bytes. 577f930c0dbSAlexander Motin.It Fl d 578f930c0dbSAlexander MotinSpecifies DMA protocol to be used for ATA command. 579f930c0dbSAlexander Motin.It Fl f 580f930c0dbSAlexander MotinSpecifies FPDMA (NCQ) protocol to be used for ATA command. 581525689f1SJustin T. Gibbs.It Fl i Ar len Ar fmt 582525689f1SJustin T. GibbsThis specifies the amount of data to read, and how it should be displayed. 583525689f1SJustin T. GibbsIf the format is 584525689f1SJustin T. Gibbs.Sq - , 585525689f1SJustin T. Gibbs.Ar len 586525689f1SJustin T. Gibbsbytes of data will be read from the device and written to standard output. 587525689f1SJustin T. Gibbs.It Fl o Ar len Ar fmt Op args 588525689f1SJustin T. GibbsThis specifies the amount of data to be written to a device, and the data 5899806e231SRuslan Ermilovthat is to be written. 5909806e231SRuslan ErmilovIf the format is 591525689f1SJustin T. Gibbs.Sq - , 592525689f1SJustin T. Gibbs.Ar len 593525689f1SJustin T. Gibbsbytes of data will be read from standard input and written to the device. 59480976615SAlexander Motin.It Fl r Ar fmt 59580976615SAlexander MotinThis specifies that 11 result ATA Command Block registers should be displayed 59680976615SAlexander Motin(status, error, lba_low, lba_mid, lba_high, device, lba_low_exp, lba_mid_exp, 59780976615SAlexander Motinlba_high_exp, sector_count, sector_count_exp), and how. 59880976615SAlexander MotinIf the format is 59980976615SAlexander Motin.Sq - , 60080976615SAlexander Motin11 result registers will be written to standard output in hex. 601525689f1SJustin T. Gibbs.El 60206e79492SKenneth D. Merry.It Ic smpcmd 60306e79492SKenneth D. MerryAllows the user to send an arbitrary Serial 60406e79492SKenneth D. MerryManagement Protocol (SMP) command to a device. 60506e79492SKenneth D. MerryThe 60606e79492SKenneth D. Merry.Ic smpcmd 60706e79492SKenneth D. Merryfunction requires the 60806e79492SKenneth D. Merry.Fl r 60906e79492SKenneth D. Merryargument to specify the SMP request to be sent, and the 61006e79492SKenneth D. Merry.Fl R 61106e79492SKenneth D. Merryargument to specify the format of the SMP response. 61206e79492SKenneth D. MerryThe syntax for the SMP request and response arguments is documented in 61306e79492SKenneth D. Merry.Xr cam_cdbparse 3 . 61406e79492SKenneth D. Merry.Pp 61506e79492SKenneth D. MerryNote that SAS adapters that support SMP passthrough (at least the currently 61606e79492SKenneth D. Merryknown adapters) do not accept CRC bytes from the user in the request and do 61706e79492SKenneth D. Merrynot pass CRC bytes back to the user in the response. 61806e79492SKenneth D. MerryTherefore users should not include the CRC bytes in the length of the 61906e79492SKenneth D. Merryrequest and not expect CRC bytes to be returned in the response. 62006e79492SKenneth D. Merry.Bl -tag -width 17n 62106e79492SKenneth D. Merry.It Fl r Ar len Ar fmt Op args 62206e79492SKenneth D. MerryThis specifies the size of the SMP request, without the CRC bytes, and the 62306e79492SKenneth D. MerrySMP request format. If the format is 62406e79492SKenneth D. Merry.Sq - , 62506e79492SKenneth D. Merry.Ar len 62606e79492SKenneth D. Merrybytes of data will be read from standard input and written as the SMP 62706e79492SKenneth D. Merryrequest. 62806e79492SKenneth D. Merry.It Fl R Ar len Ar fmt Op args 62906e79492SKenneth D. MerryThis specifies the size of the buffer allocated for the SMP response, and 63006e79492SKenneth D. Merrythe SMP response format. 63106e79492SKenneth D. MerryIf the format is 63206e79492SKenneth D. Merry.Sq - , 63306e79492SKenneth D. Merry.Ar len 63406e79492SKenneth D. Merrybytes of data will be allocated for the response and the response will be 63506e79492SKenneth D. Merrywritten to standard output. 63606e79492SKenneth D. Merry.El 63706e79492SKenneth D. Merry.It Ic smprg 63806e79492SKenneth D. MerryAllows the user to send the Serial Management Protocol (SMP) Report General 63906e79492SKenneth D. Merrycommand to a device. 64006e79492SKenneth D. Merry.Nm 64106e79492SKenneth D. Merrywill display the data returned by the Report General command. 64206e79492SKenneth D. MerryIf the SMP target supports the long response format, the additional data 64306e79492SKenneth D. Merrywill be requested and displayed automatically. 64406e79492SKenneth D. Merry.Bl -tag -width 8n 64506e79492SKenneth D. Merry.It Fl l 64606e79492SKenneth D. MerryRequest the long response format only. 64706e79492SKenneth D. MerryNot all SMP targets support the long response format. 64806e79492SKenneth D. MerryThis option causes 64906e79492SKenneth D. Merry.Nm 65006e79492SKenneth D. Merryto skip sending the initial report general request without the long bit set 65106e79492SKenneth D. Merryand only issue a report general request with the long bit set. 65206e79492SKenneth D. Merry.El 65306e79492SKenneth D. Merry.It Ic smppc 65406e79492SKenneth D. MerryAllows the user to issue the Serial Management Protocol (SMP) PHY Control 65506e79492SKenneth D. Merrycommand to a device. 65606e79492SKenneth D. MerryThis function should be used with some caution, as it can render devices 65706e79492SKenneth D. Merryinaccessible, and could potentially cause data corruption as well. 65806e79492SKenneth D. MerryThe 65906e79492SKenneth D. Merry.Fl p 66006e79492SKenneth D. Merryargument is required to specify the PHY to operate on. 66106e79492SKenneth D. Merry.Bl -tag -width 17n 66206e79492SKenneth D. Merry.It Fl p Ar phy 66306e79492SKenneth D. MerrySpecify the PHY to operate on. 66406e79492SKenneth D. MerryThis argument is required. 66506e79492SKenneth D. Merry.It Fl l 66606e79492SKenneth D. MerryRequest the long request/response format. 66706e79492SKenneth D. MerryNot all SMP targets support the long response format. 66806e79492SKenneth D. MerryFor the PHY Control command, this currently only affects whether the 66906e79492SKenneth D. Merryrequest length is set to a value other than 0. 67006e79492SKenneth D. Merry.It Fl o Ar operation 67106e79492SKenneth D. MerrySpecify a PHY control operation. 67206e79492SKenneth D. MerryOnly one 67306e79492SKenneth D. Merry.Fl o 67406e79492SKenneth D. Merryoperation may be specified. 67506e79492SKenneth D. MerryThe operation may be specified numerically (in decimal, hexadecimal, or octal) 67606e79492SKenneth D. Merryor one of the following operation names may be specified: 67706e79492SKenneth D. Merry.Bl -tag -width 16n 67806e79492SKenneth D. Merry.It nop 67906e79492SKenneth D. MerryNo operation. 68006e79492SKenneth D. MerryIt is not necessary to specify this argument. 68106e79492SKenneth D. Merry.It linkreset 68206e79492SKenneth D. MerrySend the LINK RESET command to the phy. 68306e79492SKenneth D. Merry.It hardreset 68406e79492SKenneth D. MerrySend the HARD RESET command to the phy. 68506e79492SKenneth D. Merry.It disable 68606e79492SKenneth D. MerrySend the DISABLE command to the phy. 68706e79492SKenneth D. MerryNote that the LINK RESET or HARD RESET commands should re-enable the phy. 688ee5320f4SKenneth D. Merry.It clearerrlog 68906e79492SKenneth D. MerrySend the CLEAR ERROR LOG command. 69006e79492SKenneth D. MerryThis clears the error log counters for the specified phy. 69106e79492SKenneth D. Merry.It clearaffiliation 69206e79492SKenneth D. MerrySend the CLEAR AFFILIATION command. 69306e79492SKenneth D. MerryThis clears the affiliation from the STP initiator port with the same SAS 69406e79492SKenneth D. Merryaddress as the SMP initiator that requests the clear operation. 69506e79492SKenneth D. Merry.It sataportsel 69606e79492SKenneth D. MerrySend the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy. 69706e79492SKenneth D. MerryThis will cause a SATA port selector to use the given phy as its active phy 69806e79492SKenneth D. Merryand make the other phy inactive. 69906e79492SKenneth D. Merry.It clearitnl 70006e79492SKenneth D. MerrySend the CLEAR STP I_T NEXUS LOSS command to the PHY. 70106e79492SKenneth D. Merry.It setdevname 70206e79492SKenneth D. MerrySend the SET ATTACHED DEVICE NAME command to the PHY. 70306e79492SKenneth D. MerryThis requires the 70406e79492SKenneth D. Merry.Fl d 70506e79492SKenneth D. Merryargument to specify the device name. 70606e79492SKenneth D. Merry.El 70706e79492SKenneth D. Merry.It Fl d Ar name 70806e79492SKenneth D. MerrySpecify the attached device name. 70906e79492SKenneth D. MerryThis option is needed with the 71006e79492SKenneth D. Merry.Fl o Ar setdevname 71106e79492SKenneth D. Merryphy operation. 71206e79492SKenneth D. MerryThe name is a 64-bit number, and can be specified in decimal, hexadecimal 71306e79492SKenneth D. Merryor octal format. 71406e79492SKenneth D. Merry.It Fl m Ar rate 71506e79492SKenneth D. MerrySet the minimum physical link rate for the phy. 71606e79492SKenneth D. MerryThis is a numeric argument. 71706e79492SKenneth D. MerryCurrently known link rates are: 71806e79492SKenneth D. Merry.Bl -tag -width 5n 71906e79492SKenneth D. Merry.It 0x0 72006e79492SKenneth D. MerryDo not change current value. 72106e79492SKenneth D. Merry.It 0x8 72206e79492SKenneth D. Merry1.5 Gbps 72306e79492SKenneth D. Merry.It 0x9 72406e79492SKenneth D. Merry3 Gbps 72506e79492SKenneth D. Merry.It 0xa 72606e79492SKenneth D. Merry6 Gbps 72706e79492SKenneth D. Merry.El 72806e79492SKenneth D. Merry.Pp 72906e79492SKenneth D. MerryOther values may be specified for newer physical link rates. 73006e79492SKenneth D. Merry.It Fl M Ar rate 73106e79492SKenneth D. MerrySet the maximum physical link rate for the phy. 73206e79492SKenneth D. MerryThis is a numeric argument. 73306e79492SKenneth D. MerrySee the 73406e79492SKenneth D. Merry.Fl m 73506e79492SKenneth D. Merryargument description for known link rate arguments. 73606e79492SKenneth D. Merry.It Fl T Ar pp_timeout 73706e79492SKenneth D. MerrySet the partial pathway timeout value, in microseconds. 73806e79492SKenneth D. MerrySee the 73906e79492SKenneth D. Merry.Tn ANSI 74006e79492SKenneth D. Merry.Tn SAS 74106e79492SKenneth D. MerryProtcol Layer (SPL) 74206e79492SKenneth D. Merryspecification for more information on this field. 74306e79492SKenneth D. Merry.It Fl a Ar enable|disable 74406e79492SKenneth D. MerryEnable or disable SATA slumber phy power conditions. 74506e79492SKenneth D. Merry.It Fl A Ar enable|disable 74606e79492SKenneth D. MerryEnable or disable SATA partial power conditions. 74706e79492SKenneth D. Merry.It Fl s Ar enable|disable 74806e79492SKenneth D. MerryEnable or disable SAS slumber phy power conditions. 74906e79492SKenneth D. Merry.It Fl S Ar enable|disable 75006e79492SKenneth D. MerryEnable or disable SAS partial phy power conditions. 75106e79492SKenneth D. Merry.El 75206e79492SKenneth D. Merry.It Ic smpphylist 75306e79492SKenneth D. MerryList phys attached to a SAS expander, the address of the end device 75406e79492SKenneth D. Merryattached to the phy, and the inquiry data for that device and peripheral 75506e79492SKenneth D. Merrydevices attached to that device. 75606e79492SKenneth D. MerryThe inquiry data and peripheral devices are displayed if available. 75706e79492SKenneth D. Merry.Bl -tag -width 5n 75806e79492SKenneth D. Merry.It Fl l 75906e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for 76006e79492SKenneth D. Merrythis command. 76106e79492SKenneth D. Merry.It Fl q 76206e79492SKenneth D. MerryOnly print out phys that are attached to a device in the CAM EDT (Existing 76306e79492SKenneth D. MerryDevice Table). 76406e79492SKenneth D. Merry.El 76506e79492SKenneth D. Merry.It Ic smpmaninfo 76606e79492SKenneth D. MerrySend the SMP Report Manufacturer Information command to the device and 76706e79492SKenneth D. Merrydisplay the response. 76806e79492SKenneth D. Merry.Bl -tag -width 5n 76906e79492SKenneth D. Merry.It Fl l 77006e79492SKenneth D. MerryTurn on the long response format for the underlying SMP commands used for 77106e79492SKenneth D. Merrythis command. 77206e79492SKenneth D. Merry.El 77333fab22eSKenneth D. Merry.It Ic debug 7749806e231SRuslan ErmilovTurn on CAM debugging printfs in the kernel. 7759806e231SRuslan ErmilovThis requires options CAMDEBUG 7769806e231SRuslan Ermilovin your kernel config file. 7779806e231SRuslan ErmilovWARNING: enabling debugging printfs currently 7789806e231SRuslan Ermilovcauses an EXTREME number of kernel printfs. 7799806e231SRuslan ErmilovYou may have difficulty 780525689f1SJustin T. Gibbsturning off the debugging printfs once they start, since the kernel will be 781525689f1SJustin T. Gibbsbusy printing messages and unable to service other requests quickly. 78233fab22eSKenneth D. MerryThe 78333fab22eSKenneth D. Merry.Ic debug 78433fab22eSKenneth D. Merryfunction takes a number of arguments: 7851252c1bbSRuslan Ermilov.Bl -tag -width 18n 786525689f1SJustin T. Gibbs.It Fl I 787525689f1SJustin T. GibbsEnable CAM_DEBUG_INFO printfs. 788a7e5261eSNate Lawson.It Fl P 789a7e5261eSNate LawsonEnable CAM_DEBUG_PERIPH printfs. 790525689f1SJustin T. Gibbs.It Fl T 791525689f1SJustin T. GibbsEnable CAM_DEBUG_TRACE printfs. 792525689f1SJustin T. Gibbs.It Fl S 793525689f1SJustin T. GibbsEnable CAM_DEBUG_SUBTRACE printfs. 794a7e5261eSNate Lawson.It Fl X 795a7e5261eSNate LawsonEnable CAM_DEBUG_XPT printfs. 796d05caa00SKenneth D. Merry.It Fl c 7979806e231SRuslan ErmilovEnable CAM_DEBUG_CDB printfs. 7989806e231SRuslan ErmilovThis will cause the kernel to print out the 799d05caa00SKenneth D. MerrySCSI CDBs sent to the specified device(s). 800*fbfb753fSAlexander Motin.It Fl p 801*fbfb753fSAlexander MotinEnable CAM_DEBUG_PROBE printfs. 802525689f1SJustin T. Gibbs.It all 803525689f1SJustin T. GibbsEnable debugging for all devices. 804525689f1SJustin T. Gibbs.It off 805525689f1SJustin T. GibbsTurn off debugging for all devices 806525689f1SJustin T. Gibbs.It bus Ns Op :target Ns Op :lun 8079806e231SRuslan ErmilovTurn on debugging for the given bus, target or lun. 8089806e231SRuslan ErmilovIf the lun or target 8099806e231SRuslan Ermilovand lun are not specified, they are wildcarded. 8109806e231SRuslan Ermilov(i.e., just specifying a 811525689f1SJustin T. Gibbsbus turns on debugging printfs for all devices on that bus.) 812525689f1SJustin T. Gibbs.El 81333fab22eSKenneth D. Merry.It Ic tags 8149deea857SKenneth D. MerryShow or set the number of "tagged openings" or simultaneous transactions 8159806e231SRuslan Ermilovwe attempt to queue to a particular device. 8169806e231SRuslan ErmilovBy default, the 81733fab22eSKenneth D. Merry.Ic tags 8189806e231SRuslan Ermilovcommand, with no command-specific arguments (i.e., only generic arguments) 8199deea857SKenneth D. Merryprints out the "soft" maximum number of transactions that can be queued to 8209806e231SRuslan Ermilovthe device in question. 8219806e231SRuslan ErmilovFor more detailed information, use the 8229deea857SKenneth D. Merry.Fl v 8239deea857SKenneth D. Merryargument described below. 8241252c1bbSRuslan Ermilov.Bl -tag -width 7n 8259deea857SKenneth D. Merry.It Fl N Ar tags 8269806e231SRuslan ErmilovSet the number of tags for the given device. 8279806e231SRuslan ErmilovThis must be between the 8289806e231SRuslan Ermilovminimum and maximum number set in the kernel quirk table. 8299806e231SRuslan ErmilovThe default for 8309deea857SKenneth D. Merrymost devices that support tagged queueing is a minimum of 2 and a maximum 8319806e231SRuslan Ermilovof 255. 8329806e231SRuslan ErmilovThe minimum and maximum values for a given device may be 8339deea857SKenneth D. Merrydetermined by using the 8349deea857SKenneth D. Merry.Fl v 8359806e231SRuslan Ermilovswitch. 8369806e231SRuslan ErmilovThe meaning of the 8379deea857SKenneth D. Merry.Fl v 8389deea857SKenneth D. Merryswitch for this 8397c7fb079SRuslan Ermilov.Nm 8409deea857SKenneth D. Merrysubcommand is described below. 8419deea857SKenneth D. Merry.It Fl q 8420227791bSRuslan ErmilovBe quiet, and do not report the number of tags. 8439806e231SRuslan ErmilovThis is generally used when 8449deea857SKenneth D. Merrysetting the number of tags. 8459deea857SKenneth D. Merry.It Fl v 8469deea857SKenneth D. MerryThe verbose flag has special functionality for the 8479deea857SKenneth D. Merry.Em tags 8489806e231SRuslan Ermilovargument. 8499806e231SRuslan ErmilovIt causes 8507c7fb079SRuslan Ermilov.Nm 8519deea857SKenneth D. Merryto print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB: 8521252c1bbSRuslan Ermilov.Bl -tag -width 13n 8539deea857SKenneth D. Merry.It dev_openings 8549deea857SKenneth D. MerryThis is the amount of capacity for transactions queued to a given device. 8559deea857SKenneth D. Merry.It dev_active 8569deea857SKenneth D. MerryThis is the number of transactions currently queued to a device. 8579deea857SKenneth D. Merry.It devq_openings 8589806e231SRuslan ErmilovThis is the kernel queue space for transactions. 8599806e231SRuslan ErmilovThis count usually mirrors 8609deea857SKenneth D. Merrydev_openings except during error recovery operations when 8619deea857SKenneth D. Merrythe device queue is frozen (device is not allowed to receive 8629deea857SKenneth D. Merrycommands), the number of dev_openings is reduced, or transaction 8639deea857SKenneth D. Merryreplay is occurring. 8649deea857SKenneth D. Merry.It devq_queued 8659deea857SKenneth D. MerryThis is the number of transactions waiting in the kernel queue for capacity 8669806e231SRuslan Ermilovon the device. 8679806e231SRuslan ErmilovThis number is usually zero unless error recovery is in 8689deea857SKenneth D. Merryprogress. 8699deea857SKenneth D. Merry.It held 8709deea857SKenneth D. MerryThe held count is the number of CCBs held by peripheral drivers that have 8719deea857SKenneth D. Merryeither just been completed or are about to be released to the transport 8729806e231SRuslan Ermilovlayer for service by a device. 8739806e231SRuslan ErmilovHeld CCBs reserve capacity on a given 8749deea857SKenneth D. Merrydevice. 8759deea857SKenneth D. Merry.It mintags 8769deea857SKenneth D. MerryThis is the current "hard" minimum number of transactions that can be 8779806e231SRuslan Ermilovqueued to a device at once. 8789806e231SRuslan ErmilovThe 8799deea857SKenneth D. Merry.Ar dev_openings 8809806e231SRuslan Ermilovvalue above cannot go below this number. 8819806e231SRuslan ErmilovThe default value for 8829deea857SKenneth D. Merry.Ar mintags 8839deea857SKenneth D. Merryis 2, although it may be set higher or lower for various devices. 8849deea857SKenneth D. Merry.It maxtags 8859deea857SKenneth D. MerryThis is the "hard" maximum number of transactions that can be queued to a 8869806e231SRuslan Ermilovdevice at one time. 8879806e231SRuslan ErmilovThe 8889deea857SKenneth D. Merry.Ar dev_openings 8899806e231SRuslan Ermilovvalue cannot go above this number. 8909806e231SRuslan ErmilovThe default value for 8919deea857SKenneth D. Merry.Ar maxtags 8929deea857SKenneth D. Merryis 255, although it may be set higher or lower for various devices. 8939deea857SKenneth D. Merry.El 8949deea857SKenneth D. Merry.El 89533fab22eSKenneth D. Merry.It Ic negotiate 8969806e231SRuslan ErmilovShow or negotiate various communication parameters. 8979806e231SRuslan ErmilovSome controllers may 8989806e231SRuslan Ermilovnot support setting or changing some of these values. 8999806e231SRuslan ErmilovFor instance, the 9009deea857SKenneth D. MerryAdaptec 174x controllers do not support changing a device's sync rate or 9019deea857SKenneth D. Merryoffset. 902e1205e80SPhilippe CharnierThe 9037c7fb079SRuslan Ermilov.Nm 904e1205e80SPhilippe Charnierutility 9059deea857SKenneth D. Merrywill not attempt to set the parameter if the controller indicates that it 9069806e231SRuslan Ermilovdoes not support setting the parameter. 9079806e231SRuslan ErmilovTo find out what the controller 9089deea857SKenneth D. Merrysupports, use the 9099deea857SKenneth D. Merry.Fl v 9109806e231SRuslan Ermilovflag. 9119806e231SRuslan ErmilovThe meaning of the 9129deea857SKenneth D. Merry.Fl v 9139deea857SKenneth D. Merryflag for the 91433fab22eSKenneth D. Merry.Ic negotiate 9159806e231SRuslan Ermilovcommand is described below. 9160227791bSRuslan ErmilovAlso, some controller drivers do not support 9179deea857SKenneth D. Merrysetting negotiation parameters, even if the underlying controller supports 9189806e231SRuslan Ermilovnegotiation changes. 9199806e231SRuslan ErmilovSome controllers, such as the Advansys wide 9209deea857SKenneth D. Merrycontrollers, support enabling and disabling synchronous negotiation for 9219deea857SKenneth D. Merrya device, but do not support setting the synchronous negotiation rate. 9221252c1bbSRuslan Ermilov.Bl -tag -width 17n 9239deea857SKenneth D. Merry.It Fl a 9249deea857SKenneth D. MerryAttempt to make the negotiation settings take effect immediately by sending 9259deea857SKenneth D. Merrya Test Unit Ready command to the device. 9269deea857SKenneth D. Merry.It Fl c 9279806e231SRuslan ErmilovShow or set current negotiation settings. 9289806e231SRuslan ErmilovThis is the default. 9299deea857SKenneth D. Merry.It Fl D Ar enable|disable 9309deea857SKenneth D. MerryEnable or disable disconnection. 931b447e682SAlexander Motin.It Fl M Ar mode 932b447e682SAlexander MotinSet ATA mode. 9339deea857SKenneth D. Merry.It Fl O Ar offset 9349deea857SKenneth D. MerrySet the command delay offset. 9359deea857SKenneth D. Merry.It Fl q 9360227791bSRuslan ErmilovBe quiet, do not print anything. 9379806e231SRuslan ErmilovThis is generally useful when you want to 9380227791bSRuslan Ermilovset a parameter, but do not want any status information. 9399deea857SKenneth D. Merry.It Fl R Ar syncrate 9409806e231SRuslan ErmilovChange the synchronization rate for a device. 9419806e231SRuslan ErmilovThe sync rate is a floating 9429806e231SRuslan Ermilovpoint value specified in MHz. 9439806e231SRuslan ErmilovSo, for instance, 9449deea857SKenneth D. Merry.Sq 20.000 9459deea857SKenneth D. Merryis a legal value, as is 9469deea857SKenneth D. Merry.Sq 20 . 9479deea857SKenneth D. Merry.It Fl T Ar enable|disable 9489deea857SKenneth D. MerryEnable or disable tagged queueing for a device. 9499deea857SKenneth D. Merry.It Fl U 9509806e231SRuslan ErmilovShow or set user negotiation settings. 9519806e231SRuslan ErmilovThe default is to show or set 9529deea857SKenneth D. Merrycurrent negotiation settings. 9539deea857SKenneth D. Merry.It Fl v 9549deea857SKenneth D. MerryThe verbose switch has special meaning for the 95533fab22eSKenneth D. Merry.Ic negotiate 9569806e231SRuslan Ermilovsubcommand. 9579806e231SRuslan ErmilovIt causes 9587c7fb079SRuslan Ermilov.Nm 9599deea857SKenneth D. Merryto print out the contents of a Path Inquiry (XPT_PATH_INQ) CCB sent to the 9609deea857SKenneth D. Merrycontroller driver. 9619deea857SKenneth D. Merry.It Fl W Ar bus_width 9629806e231SRuslan ErmilovSpecify the bus width to negotiate with a device. 9639806e231SRuslan ErmilovThe bus width is 9649806e231SRuslan Ermilovspecified in bits. 9659806e231SRuslan ErmilovThe only useful values to specify are 8, 16, and 32 9669806e231SRuslan Ermilovbits. 9679806e231SRuslan ErmilovThe controller must support the bus width in question in order for 9689deea857SKenneth D. Merrythe setting to take effect. 9699deea857SKenneth D. Merry.El 9709deea857SKenneth D. Merry.Pp 9719deea857SKenneth D. MerryIn general, sync rate and offset settings will not take effect for a 9729806e231SRuslan Ermilovdevice until a command has been sent to the device. 9739806e231SRuslan ErmilovThe 9749deea857SKenneth D. Merry.Fl a 9759deea857SKenneth D. Merryswitch above will automatically send a Test Unit Ready to the device so 9769deea857SKenneth D. Merrynegotiation parameters will take effect. 97733fab22eSKenneth D. Merry.It Ic format 97896a93c63SKenneth D. MerryIssue the 97996a93c63SKenneth D. Merry.Tn SCSI 98096a93c63SKenneth D. MerryFORMAT UNIT command to the named device. 98196a93c63SKenneth D. Merry.Pp 98296a93c63SKenneth D. Merry.Em WARNING! WARNING! WARNING! 98396a93c63SKenneth D. Merry.Pp 9849806e231SRuslan ErmilovLow level formatting a disk will destroy ALL data on the disk. 9859806e231SRuslan ErmilovUse 9869806e231SRuslan Ermilovextreme caution when issuing this command. 9879806e231SRuslan ErmilovMany users low-level format 9889806e231SRuslan Ermilovdisks that do not really need to be low-level formatted. 9899806e231SRuslan ErmilovThere are 99096a93c63SKenneth D. Merryrelatively few scenarios that call for low-level formatting a disk. 99196a93c63SKenneth D. MerryOne reason for 99296a93c63SKenneth D. Merrylow-level formatting a disk is to initialize the disk after changing 9939806e231SRuslan Ermilovits physical sector size. 9949806e231SRuslan ErmilovAnother reason for low-level formatting a disk 99596a93c63SKenneth D. Merryis to revive the disk if you are getting "medium format corrupted" errors 99696a93c63SKenneth D. Merryfrom the disk in response to read and write requests. 99796a93c63SKenneth D. Merry.Pp 9989806e231SRuslan ErmilovSome disks take longer than others to format. 9999806e231SRuslan ErmilovUsers should specify a 10009806e231SRuslan Ermilovtimeout long enough to allow the format to complete. 10019806e231SRuslan ErmilovThe default format 10029806e231SRuslan Ermilovtimeout is 3 hours, which should be long enough for most disks. 10039806e231SRuslan ErmilovSome hard 100496a93c63SKenneth D. Merrydisks will complete a format operation in a very short period of time 10059806e231SRuslan Ermilov(on the order of 5 minutes or less). 10069806e231SRuslan ErmilovThis is often because the drive 10070227791bSRuslan Ermilovdoes not really support the FORMAT UNIT command -- it just accepts the 100896a93c63SKenneth D. Merrycommand, waits a few minutes and then returns it. 100996a93c63SKenneth D. Merry.Pp 101096a93c63SKenneth D. MerryThe 101196a93c63SKenneth D. Merry.Sq format 10129806e231SRuslan Ermilovsubcommand takes several arguments that modify its default behavior. 10139806e231SRuslan ErmilovThe 101496a93c63SKenneth D. Merry.Fl q 101596a93c63SKenneth D. Merryand 101696a93c63SKenneth D. Merry.Fl y 101796a93c63SKenneth D. Merryarguments can be useful for scripts. 10181252c1bbSRuslan Ermilov.Bl -tag -width 6n 101996a93c63SKenneth D. Merry.It Fl q 10200227791bSRuslan ErmilovBe quiet, do not print any status messages. 10219806e231SRuslan ErmilovThis option will not disable 10229806e231SRuslan Ermilovthe questions, however. 10239806e231SRuslan ErmilovTo disable questions, use the 102496a93c63SKenneth D. Merry.Fl y 102596a93c63SKenneth D. Merryargument, below. 1026e9e4d3e4SKenneth D. Merry.It Fl r 1027e9e4d3e4SKenneth D. MerryRun in 1028e9e4d3e4SKenneth D. Merry.Dq report only 1029e9e4d3e4SKenneth D. Merrymode. 1030e9e4d3e4SKenneth D. MerryThis will report status on a format that is already running on the drive. 103196a93c63SKenneth D. Merry.It Fl w 10329806e231SRuslan ErmilovIssue a non-immediate format command. 10339806e231SRuslan ErmilovBy default, 10347c7fb079SRuslan Ermilov.Nm 10359806e231SRuslan Ermilovissues the FORMAT UNIT command with the immediate bit set. 10369806e231SRuslan ErmilovThis tells the 103796a93c63SKenneth D. Merrydevice to immediately return the format command, before the format has 10389806e231SRuslan Ermilovactually completed. 10399806e231SRuslan ErmilovThen, 10407c7fb079SRuslan Ermilov.Nm 104196a93c63SKenneth D. Merrygathers 104296a93c63SKenneth D. Merry.Tn SCSI 104396a93c63SKenneth D. Merrysense information from the device every second to determine how far along 10449806e231SRuslan Ermilovin the format process it is. 10459806e231SRuslan ErmilovIf the 104696a93c63SKenneth D. Merry.Fl w 104796a93c63SKenneth D. Merryargument is specified, 10487c7fb079SRuslan Ermilov.Nm 104996a93c63SKenneth D. Merrywill issue a non-immediate format command, and will be unable to print any 105096a93c63SKenneth D. Merryinformation to let the user know what percentage of the disk has been 105196a93c63SKenneth D. Merryformatted. 105296a93c63SKenneth D. Merry.It Fl y 10530227791bSRuslan ErmilovDo not ask any questions. 10549806e231SRuslan ErmilovBy default, 10557c7fb079SRuslan Ermilov.Nm 105696a93c63SKenneth D. Merrywill ask the user if he/she really wants to format the disk in question, 10579806e231SRuslan Ermilovand also if the default format command timeout is acceptable. 10589806e231SRuslan ErmilovThe user 105996a93c63SKenneth D. Merrywill not be asked about the timeout if a timeout is specified on the 106096a93c63SKenneth D. Merrycommand line. 106196a93c63SKenneth D. Merry.El 106250c9a276SAlexander Motin.It Ic idle 106372166fbaSAlexander MotinPut ATA device into IDLE state. Optional parameter 106472166fbaSAlexander Motin.Pq Fl t 106572166fbaSAlexander Motinspecifies automatic standby timer value in seconds. Value 0 disables timer. 106650c9a276SAlexander Motin.It Ic standby 106772166fbaSAlexander MotinPut ATA device into STANDBY state. Optional parameter 106872166fbaSAlexander Motin.Pq Fl t 106972166fbaSAlexander Motinspecifies automatic standby timer value in seconds. Value 0 disables timer. 107050c9a276SAlexander Motin.It Ic sleep 107150c9a276SAlexander MotinPut ATA device into SLEEP state. Note that the only way get device out of 107250c9a276SAlexander Motinthis state may be reset. 10731f4782a4SEd Maste.It Ic fwdownload 10741f4782a4SEd MasteProgram firmware of the named SCSI device using the image file provided. 10751f4782a4SEd Maste.Pp 10761f4782a4SEd MasteCurrent list of supported vendors: 10771f4782a4SEd Maste.Bl -bullet -offset indent -compact 10781f4782a4SEd Maste.It 10791f4782a4SEd MasteHITACHI 10801f4782a4SEd Maste.It 10811f4782a4SEd MasteHP 10821f4782a4SEd Maste.It 10831f4782a4SEd MasteIBM 10841f4782a4SEd Maste.It 10851f4782a4SEd MastePLEXTOR 10861f4782a4SEd Maste.It 10871f4782a4SEd MasteQUANTUM 10881f4782a4SEd Maste.It 10891f4782a4SEd MasteSEAGATE 10901f4782a4SEd Maste.El 10911f4782a4SEd Maste.Pp 10921f4782a4SEd Maste.Em WARNING! WARNING! WARNING! 10931f4782a4SEd Maste.Pp 10941f4782a4SEd MasteLittle testing has been done to make sure that different device models from 10951f4782a4SEd Masteeach vendor work correctly with the fwdownload command. 10961f4782a4SEd MasteA vendor name appearing in the supported list means only that firmware of at 10971f4782a4SEd Masteleast one device type from that vendor has successfully been programmed with 10981f4782a4SEd Mastethe fwdownload command. 10991f4782a4SEd MasteExtra caution should be taken when using this command since there is no 11001f4782a4SEd Masteguarantee it will not break a device from the listed vendors. 11011f4782a4SEd MasteEnsure that you have a recent backup of the data on the device before 11021f4782a4SEd Masteperforming a firmware update. 11031f4782a4SEd Maste.Bl -tag -width 11n 11041f4782a4SEd Maste.It Fl f Ar fw_image 11051f4782a4SEd MastePath to the firmware image file to be downloaded to the specified device. 11061f4782a4SEd Maste.It Fl y 11071f4782a4SEd MasteDo not ask for confirmation. 11081f4782a4SEd Maste.It Fl s 11091f4782a4SEd MasteRun in simulation mode. 11101f4782a4SEd MastePacket sizes that will be sent are shown, but no actual packet is sent to the 11111f4782a4SEd Mastedevice. 11121f4782a4SEd MasteNo confimation is asked in simulation mode. 11131f4782a4SEd Maste.It Fl v 11141f4782a4SEd MasteBesides showing sense information in case of a failure, the verbose option 11151f4782a4SEd Mastecauses 11161f4782a4SEd Maste.Nm 11171f4782a4SEd Masteto output a line for every firmware segment that is sent to the device by the 11181f4782a4SEd Mastefwdownload command 11191f4782a4SEd Maste-- the same as the ones shown in simulation mode. 11201f4782a4SEd Maste.El 112133fab22eSKenneth D. Merry.It Ic help 11225a251d70SKenneth D. MerryPrint out verbose usage information. 1123525689f1SJustin T. Gibbs.El 1124525689f1SJustin T. Gibbs.Sh ENVIRONMENT 1125525689f1SJustin T. GibbsThe 1126525689f1SJustin T. Gibbs.Ev SCSI_MODES 1127525689f1SJustin T. Gibbsvariable allows the user to specify an alternate mode page format file. 1128525689f1SJustin T. Gibbs.Pp 1129525689f1SJustin T. GibbsThe 1130525689f1SJustin T. Gibbs.Ev EDITOR 1131525689f1SJustin T. Gibbsvariable determines which text editor 11327c7fb079SRuslan Ermilov.Nm 1133525689f1SJustin T. Gibbsstarts when editing mode pages. 1134525689f1SJustin T. Gibbs.Sh FILES 1135525689f1SJustin T. Gibbs.Bl -tag -width /usr/share/misc/scsi_modes -compact 1136525689f1SJustin T. Gibbs.It Pa /usr/share/misc/scsi_modes 1137525689f1SJustin T. Gibbsis the SCSI mode format database. 1138525689f1SJustin T. Gibbs.It Pa /dev/xpt0 1139525689f1SJustin T. Gibbsis the transport layer device. 1140525689f1SJustin T. Gibbs.It Pa /dev/pass* 1141525689f1SJustin T. Gibbsare the CAM application passthrough devices. 1142525689f1SJustin T. Gibbs.El 1143525689f1SJustin T. Gibbs.Sh EXAMPLES 1144525689f1SJustin T. Gibbs.Dl camcontrol eject -n cd -u 1 -v 1145525689f1SJustin T. Gibbs.Pp 1146525689f1SJustin T. GibbsEject the CD from cd1, and print SCSI sense information if the command 1147525689f1SJustin T. Gibbsfails. 1148525689f1SJustin T. Gibbs.Pp 1149b3550398SKenneth D. Merry.Dl camcontrol tur da0 1150525689f1SJustin T. Gibbs.Pp 1151525689f1SJustin T. GibbsSend the SCSI test unit ready command to da0. 1152e1205e80SPhilippe CharnierThe 11537c7fb079SRuslan Ermilov.Nm 1154e1205e80SPhilippe Charnierutility will report whether the disk is ready, but will not display sense 1155525689f1SJustin T. Gibbsinformation if the command fails since the 1156525689f1SJustin T. Gibbs.Fl v 1157525689f1SJustin T. Gibbsswitch was not specified. 1158c7938743SMike Pritchard.Bd -literal -offset indent 1159c60e19a8SKenneth D. Merrycamcontrol tur da1 -E -C 4 -t 50 -v 1160525689f1SJustin T. Gibbs.Ed 1161525689f1SJustin T. Gibbs.Pp 11629806e231SRuslan ErmilovSend a test unit ready command to da1. 11639806e231SRuslan ErmilovEnable kernel error recovery. 11649806e231SRuslan ErmilovSpecify a retry count of 4, and a timeout of 50 seconds. 11659806e231SRuslan ErmilovEnable sense 1166525689f1SJustin T. Gibbsprinting (with the 1167525689f1SJustin T. Gibbs.Fl v 11689806e231SRuslan Ermilovflag) if the command fails. 11699806e231SRuslan ErmilovSince error recovery is turned on, the 1170525689f1SJustin T. Gibbsdisk will be spun up if it is not currently spinning. 1171e1205e80SPhilippe CharnierThe 11727c7fb079SRuslan Ermilov.Nm 1173e1205e80SPhilippe Charnierutility will report whether the disk is ready. 1174c7938743SMike Pritchard.Bd -literal -offset indent 1175525689f1SJustin T. Gibbscamcontrol cmd -n cd -u 1 -v -c "3C 00 00 00 00 00 00 00 0e 00" \e 1176525689f1SJustin T. Gibbs -i 0xe "s1 i3 i1 i1 i1 i1 i1 i1 i1 i1 i1 i1" 1177525689f1SJustin T. Gibbs.Ed 1178525689f1SJustin T. Gibbs.Pp 11799806e231SRuslan ErmilovIssue a READ BUFFER command (0x3C) to cd1. 11809806e231SRuslan ErmilovDisplay the buffer size of cd1, 11819806e231SRuslan Ermilovand display the first 10 bytes from the cache on cd1. 11829806e231SRuslan ErmilovDisplay SCSI sense 1183525689f1SJustin T. Gibbsinformation if the command fails. 1184c7938743SMike Pritchard.Bd -literal -offset indent 11858604fe2eSSADA Kenjicamcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e 1186525689f1SJustin T. Gibbs -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 1187525689f1SJustin T. Gibbs.Ed 1188525689f1SJustin T. Gibbs.Pp 11899806e231SRuslan ErmilovIssue a WRITE BUFFER (0x3B) command to cd1. 11909806e231SRuslan ErmilovWrite out 10 bytes of data, 11919806e231SRuslan Ermilovnot including the (reserved) 4 byte header. 11929806e231SRuslan ErmilovPrint out sense information if 11939806e231SRuslan Ermilovthe command fails. 11949806e231SRuslan ErmilovBe very careful with this command, improper use may 1195525689f1SJustin T. Gibbscause data corruption. 1196c7938743SMike Pritchard.Bd -literal -offset indent 1197c60e19a8SKenneth D. Merrycamcontrol modepage da3 -m 1 -e -P 3 119894d09127SKenneth D. Merry.Ed 1199525689f1SJustin T. Gibbs.Pp 1200525689f1SJustin T. GibbsEdit mode page 1 (the Read-Write Error Recover page) for da3, and save the 12019806e231SRuslan Ermilovsettings on the drive. 12029806e231SRuslan ErmilovMode page 1 contains a disk drive's auto read and 1203525689f1SJustin T. Gibbswrite reallocation settings, among other things. 1204525689f1SJustin T. Gibbs.Pp 12055710d224SKenneth D. Merry.Dl camcontrol rescan all 12065710d224SKenneth D. Merry.Pp 12075710d224SKenneth D. MerryRescan all SCSI busses in the system for devices that have been added, 12085710d224SKenneth D. Merryremoved or changed. 12095710d224SKenneth D. Merry.Pp 1210525689f1SJustin T. Gibbs.Dl camcontrol rescan 0 1211525689f1SJustin T. Gibbs.Pp 1212525689f1SJustin T. GibbsRescan SCSI bus 0 for devices that have been added, removed or changed. 1213525689f1SJustin T. Gibbs.Pp 1214525689f1SJustin T. Gibbs.Dl camcontrol rescan 0:1:0 1215525689f1SJustin T. Gibbs.Pp 1216525689f1SJustin T. GibbsRescan SCSI bus 0, target 1, lun 0 to see if it has been added, removed, or 1217525689f1SJustin T. Gibbschanged. 12189deea857SKenneth D. Merry.Pp 1219c60e19a8SKenneth D. Merry.Dl camcontrol tags da5 -N 24 12209deea857SKenneth D. Merry.Pp 12219deea857SKenneth D. MerrySet the number of concurrent transactions for da5 to 24. 1222c7938743SMike Pritchard.Bd -literal -offset indent 12239deea857SKenneth D. Merrycamcontrol negotiate -n da -u 4 -T disable 12249deea857SKenneth D. Merry.Ed 12259deea857SKenneth D. Merry.Pp 12269deea857SKenneth D. MerryDisable tagged queueing for da4. 1227c7938743SMike Pritchard.Bd -literal -offset indent 12289deea857SKenneth D. Merrycamcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a 12299deea857SKenneth D. Merry.Ed 12309deea857SKenneth D. Merry.Pp 12319806e231SRuslan ErmilovNegotiate a sync rate of 20MHz and an offset of 15 with da3. 12329806e231SRuslan ErmilovThen send a 12339deea857SKenneth D. MerryTest Unit Ready command to make the settings take effect. 123406e79492SKenneth D. Merry.Bd -literal -offset indent 123506e79492SKenneth D. Merrycamcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1" 123606e79492SKenneth D. Merry.Ed 123706e79492SKenneth D. Merry.Pp 123806e79492SKenneth D. MerrySend the SMP REPORT GENERAL command to ses0, and display the number of PHYs 123906e79492SKenneth D. Merryit contains. 124006e79492SKenneth D. MerryDisplay SMP errors if the command fails. 1241525689f1SJustin T. Gibbs.Sh SEE ALSO 1242525689f1SJustin T. Gibbs.Xr cam 3 , 12439deea857SKenneth D. Merry.Xr cam_cdbparse 3 , 1244c0bdb22bSMatthew Hunt.Xr cam 4 , 1245525689f1SJustin T. Gibbs.Xr pass 4 , 1246c0bdb22bSMatthew Hunt.Xr xpt 4 1247525689f1SJustin T. Gibbs.Sh HISTORY 1248525689f1SJustin T. GibbsThe 12497c7fb079SRuslan Ermilov.Nm 1250e1205e80SPhilippe Charnierutility first appeared in 1251525689f1SJustin T. Gibbs.Fx 3.0 . 1252525689f1SJustin T. Gibbs.Pp 1253525689f1SJustin T. GibbsThe mode page editing code and arbitrary SCSI command code are based upon 1254525689f1SJustin T. Gibbscode in the old 1255525689f1SJustin T. Gibbs.Xr scsi 8 1256525689f1SJustin T. Gibbsutility and 1257525689f1SJustin T. Gibbs.Xr scsi 3 12589806e231SRuslan Ermilovlibrary, written by Julian Elischer and Peter Dufault. 12599806e231SRuslan ErmilovThe 1260525689f1SJustin T. Gibbs.Xr scsi 8 1261753d686dSRuslan Ermilovprogram first appeared in 1262753d686dSRuslan Ermilov.Bx 386 0.1.2.4 , 1263753d686dSRuslan Ermilovand first appeared in 126433fab22eSKenneth D. Merry.Fx 1265525689f1SJustin T. Gibbsin 1266525689f1SJustin T. Gibbs.Fx 2.0.5 . 1267525689f1SJustin T. Gibbs.Sh AUTHORS 1268aa7c9adaSMike Pritchard.An Kenneth Merry Aq ken@FreeBSD.org 1269525689f1SJustin T. Gibbs.Sh BUGS 12700227791bSRuslan ErmilovThe code that parses the generic command line arguments does not know that 12719806e231SRuslan Ermilovsome of the subcommands take multiple arguments. 12729806e231SRuslan ErmilovSo if, for instance, you 1273525689f1SJustin T. Gibbstried something like this: 1274c7938743SMike Pritchard.Bd -literal -offset indent 1275b9e3972aSKenneth D. Merrycamcontrol cmd -n da -u 1 -c "00 00 00 00 00 v" 0x00 -v 1276525689f1SJustin T. Gibbs.Ed 1277525689f1SJustin T. Gibbs.Pp 1278525689f1SJustin T. GibbsThe sense information from the test unit ready command would not get 1279525689f1SJustin T. Gibbsprinted out, since the first 1280525689f1SJustin T. Gibbs.Xr getopt 3 1281525689f1SJustin T. Gibbscall in 12827c7fb079SRuslan Ermilov.Nm 1283525689f1SJustin T. Gibbsbails out when it sees the second argument to 1284525689f1SJustin T. Gibbs.Fl c 1285c4d9468eSRuslan Ermilov(0x00), 12869806e231SRuslan Ermilovabove. 12879806e231SRuslan ErmilovFixing this behavior would take some gross code, or changes to the 1288525689f1SJustin T. Gibbs.Xr getopt 3 12899806e231SRuslan Ermilovinterface. 12909806e231SRuslan ErmilovThe best way to circumvent this problem is to always make sure 1291525689f1SJustin T. Gibbsto specify generic 12927c7fb079SRuslan Ermilov.Nm 1293525689f1SJustin T. Gibbsarguments before any command-specific arguments. 1294