summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
Commit message (Collapse)AuthorAgeFilesLines
* The camcontrol smppc option to clear a PHY error log is 'clearerrlog',ken2011-01-051-1/+1
| | | | not 'clearerrorlog'.
* Fix a few issues related to the XPT_GDEV_ADVINFO CCB.ken2010-12-101-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | camcontrol.c: In buildbusdevlist(), don't attempt to get call getdevid() for an unconfigured device, even when the verbose flag is set. The cam_open_btl() call will almost certainly fail. Probe for the buffer size when issuing the XPT_GDEV_ADVINFO CCB. Probing for the buffer size first helps us avoid allocating the maximum buffer size when it really may not be necessary. This also helps avoid errors from cam_periph_mapmem() if we attempt to map more than MAXPHYS. cam_periph.c: In cam_periph_mapmem(), if the XPT_GDEV_ADVINFO CCB shows a bufsiz of 0, we don't have anything to map, so just return. Also, set the maximum mapping size to MAXPHYS instead of DFLTPHYS for XPT_GDEV_ADVINFO CCBs, since they don't actually go down to the hardware. scsi_pass.c: Don't bother mapping the buffer in XPT_GDEV_ADVINFO CCBs if bufsiz is 0.
* Add Serial Management Protocol (SMP) passthrough support to CAM.ken2010-11-302-12/+1538
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes support in the kernel, camcontrol(8), libcam and the mps(4) driver for SMP passthrough. The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00 to determine supported pages, and will now fetch page 0x83 in addition to page 0x80 if supported. Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO. The SMP CCB is intended for SMP requests and responses. The ADVINFO is currently used to fetch cached VPD page 0x83 data from the transport layer, but is intended to be extensible to fetch other types of device-specific data. SMP-only devices are not currently represented in the CAM topology, and so the current semantics are that the SIM will route SMP CCBs to either the addressed device, if it contains an SMP target, or its parent, if it contains an SMP target. (This is noted in cam_ccb.h, since it will change later once we have the ability to have SMP-only devices in CAM's topology.) smp_all.c, smp_all.h: New helper routines for SMP. This includes SMP request building routines, response parsing routines, error decoding routines, and structure definitions for a number of SMP commands. libcam/Makefile: Add smp_all.c to libcam, so that SMP functionality is available to userland applications. camcontrol.8, camcontrol.c: Add smp passthrough support to camcontrol. Several new subcommands are now available: 'smpcmd' functions much like 'cmd', except that it allows the user to send generic SMP commands. 'smprg' sends the SMP report general command, and displays the decoded output. It will automatically fetch extended output if it is available. 'smppc' sends the SMP phy control command, with any number of potential options. Among other things, this allows the user to reset a phy on a SAS expander, or disable a phy on an expander. 'smpmaninfo' sends the SMP report manufacturer information and displays the decoded output. 'smpphylist' displays a list of phys on an expander, and the CAM devices attached to those phys, if any. cam.h, cam.c: Add a status value for SMP errors (CAM_SMP_STATUS_ERROR). Add a missing description for CAM_SCSI_IT_NEXUS_LOST. Add support for SMP commands to cam_error_string(). cam_ccb.h: Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH. SMP commands are by nature bi-directional, and we may need to support bi-directional SCSI commands later. Add the XPT_SMP_IO CCB. Since SMP commands are bi-directional, there are pointers for both the request and response. Add a fill routine for SMP CCBs. Add the XPT_GDEV_ADVINFO CCB. This is currently used to fetch cached page 0x83 data from the transport later, but is extensible to fetch many other types of data. cam_periph.c: Add support in cam_periph_mapmem() for XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. cam_xpt.c: Add support for executing XPT_SMP_IO CCBs. cam_xpt_internal.h: Add fields for VPD pages 0x00 and 0x83 in struct cam_ed. scsi_all.c: Add scsi_get_sas_addr(), a function that parses VPD page 0x83 data and pulls out a SAS address. scsi_all.h: Add VPD page 0x00 and 0x83 structures, and a prototype for scsi_get_sas_addr(). scsi_pass.c: Add support for mapping buffers in XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. scsi_xpt.c: In the SCSI probe code, first ask the device for VPD page 0x00. If any VPD pages are supported, that page is required to be implemented. Based on the response, we may probe for the serial number (page 0x80) or device id (page 0x83). Add support for the XPT_GDEV_ADVINFO CCB. sys/conf/files: Add smp_all.c. mps.c: Add support for passing in a uio in mps_map_command(), so we can map a S/G list at once. Add support for SMP passthrough commands in mps_data_cb(). SMP is a special case, because the first buffer in the S/G list is outbound and the second buffer is inbound. Add support for warning the user if the busdma code comes back with more buffers than will work for the command. This will, for example, help the user determine why an SMP command failed if busdma comes back with three buffers. mps_pci.c: Add sys/uio.h. mps_sas.c: Add the SAS address and the parent handle to the list of fields we pull from device page 0 and cache in struct mpssas_target. These are needed for SMP passthrough. Add support for the XPT_SMP_IO CCB. For now, this CCB is routed to the addressed device if it supports SMP, or to its parent if it does not and the parent does. This is necessary because CAM does not currently support SMP-only nodes in the topology. Make SMP passthrough support conditional on __FreeBSD_version >= 900026. This will make it easier to MFC this change to the driver without MFCing the CAM changes as well. mps_user.c: Un-staticize mpi_init_sge() so we can use it for the SMP passthrough code. mpsvar.h: Add a uio and iovecs into struct mps_command for SMP passthrough commands. Add a cm_max_segs field to struct mps_command so that we can warn the user if busdma comes back with too many segments. Clear the cm_reply when a command gets freed. If it is not cleared, reply frames will eventually get freed into the pool multiple times and corrupt the pool. (This fix is from scottl.) Add a prototype for mpi_init_sge(). sys/param.h: Bump __FreeBSD_version to 900026 for the for the inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO CAM CCBs.
* When doing a camcontrol rescan all or a camcontrol reset all, use the wildcardrstone2010-11-191-0/+1
| | | | | | | | | | path id for enumerating the available busses. Previously camcontrol was implicitly passing 0 as the first path id, which meant that if bus 0 was not present camcontrol would fail with EINVAL instead of rescanning/resetting any busses that were present. Approved by: emaste (mentor) MFC after: 1 week
* r214781 caused the timer value to be rounded down, so that if the user askedbrucec2010-11-041-6/+4
| | | | | | | for 59 minutes 30 was sent to the drive. The timer value is now always rounded up. Reported by: mav
* Fix standby timer calculation: the timer was being set 30 minutes laterbrucec2010-11-041-1/+8
| | | | | | | | than the user requested. Also, 21 minutes is encoded as 252 and 22-29 minutes cannot be encoded so must be rounded up to 30. PR: bin/151871
* Do some whitespace and `identify` output cleanup.mav2010-10-251-50/+57
| | | | | Submitted by: arundel MFC after: 2 weeks
* Stop disallowing device nodes to be passed to camcontrol(8) since libcambrucec2010-10-192-12/+1
| | | | | | already allows both device names and nodes to be specified. Reviewed by: avg
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-081-6/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* MFtbemd:imp2010-08-231-1/+2
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* Spelling fixes.joel2010-07-311-1/+1
|
* Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers tomav2010-07-251-0/+10
| | | | | GEOM. This information needed for proper soft-RAID's on-disk metadata reading and writing.
* Correct explanation for idle and standby subcommands' -t argument.mav2010-07-011-5/+7
|
* Initialize variables before usage.uqs2010-06-111-0/+1
| | | | | Found by: clang static analyzer Found by: Coverity Prevent[tm] (CID 7736, 7760)
* Make SATA XPT negotiate and enable some additional SATA features, such as:mav2010-05-021-0/+4
| | | | | | | - device initiated power management (some devices support only this way); - Automatic Partial to Slumber Transition (more power saving); - DMA auto-activation (expected to slightly improve performance). More features could be added later, when hardware supports.
* Add -d and -f arguments to `camcontrol cmd`, to execute DMA ATA commands.mav2010-05-022-3/+21
|
* Improve output for controllers that doesn't report SATA speed.mav2010-02-221-0/+2
|
* - Give ATA/SATA SIMs info about ATAPI packet size, supported by device.mav2010-02-021-2/+14
| | | | | - Make ATA XPT to reject longer SCSI CDBs then supported by device, or any SCSI CDBs, if device doesn't support ATAPI.
* - Add -v argument to `camcontrol identify` command. It makes camcontrolmav2010-01-202-16/+34
| | | | | print full identify data block. - Improve identify result view and add TRIM support.
* MFp4:mav2009-11-262-51/+72
| | | | Improve ATA mode/SATA revision control.
* MFp4:mav2009-11-241-14/+69
| | | | | | | | | | | | - Extend XPT-SIM transfer settings control API. Now it allows to report to SATA SIM number of tags supported by each device, implement ATA mode and SATA revision negotiation for both SATA and PATA SIMs. - Make ahci(4) and siis(4) to use submitted maximum tag number, when scheduling requests. It allows to support NCQ on devices with lower tags count then controller supports. - Make PMP driver to report attached devices connection speeds. - Implement ATA mode negotiation between user settings, device and controller capabilities.
* Fix variable type.mav2009-11-091-1/+1
|
* Add support for ATA Power Management.mav2009-11-092-3/+134
|
* MFp4:mav2009-11-041-0/+4
| | | | | | - Add support for sector size > 512 bytes and physical sector of several logical sectors, introduced by ATA-7 specification. - Remove some obsoleted code.
* MFp4:mav2009-10-311-40/+57
| | | | | Sync connection speed reporting with kernel. Report speed in identify command, same as done by inquiry.
* Switch the default WARNS level for sbin/ to 6.ru2009-10-191-2/+0
| | | | Submitted by: Ulrich Spörlein
* Fethch more information from IDENTIFY result.mav2009-09-271-15/+48
|
* MFp4:mav2009-09-221-12/+11
| | | | Reduce code duplication.
* Add to `camcontrol cmd` support for sending arbitrary ATA commands.mav2009-09-042-52/+141
| | | | | | It could be used for broad range of tasks, such as configuring drive power management modes, caching, security and any other features and tasks, not supported by existing drivers.
* Short ATA command format has 28bit address, not 36bit.mav2009-08-301-2/+2
| | | | | | Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy. MFC after: 2 days
* MFp4:mav2009-08-301-27/+120
| | | | | | | - Tune protocol version reporting, - Add supported DMA/PIO modes reporting. - Fix IDENTIFY for ATAPI devices. - Remove confusing "-" for NCQ status.
* Fix alignment issue with ATA IDENTIFY structure.scottl2009-07-101-11/+11
| | | | Approved by: re
* Separate the parallel scsi knowledge out of the core of the XPT, andscottl2009-07-102-6/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re
* Add SCSI READ CAPACITY support to camcontrol. The new 'readcap' subcommandken2007-09-083-5/+283
| | | | | | | | | | | | will automatically issue the 16 byte verison of read capacity if the device in question is larger than 2TB. There are also a number of output options here (last block, number of blocks, human readable) that should meet most needs, and also aid in scripting. Approved by: re (bmah) MFC after: 1 week
* typo: s/tranport layer/transport layer/wilko2007-01-281-2/+2
| | | | MFC after: 1 week
* It's confusing to say that "Command Queueing Supported" just basedmjacob2006-12-031-3/+2
| | | | | upon the scsi flag validity field. Instead, just say "Command Queueing Enabled" when it is- otherwise remain mute.
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEmjacob2006-11-021-93/+143
| | | | | | as the default. Reviewed by multitudes.
* Markup fixes.ru2006-09-181-2/+2
|
* Implement 'camcontrol reportluns'. This allows users to send the SCSIken2006-08-212-2/+300
| | | | | | | | | | | | | | | | | | REPORT LUNS command to a device. camcontrol.[c8]: Implement reportluns. This tries to print the LUNs out in a reasonable format. Only the periph addressing method has been tested, since very little hardware that I know of supports the other methods. scsi_all.[ch]: Revamp the report luns CDB structure and helper functions. This constitutes a little bit of an API change, but since the old CDB length was 10 bytes, and the REPORT LUNS CDB length is actually 12 bytes, it's clear that no one was using this API in the first place. MFC After: 1 week
* Markup fixes.ru2005-06-141-1/+1
| | | | Approved by: re (blanket)
* Add "report only" functionality to 'camcontrol format', so users can get aken2005-03-262-5/+20
| | | | | | | | | | report on the status of a format already running on a drive. Fix status reporting for 'camcontrol format'. This was broken in rev 1.34 of camcontrol.c, almost 4 years ago! Submitted by: joerg (most of the reportonly changes) MFC after: 3 days
* Expand *n't contractions.ru2005-02-131-12/+12
|
* Deal with double whitespace.ru2004-07-031-2/+2
|
* Mechanically kill hard sentence breaks.ru2004-07-021-100/+197
|
* Use WARNS?=3 for these in the arm case for now, due to toolchain issues.cognet2004-05-141-0/+4
|
* Fix a couple of camcontrol issues that popped up on sparc64:ken2004-03-031-2/+12
| | | | | | | | | | | | - bzero the CCB header in getdevtree() and set the path properly, to avoid having random garbage in the CCB header. - if the lun isn't specified in a device specifier, it should default to 0, not whatever random data happens to be in the lun variable. - move the prototype for getdevtree() out from under #ifndef MINIMALISTIC, since it is used in both cases. Submitted by: Marius Strobl <marius@alchemy.franken.de> (mostly) MFC After: 2 weeks
* Userland signed char fixes for PPC build. Problems were using a chargrehan2004-01-221-4/+6
| | | | | | | | | return for getopt() and comparing to -1, ditto with fgetc() and EOF, and using the kg_nice value from <sys/user.h> Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: obrien, bde (a while back) Tested lightly on: ppc, i386, make universe
* Fix alignment of the trailing \imp2003-08-221-1/+1
|
* Make this WARNS=6 clean by:johan2003-08-054-41/+41
| | | | | | | | | | | | | | | | | | | | 1: add 'const' to char * where needed; 2: mark unused variables with __unused; 3: remove double prototypes for mode_edit and mode_list. 4: moves the global variables 'bus', 'target', and 'lun' into the main function and protect them with #ifndef MINIMALISTIC, 5: renames 3 variable in order not to shadow other things index -> indx -- in modepage_dump since index is a function from <strings.h.> arglist -> arglst -- in the function parse_btl since arglist is also a global variable convertend -> convertend2 -- in the function editentry_set since that name is used two times within the function. 6: cast 0xffffffff in the macro RESOLUTION_MAX(size) to (int) since it is unsigned otherwise. Tested by: make universe Approved by: ken
* Remove MAINTAINER= lines in the makefiles for camcontrol, iostat, libcamken2003-06-141-2/+0
| | | | | | | | and libdevstat, since the new way of doing things is to just list maintainership in src/MAINTAINERS. Also, remove duplicate entries in src/MAINTAINERS for those utilities. I already had entries for them.
OpenPOWER on IntegriCloud