xref: /onnv-gate/usr/src/uts/common/io/pshot.conf (revision 12776:0a254b4b5ca4)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*12776SJames.McPherson@Sun.COM# Common Development and Distribution License (the "License").
6*12776SJames.McPherson@Sun.COM# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
22*12776SJames.McPherson@Sun.COM# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate#
240Sstevel@tonic-gate
250Sstevel@tonic-gate#
260Sstevel@tonic-gate# pshot is a pseudo driver for use in tests, together with another
270Sstevel@tonic-gate# pseudo driver, gen_drv.  These drivers' binaries are contained
28*12776SJames.McPherson@Sun.COM# in the system/io/tests package (formerly known as SUNWiotu
29*12776SJames.McPherson@Sun.COM# and SUNWiotux).
300Sstevel@tonic-gate# These packages are not bundled as part of Solaris however.
310Sstevel@tonic-gate#
320Sstevel@tonic-gate# Once installed, these drivers may be enabled by running add_drv:
330Sstevel@tonic-gate#
340Sstevel@tonic-gate#	add_drv -i 'SUNW,pshot' pshot
350Sstevel@tonic-gate#	add_drv -i 'SUNW,gen_drv' gen_drv
360Sstevel@tonic-gate#
370Sstevel@tonic-gate
380Sstevel@tonic-gatename="pshot" class="root";
390Sstevel@tonic-gate
400Sstevel@tonic-gate
410Sstevel@tonic-gate#
420Sstevel@tonic-gate# How to add support for devices not included with the stock package, by
430Sstevel@tonic-gate# certain array properties:
440Sstevel@tonic-gate# (see pshot.h for the values of the <PSHOT_PROP_DEV.*> property names)
450Sstevel@tonic-gate#
460Sstevel@tonic-gate#
470Sstevel@tonic-gate# corresponding         |   pshot_device_t array elements
480Sstevel@tonic-gate# pshot_device_t        |
490Sstevel@tonic-gate# member by prop name   |   [0]            [1]           [2]
500Sstevel@tonic-gate# ----------------------|--------------|-------------|-----------------------
510Sstevel@tonic-gate# <PSHOT_PROP_DEVNAME>  ="disk",        "tape",       "testdev";
520Sstevel@tonic-gate# <PSHOT_PROP_DEVNT>    ="DDI_NT_BLOCK","DDI_NT_TAPE","ddi_testdev_nodetype";
530Sstevel@tonic-gate# <PSHOT_PROP_DEVCOMPAT>="testdrv",     "testdrv",    "testdrv";
540Sstevel@tonic-gate#
550Sstevel@tonic-gate#
560Sstevel@tonic-gate# this example adds 3 devices that may be parented by pshot:
570Sstevel@tonic-gate#			dev1		dev2		dev3
580Sstevel@tonic-gate#			----		----		----
590Sstevel@tonic-gate# node name:		disk		tape		testdev
600Sstevel@tonic-gate# node type:		DDI_NT_BLOCK	DDI_NT_TAPE	"ddi_testdev_nodetype"
610Sstevel@tonic-gate# compatible driver:	testdrv		testdrv		testdrv
620Sstevel@tonic-gate#
630Sstevel@tonic-gate# if any of these properties are specified, then:
640Sstevel@tonic-gate# - all the members must be specified
650Sstevel@tonic-gate# - the number of elements for each string array property must be the same
660Sstevel@tonic-gate# - no empty strings allowed
670Sstevel@tonic-gate# - nodetypes (PSHOT_PROP_DEVNT) must be the nodetype name as specified in
680Sstevel@tonic-gate#   sys/sunddi.h -- caveat: see below
690Sstevel@tonic-gate#
700Sstevel@tonic-gate# Current implementation allows for overriding of stock devices
710Sstevel@tonic-gate#	e.g. if the "disk" device is bound to the "gen_drv" driver, you may
720Sstevel@tonic-gate#	override that with your own driver,
730Sstevel@tonic-gate# as well as custom nodetypes
740Sstevel@tonic-gate#	i.e. if a value for <PSHOT_PROP_DEVNT> does not not match a known
750Sstevel@tonic-gate#	nodetype name, such as "DDI_NT_BLOCK" etc., then the supplied value
760Sstevel@tonic-gate#	will be used verbatim
770Sstevel@tonic-gate#
780Sstevel@tonic-gate# In addition, the current implementation only require that these properties
790Sstevel@tonic-gate# be specified for a single pshot instance in order to apply globably, so it's
800Sstevel@tonic-gate# possible to unclutter a device tree snapshot by applying these properties
810Sstevel@tonic-gate# just to the root pshot instance with a physically single long line of
820Sstevel@tonic-gate# property assignments:
830Sstevel@tonic-gate#    name="pshot" parent="/" <PSHOT_PROP_DEVNAME>="..",".." <PSHOT_PROP*>= ..;
840Sstevel@tonic-gate#
85