summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
Commit message (Collapse)AuthorAgeFilesLines
* MFC r274322:bryanv2014-12-091-8/+24
| | | | Attempt to report a better error if sanitize is not supported
* MFC r271588: Update CAM CCB accounting for the new status quo.mav2014-10-141-2/+2
| | | | | | | | | | devq_openings counter lost its meaning after allocation queues has gone. held counter is still meaningful, but problematic to update due to separate locking of CCB allocation and queuing. To fix that replace devq_openings counter with allocated counter. held is now calculated on request as difference between number of allocated, queued and active CCBs.
* Merge 270872 from head:gavin2014-09-031-3/+3
| | | | | | | | Fix character case in examples for "camcontrol security" - should be "-U user" not "-u user". PR: 193179 Submitted by: milios ccsys com
* MFC r268240 (by ken):mav2014-07-155-9/+1351
| | | | | | | Add persistent reservation support to camcontrol(8). camcontrol(8) now supports a new 'persist' subcommand that allows users to issue SCSI PERSISTENT RESERVE IN / OUT commands.
* MFC r264863smh2014-05-081-0/+26
| | | | | | Add information about supported NCQ functionality to camcontrol identify. Sponsored by: Multiplay
* MFC r260509:mav2014-05-081-22/+30
| | | | | | | | Replace several instances of -1 with appropriate CAM_*_WILDCARD and types. It was equal before r259397, but for good or bad, not any more for LUNs. This change fixes at least CAM debugging.
* MFC r260059, r260087:scottl2014-01-022-8/+31
| | | | | | | Add the '-b' flag to 'camcontrol devlist'. This prints only the existing buses and their parent sims, useful for creating a sim->bus->device map. Obtained from: Netflix
* MFC r257345,257382,257388:nwhitehorn2013-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode the upper 32-bits of the LUN, if possible, into the target_lun field as passed directly from the REPORT LUNs response. This allows extended LUN support to work for all LUNs with zeros in the lower 32-bits, which covers most addressing modes without breaking KBI. Behavior for drivers not setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified. Extended LUNs are stored with swizzled 16-bit word order so that, for devices implementing LUN addressing (like SCSI-2), the numerical representation of the LUN is identical with and without PIM_EXTLUNS. Thus setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged. This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE) is provided to transform a lun_id_t into a uint64_t ordered for the wire. This is the second part of work for full 64-bit extended LUN support and is designed to a bridge for stable/10 to the final 64-bit LUN code. The third and final part will involve widening lun_id_t to 64 bits and will not be MFCed. This third part will break the KBI but will keep the KPI unchanged so that all drivers that will care about this can be updated now and not require code changes between HEAD and stable/10. Reviewed by: scottl
* MFC r256317:mav2013-10-111-2/+2
| | | | | | | Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Approved by: re (gjb)
* 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