summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
Commit message (Collapse)AuthorAgeFilesLines
* Fix character case in examples for "camcontrol security" - should begavin2014-08-311-3/+3
| | | | | | | | "-U user" not "-u user". PR: 193179 Submitted by: milios ccsys com MFC after: 3 days
* Add persistent reservation support to camcontrol(8).ken2014-07-035-9/+1351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | camcontrol(8) now supports a new 'persist' subcommand that allows users to issue SCSI PERSISTENT RESERVE IN / OUT commands. sbin/camcontrol/Makefile: Add persist.c. sbin/camcontrol/persist.c: New persistent reservation support for camcontrol(8). We have support for all known operation modes for PERSISTENT RESERVE IN and PERSISTENT RESERVE OUT. exceptions noted above. sbin/camcontrol/camcontrol.8: Document the new 'persist' subcommand. In the section on the Transport ID (-I) option, explain what Transport IDs for each protocol should look like. At some point some of this information could probably get moved off in a separate man page, either on Transport IDs alone or a man page documenting the Transport ID parsing code. Add a number of examples of persistent reservation commands. Persistent Reservations are complex enough that the average user probably won't be able to get the commands exactly right by just reading the man page. These examples show a few basic and advanced examples of how to use persistent reservations. sbin/camcontrol/camcontrol.h: Move the definition for camcontrol_optret here, so we can use it for the persistent reservation code. Add a definition for the new scsipersist() function. sbin/camcontrol/camcontrol.c: Add 'persist' to the list of subcommands. Document 'persist' in the help text. sys/cam/scsi/scsi_all.c: Add the scsi_persistent_reserve_in() and scsi_persistent_reserve_out() CCB building functions. Add a new function, scsi_transportid_sbuf(). This takes a SCSI Transport ID (documented in SPC-4), and prints it to an sbuf(9). There are some transports (like ATA, USB, and SSA) for which there is no transport defined. We need to come up with a reasonable thing to do if we're presented with a Transport ID that claims to be for one of those protocols. Add new routines scsi_get_nv() and scsi_nv_to_str(). These functions do a table lookup to go between a string and an integer. There are lots of table lookups needed in the persistent reservation code in camcontrol(8). Add a new function, scsi_parse_transportid(), along with leaf node functions to parse: FC, 1394 and SAS (scsi_parse_transportid_64bit()) iSCSI (scsi_parse_transportid_iscsi()) SPI (scsi_parse_transportid_spi()) RDMA (scsi_parse_transportid_rdma()) PCIe (scsi_parse_transportid_sop()) Transport IDs. Given a string with the general form proto,id these functions create a SCSI Transport ID structure. sys/cam/scsi/scsi_all.h: Update the various persistent reservation data structures to SPC4r36l, but also rename some fields that were previously obsolete with the proper names from older SCSI specs. This allows using older, obsolete persistent reservation types when desired. Add function prototypes for the new persistent reservation CCB building functions. Add a data strucure for the READ FULL STATUS service action of the PERSISTENT RESERVE IN command. Add Transport ID structures for all protocols described in SPC-4. Add a new series of SCSI_PROTO_XXX definitions, and redefine other defines in terms of these new definitions. Add a prototype for scsi_transportid_sbuf(). Change a couple of "obsolete" persistent reservation data structure fields into something more meaningful, based on what the field was called when it was defined in the spec. (e.g. SPC, SPC-2, etc.) Create a new define, SPRI_MAX_LEN, for the maximum allocation length allowed for the PERSISTENT RESERVE IN command. Add data structures and enumerations for the new name/value translation functions. Add data structures for SCSI over PCIe Routing IDs. Bring the PERSISTENT RESERVE OUT Register and Move parameter list structure (struct scsi_per_res_out_parms) up to date with SPC-4. Add a data structure for the transport IDs that can optionally be appended to the basic PERSISTENT RESERVE OUT parameter list. Move SCSI protocol macro definitions out of the VPD page 0x83 definition and combine them with the more up to date protocol definitions higher in the file. Add function prototypes for scsi_nv_to_str(), scsi_get_nv(), scsi_parse_transportid_64bit(), scsi_parse_transportid_spi(), scsi_parse_transportid_rdma(), scsi_parse_transportid_iscsi(), scsi_parse_transportid_sop(), and scsi_parse_transportid(). Sponsored by: Spectra Logic Corporation MFC after: 1 week
* use .Mt to mark up email addresses consistently (part1)bapt2014-06-201-1/+1
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de>
* Add information about supported NCQ functionality to camcontrol identify.smh2014-04-241-0/+26
| | | | MFC after: 2 weeks
* Replace several instances of -1 with appropriate CAM_*_WILDCARD and types.mav2014-01-101-22/+30
| | | | | | It was equal before r259397, but for good or bad, not any more for LUNs. This change fixes at least CAM debugging.
* getopt returns an int, not a char, so use the correct data type forscottl2013-12-301-1/+1
| | | | | | the return value. Fixes powerpc tinderbox. MFC after: 2 days
* Add the '-b' flag to 'camcontrol devlist'. This prints only the existingscottl2013-12-292-8/+31
| | | | | | | buses and their parent sims, useful for creating a sim->bus->device map. Obtained from: Netflix MFC after: 3 days
* printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t.nwhitehorn2013-10-301-2/+2
| | | | MFC after: 2 weeks
* Fix mode page length calculation to remove last garbage line from themav2013-10-111-2/+2
| | | | | | | | `camcontrol mode daX -l` output. PR Approved by: re (gjb) MFC after: 2 weeks
* Fix an inverted check for the master user in "camcontrol security -U".markj2013-10-081-1/+1
| | | | | | | PR: bin/182703 Submitted by: Scott Burns <scott@bqinternet.com> Approved by: re (gjb) MFC after: 3 days
* Fix resource leaksemaste2013-10-071-0/+2
| | | | | Found by: Coverity Scan, CID 1016673, 1007118 Approved by: re
* - Begin sentence on a new line.joel2013-09-071-14/+25
| | | | - Minor language fixes.
* Bump .Dd after r255307 and r255310bryanv2013-09-061-1/+1
| | | | Requested by: joel
* Add firmware downloading support for Samsung drivesbryanv2013-09-062-0/+4
| | | | Tested on Samsung SM1625 SSDs.
* Add camcontrol support for the SCSI sanitize commandbryanv2013-09-062-1/+544
| | | | | Reviewed by: ken, mjacob (eariler version) Sponsored by: Netapp
* Add missing newlines to Fibre Channel attributes output.mav2013-08-271-3/+3
|
* Improve firmware download status check. Previous check was insufficient formav2013-06-141-5/+3
| | | | | ATA since it ignored transport errors like command timeouts, while for SCSI it was just wrong.
* Fix build after r251654.mav2013-06-121-4/+4
|
* Use CAM_DIR_NONE for requests without data.mav2013-06-121-4/+4
| | | | | | Wrong values there confuse some drivers. MFC after: 1 week
* sbin/camcontrol/camcontrol.casomers2013-05-151-2/+6
| | | | | | | | | | | | If an expander returns 0x00 (no device attached) in the ATTACHED DEVICE field of the SMP DISCOVER response, ignore the value of ATTACHED SAS ADDRESS, because it is invalid. Some expanders zero out the address when the attached device is removed, but others do not. Section 9.4.3.10 of the SAS Protocol Layer 2 revision 04b does not require them to do so. Approved by: ken (mentor) MFC after: 3 weeks
* mdoc: remove superfluous paragraph macro.joel2013-04-251-2/+0
|
* Adds Host Protected Area (HPA) support for ATA disks to camcontrolsmh2013-04-252-2/+785
| | | | | | Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Remove contractions.joel2013-04-111-1/+1
|
* Prevent the creation of an unused variable.ed2013-04-081-1/+1
| | | | | | | We're only interested in the enumeration fields; we don't want to create a variable to store them. MFC after: 1 week
* mdoc: new sentence should be on a new line. Also remove EOL whitespace whilejoel2013-04-061-3/+4
| | | | here.
* mdoc: remove superfluous paragraph macro.joel2013-04-051-3/+0
|
* Adds security options to camcontrol this includes the ability to secure erasesmh2013-04-042-61/+1110
| | | | | | | | | | disks such as SSD's Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) comand Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* More -Wmissing-variable-declarations fixes.ed2012-10-194-14/+15
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Check the return value of sbuf_finish().jh2012-08-231-2/+8
|
* Avoid segfault in the 'smpphylist' subcommand.pluknet2012-08-201-1/+1
| | | | | | | | | Initialize devlist.dev_queue tail queue early enough before its any potential traversal in freebusdevlist() when in smpphylist error path. Reported by: Pavel Polyakov <bsd kobyla org> (on irc) Reviewed by: ken MFC after: 5 days
* In sbin/camcontrol/camcontrol.c, function smpcmd(), initialize thedim2012-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'error' variable to zero, to avoid returning garbage in several cases. This fixes the following clang 3.2 warnings: sbin/camcontrol/camcontrol.c:4634:8: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (amt_written == -1) { ^~~~~~~~~~~~~~~~~ sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here return (error); ^~~~~ sbin/camcontrol/camcontrol.c:4619:7: warning: variable 'error' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (fd_response == 0) { ^~~~~~~~~~~~~~~~ sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here return (error); ^~~~~ sbin/camcontrol/camcontrol.c:4617:6: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sbin/camcontrol/camcontrol.c:4656:10: note: uninitialized use occurs here return (error); ^~~~~ MFC after: 1 week
* Change 'camcontrol defects' to first probe a drive to find out how muchken2012-06-222-7/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | defect information it has before grabbing the full defect list. This works around a bug with some Hitachi drives that generate data overrun errors when they are asked for more defect data than they have. The change is done in a spec-compliant way, so it should have no negative impact on drives that don't have this issue. This is based on work originally done at Sandvine. scsi_da.h: Add a define for the maximum amount of data that can be contained in a defect list. camcontrol.c: Update the readdefects() function to issue an initial command to determine the length of the defect list, and then use that length in the request for the full defect list. camcontrol.8: Add a note that some drives will report 0 defects available if you don't request either the PLIST or GLIST. Submitted by: Mark Johnston <markjdb@gmail.com> (original version) MFC after: 3 days
* Add progress.c and progress.h, missed in the previous commit to camcontrol.scottl2012-06-202-0/+246
| | | | | Submitted by: Garrett Cooper Obtained from: Netflix, Inc.
* Update the 'fwdownload' command to also flash disks connected over anscottl2012-06-204-66/+167
| | | | | | | | | | ATA/SATA transport. The detection logic is automatic, so it should Just Work. While here, also improve the progress meter that is displayed during firmware download. Submitted by: Alistair Crooks Obtained from: Netflix, Inc. MFC after: 3 days
* Minor spelling fixes.joel2012-06-051-2/+2
|
* Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBEmav2012-06-042-3/+11
| | | | added at r208911.
* Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ.mav2012-06-021-43/+93
| | | | | | | This allows to control it with `camcontrol negotiate adaX -T (en|dis)able` on the fly, same as for SCSI devices. Sponsored by: iXsystems, Inc.
* Add missing flag enable when certain arguments are parsedeadler2012-05-301-0/+1
| | | | | | | PR: bin/163053 Submitted by: Peter <pmc@citylink.dinoex.sub.org> Approved by: cperciva MFC after: 1 week
* MFprojects/zfsd:mav2012-05-241-1/+20
| | | | | | | | - Add low-level support for SATA Enclosure Management Bridge (SEMB) devices -- SATA equivalents of the SCSI SES/SAF-TE devices. - Add some utility functions for SCSI SAF-TE devices access. Sponsored by: iXsystems, Inc.
* Remove trailing whitespace per mdoc lint warningeadler2012-03-291-2/+2
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Remove superfluous paragraph macro.joel2012-03-251-1/+0
|
* Fix build when RELEASE_CRUNCH is defined.nyan2012-01-291-2/+2
|
* Add CAM infrastructure to allow reporting when a drive's long read capacityken2012-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data changes. cam_ccb.h: Add a new advanced information type, CDAI_TYPE_RCAPLONG, for long read capacity data. cam_xpt_internal.h: Add a read capacity data pointer and length to struct cam_ed. cam_xpt.c: Free the read capacity buffer when a device goes away. While we're here, make sure we don't leak memory for other malloced fields in struct cam_ed. scsi_all.c: Update the scsi_read_capacity_16() to take a uint8_t * and a length instead of just a pointer to the parameter data structure. This will hopefully make this function somewhat immune to future changes in the parameter data. scsi_all.h: Add some extra bit definitions to struct scsi_read_capacity_data_long, and bump up the structure size to the full size specified by SBC-3. Change the prototype for scsi_read_capacity_16(). scsi_da.c: Register changes in read capacity data with the transport layer. This allows the transport layer to send out an async notification to interested parties. Update the dasetgeom() API. Use scsi_extract_sense_len() instead of scsi_extract_sense(). scsi_xpt.c: Add support for the new CDAI_TYPE_RCAPLONG advanced information type. Make sure we set the physpath pointer to NULL after freeing it. This allows blindly freeing it in the struct cam_ed destructor. sys/param.h: Bump __FreeBSD_version from 1000005 to 1000006 to make it easier for third party drivers to determine that the read capacity data async notification is available. camcontrol.c, mptutil/mpt_cam.c: Update these for the new scsi_read_capacity_16() argument structure. Sponsored by: Spectra Logic
* Fix warning when compiling with gcc46:eadler2012-01-102-6/+1
| | | | | | | | | error: variable 'freq' set but not used error: variable 'mode_pars' set but not used Reviewed by: mav Approved by: dim MFC after: 3 days
* Spelling fixes for sbin/uqs2012-01-071-1/+1
|
* In sbin/camcontrol/camcontrol.c, fix a few warnings about format stringsdim2011-12-161-7/+7
| | | | | | not being literals. MFC after: 1 week
* Add missing static keywords to global variables in camcontrol.ed2011-12-112-13/+13
| | | | | While there, make the vendor list const and add appropriate keywords to functions that use this list.
* Restore comment with credit to Marc Frajola.emaste2011-12-021-0/+9
| | | | | fwdownload.c is derived from Andre Albsmeier's fwdownload.c, which was written from scratch but was inspired by Marc's original idea and code.
* Fix build.delphij2011-11-251-1/+1
|
* Add firmware update support for SCSI devices.emaste2011-11-256-29/+488
| | | | | | | | | | | | | | | | | Firmware can be reprogrammed on devices from Hitachi, HP, IBM, Plextor, Quantum, and Seagate. At least one device from each manufacturer has been tested with some version of this code, and it has been used to update thousands of drives so far. The man page suggests having a backup of the drive's data, and the operation must be confirmed, either interactively or on the command line. (This is the same as the confirmation on the format command.) This work is largely derived from fwprog.c by Andre Albsmeier. Submitted by: Nima Misaghian Sponsored by: Sandvine Incorporated MFC after: 3 months
OpenPOWER on IntegriCloud