Home | History | Annotate | Line # | Download | only in scsipi
      1  1.22   andvar /*	$NetBSD: scsi_changer.h,v 1.22 2021/12/31 20:22:49 andvar Exp $	*/
      2   1.4      cgd 
      3   1.1      cgd /*
      4  1.13  thorpej  * Copyright (c) 1996, 1999 Jason R. Thorpe <thorpej (at) and.com>
      5   1.7  thorpej  * All rights reserved.
      6   1.7  thorpej  *
      7   1.7  thorpej  * Partially based on an autochanger driver written by Stefan Grefen
      8   1.7  thorpej  * and on an autochanger driver written by the Systems Programming Group
      9   1.7  thorpej  * at the University of Utah Computer Science Department.
     10   1.7  thorpej  *
     11   1.7  thorpej  * Redistribution and use in source and binary forms, with or without
     12   1.7  thorpej  * modification, are permitted provided that the following conditions
     13   1.7  thorpej  * are met:
     14   1.7  thorpej  * 1. Redistributions of source code must retain the above copyright
     15   1.7  thorpej  *    notice, this list of conditions and the following disclaimer.
     16   1.7  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     17   1.7  thorpej  *    notice, this list of conditions and the following disclaimer in the
     18   1.7  thorpej  *    documentation and/or other materials provided with the distribution.
     19   1.7  thorpej  * 3. All advertising materials mentioning features or use of this software
     20   1.7  thorpej  *    must display the following acknowledgements:
     21   1.7  thorpej  *	This product includes software developed by Jason R. Thorpe
     22   1.7  thorpej  *	for And Communications, http://www.and.com/
     23   1.7  thorpej  * 4. The name of the author may not be used to endorse or promote products
     24   1.7  thorpej  *    derived from this software without specific prior written permission.
     25   1.7  thorpej  *
     26   1.7  thorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     27   1.7  thorpej  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     28   1.7  thorpej  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     29   1.7  thorpej  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     30   1.7  thorpej  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     31   1.7  thorpej  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     32   1.7  thorpej  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     33   1.7  thorpej  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     34   1.7  thorpej  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35   1.7  thorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36   1.7  thorpej  * SUCH DAMAGE.
     37   1.7  thorpej  */
     38   1.7  thorpej 
     39   1.7  thorpej /*
     40   1.2      cgd  * SCSI changer interface description
     41   1.3  mycroft  */
     42   1.3  mycroft 
     43   1.3  mycroft /*
     44   1.7  thorpej  * Partially derived from software written by Stefan Grefen
     45   1.7  thorpej  * (grefen (at) goofy.zdv.uni-mainz.de soon grefen (at) convex.com)
     46   1.1      cgd  * based on the SCSI System by written Julian Elischer (julian (at) tfs.com)
     47   1.1      cgd  * for TRW Financial Systems.
     48   1.1      cgd  *
     49   1.1      cgd  * TRW Financial Systems, in accordance with their agreement with Carnegie
     50   1.1      cgd  * Mellon University, makes this software available to CMU to distribute
     51  1.19    perry  * or use in any manner that they see fit as long as this message is kept with
     52   1.1      cgd  * the software. For this reason TFS also grants any other persons or
     53   1.1      cgd  * organisations permission to use or modify this software.
     54   1.1      cgd  *
     55   1.1      cgd  * TFS supplies this software to be publicly redistributed
     56   1.1      cgd  * on the understanding that TFS is not responsible for the correct
     57   1.1      cgd  * functioning of this software in any circumstances.
     58   1.1      cgd  *
     59   1.1      cgd  * Ported to run under 386BSD by Julian Elischer (julian (at) tfs.com) Sept 1992
     60   1.1      cgd  */
     61   1.7  thorpej 
     62   1.1      cgd /*
     63   1.1      cgd  * SCSI command format
     64   1.1      cgd  */
     65   1.1      cgd 
     66   1.7  thorpej /*
     67   1.7  thorpej  * Exchange the medium in the source element with the medium
     68   1.7  thorpej  * located at the destination element.
     69   1.7  thorpej  */
     70   1.7  thorpej struct scsi_exchange_medium {
     71  1.18  reinoud 	u_int8_t	opcode;
     72   1.7  thorpej #define EXCHANGE_MEDIUM		0xa6
     73  1.18  reinoud 	u_int8_t	byte2;
     74  1.18  reinoud 	u_int8_t	tea[2];	/* transport element address */
     75  1.18  reinoud 	u_int8_t	src[2];	/* source address */
     76  1.18  reinoud 	u_int8_t	fdst[2]; /* first destination address */
     77  1.18  reinoud 	u_int8_t	sdst[2]; /* second destination address */
     78  1.18  reinoud 	u_int8_t	flags;
     79   1.7  thorpej #define EXCHANGE_MEDIUM_INV1	0x01
     80   1.7  thorpej #define EXCHANGE_MEDIUM_INV2	0x02
     81  1.18  reinoud 	u_int8_t	control;
     82   1.7  thorpej };
     83   1.7  thorpej 
     84   1.7  thorpej /*
     85   1.7  thorpej  * Cause the medium changer to check all elements for medium and any
     86   1.7  thorpej  * other status relevant to the element.
     87   1.7  thorpej  */
     88   1.9   mjacob struct scsi_initialize_element_status {
     89  1.18  reinoud 	u_int8_t	opcode;
     90   1.7  thorpej #define INITIALIZE_ELEMENT_STATUS	0x07
     91  1.18  reinoud 	u_int8_t	byte2;
     92  1.18  reinoud 	u_int8_t	reserved[3];
     93  1.18  reinoud 	u_int8_t	control;
     94   1.7  thorpej };
     95   1.7  thorpej 
     96   1.7  thorpej /*
     97   1.7  thorpej  * Request the changer to move a unit of media from the source element
     98   1.7  thorpej  * to the destination element.
     99   1.7  thorpej  */
    100   1.5  mycroft struct scsi_move_medium {
    101  1.18  reinoud 	u_int8_t	opcode;
    102   1.7  thorpej #define MOVE_MEDIUM	0xa5
    103  1.18  reinoud 	u_int8_t	byte2;
    104  1.18  reinoud 	u_int8_t	tea[2];	/* transport element address */
    105  1.18  reinoud 	u_int8_t	src[2];	/* source element address */
    106  1.18  reinoud 	u_int8_t	dst[2];	/* destination element address */
    107  1.18  reinoud 	u_int8_t	reserved[2];
    108  1.18  reinoud 	u_int8_t	flags;
    109   1.7  thorpej #define MOVE_MEDIUM_INVERT	0x01
    110  1.18  reinoud 	u_int8_t	control;
    111   1.1      cgd };
    112   1.1      cgd 
    113   1.7  thorpej /*
    114   1.7  thorpej  * Position the specified transport element (picker) in front of
    115   1.7  thorpej  * the destination element specified.
    116   1.7  thorpej  */
    117   1.5  mycroft struct scsi_position_to_element {
    118  1.18  reinoud 	u_int8_t	opcode;
    119   1.7  thorpej #define POSITION_TO_ELEMENT	0x2b
    120  1.18  reinoud 	u_int8_t	byte2;
    121  1.18  reinoud 	u_int8_t	tea[2];	/* transport element address */
    122  1.18  reinoud 	u_int8_t	dst[2];	/* destination element address */
    123  1.18  reinoud 	u_int8_t	reserved[2];
    124  1.18  reinoud 	u_int8_t	flags;
    125   1.7  thorpej #define POSITION_TO_ELEMENT_INVERT	0x01
    126  1.18  reinoud 	u_int8_t	control;
    127   1.7  thorpej };
    128   1.7  thorpej 
    129   1.7  thorpej /*
    130   1.7  thorpej  * Request that the changer report the status of its internal elements.
    131   1.7  thorpej  */
    132   1.7  thorpej struct scsi_read_element_status {
    133  1.18  reinoud 	u_int8_t	opcode;
    134   1.7  thorpej #define READ_ELEMENT_STATUS	0xb8
    135  1.18  reinoud 	u_int8_t	byte2;
    136   1.7  thorpej #define READ_ELEMENT_STATUS_VOLTAG	0x10	/* report volume tag info */
    137   1.7  thorpej 	/* ...next 4 bits are an element type code... */
    138  1.18  reinoud 	u_int8_t	sea[2];		/* starting element address */
    139  1.18  reinoud 	u_int8_t	count[2];	/* number of elements */
    140  1.18  reinoud 	u_int8_t	reserved0;
    141  1.18  reinoud 	u_int8_t	len[3];		/* length of data buffer */
    142  1.18  reinoud 	u_int8_t	reserved1;
    143  1.18  reinoud 	u_int8_t	control;
    144   1.7  thorpej };
    145   1.7  thorpej 
    146   1.7  thorpej struct scsi_request_volume_element_address {
    147  1.18  reinoud 	u_int8_t	opcode;
    148   1.7  thorpej #define REQUEST_VOLUME_ELEMENT_ADDRESS	0xb5
    149  1.18  reinoud 	u_int8_t	byte2;
    150   1.7  thorpej #define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG	0x10
    151   1.7  thorpej 	/* ...next 4 bits are an element type code... */
    152  1.18  reinoud 	u_int8_t	eaddr[2];	/* element address */
    153  1.18  reinoud 	u_int8_t	count[2];	/* number of elements */
    154  1.18  reinoud 	u_int8_t	reserved0;
    155  1.18  reinoud 	u_int8_t	len[3];		/* length of data buffer */
    156  1.18  reinoud 	u_int8_t	reserved1;
    157  1.18  reinoud 	u_int8_t	control;
    158   1.7  thorpej };
    159   1.7  thorpej 
    160   1.7  thorpej /* XXX scsi_release */
    161   1.7  thorpej 
    162   1.7  thorpej /*
    163   1.7  thorpej  * Data returned by READ ELEMENT STATUS consists of an 8-byte header
    164   1.7  thorpej  * followed by one or more read_element_status_pages.
    165   1.7  thorpej  */
    166   1.7  thorpej struct read_element_status_header {
    167  1.18  reinoud 	u_int8_t	fear[2];  /* first element address reported */
    168  1.18  reinoud 	u_int8_t	count[2]; /* number of elements available */
    169  1.18  reinoud 	u_int8_t	reserved;
    170  1.18  reinoud 	u_int8_t	nbytes[3]; /* byte count of all pages */
    171   1.7  thorpej };
    172   1.7  thorpej 
    173  1.14  thorpej /*
    174  1.14  thorpej  * Data returned by REQUEST VOLUME ELEMENT ADDRESS consists of an 8-byte
    175  1.14  thorpej  * header followed by one or more read_element_status pages (i.e. same
    176  1.14  thorpej  * data format as returned by READ ELEMENT STATUS, except for the initial
    177  1.14  thorpej  * header).
    178  1.14  thorpej  */
    179  1.14  thorpej struct request_volume_element_address_header {
    180  1.18  reinoud 	u_int8_t	fear[2];  /* first element address reported */
    181  1.18  reinoud 	u_int8_t	count[2]; /* number of elements available */
    182  1.18  reinoud 	u_int8_t	sac;	  /* send action code */
    183  1.14  thorpej #define	REQUEST_VOLUME_ELEMENT_ADDRESS_SACMASK	0x1f
    184  1.18  reinoud 	u_int8_t	nbytes[3];/* byte count of all pages */
    185  1.14  thorpej };
    186  1.14  thorpej 
    187   1.7  thorpej struct read_element_status_page_header {
    188  1.18  reinoud 	u_int8_t	type;	/* element type code; see type codes below */
    189  1.18  reinoud 	u_int8_t	flags;
    190   1.7  thorpej #define READ_ELEMENT_STATUS_AVOLTAG	0x40
    191   1.7  thorpej #define READ_ELEMENT_STATUS_PVOLTAG	0x80
    192  1.18  reinoud 	u_int8_t	edl[2];	/* element descriptor length */
    193  1.18  reinoud 	u_int8_t	reserved;
    194  1.18  reinoud 	u_int8_t	nbytes[3]; /* byte count of all descriptors */
    195   1.7  thorpej };
    196   1.7  thorpej 
    197   1.7  thorpej struct read_element_status_descriptor {
    198  1.18  reinoud 	u_int8_t	eaddr[2];	/* element address */
    199  1.18  reinoud 	u_int8_t	flags1;
    200   1.7  thorpej 
    201   1.7  thorpej #define READ_ELEMENT_STATUS_FULL	0x01
    202   1.7  thorpej #define READ_ELEMENT_STATUS_IMPEXP	0x02
    203   1.7  thorpej #define READ_ELEMENT_STATUS_EXCEPT	0x04
    204   1.7  thorpej #define READ_ELEMENT_STATUS_ACCESS	0x08
    205   1.7  thorpej #define READ_ELEMENT_STATUS_EXENAB	0x10
    206   1.7  thorpej #define READ_ELEMENT_STATUS_INENAB	0x20
    207   1.7  thorpej 
    208   1.7  thorpej #define READ_ELEMENT_STATUS_MT_MASK1	0x05
    209   1.7  thorpej #define READ_ELEMENT_STATUS_ST_MASK1	0x0c
    210   1.7  thorpej #define READ_ELEMENT_STATUS_IE_MASK1	0x3f
    211   1.7  thorpej #define READ_ELEMENT_STATUS_DT_MASK1	0x0c
    212   1.7  thorpej 
    213  1.18  reinoud 	u_int8_t	reserved0;
    214  1.18  reinoud 	u_int8_t	sense_code;
    215  1.18  reinoud 	u_int8_t	sense_qual;
    216   1.7  thorpej 
    217   1.7  thorpej 	/*
    218   1.7  thorpej 	 * dt_scsi_flags and dt_scsi_addr are valid only on data transport
    219   1.7  thorpej 	 * elements.  These bytes are undefined for all other element types.
    220   1.7  thorpej 	 */
    221  1.18  reinoud 	u_int8_t	dt_scsi_flags;
    222   1.7  thorpej 
    223   1.7  thorpej #define READ_ELEMENT_STATUS_DT_LUNMASK	0x07
    224   1.7  thorpej #define READ_ELEMENT_STATUS_DT_LUVALID	0x10
    225   1.7  thorpej #define READ_ELEMENT_STATUS_DT_IDVALID	0x20
    226   1.7  thorpej #define READ_ELEMENT_STATUS_DT_NOTBUS	0x80
    227   1.7  thorpej 
    228  1.18  reinoud 	u_int8_t	dt_scsi_addr;
    229   1.7  thorpej 
    230  1.18  reinoud 	u_int8_t	reserved1;
    231   1.7  thorpej 
    232  1.18  reinoud 	u_int8_t	flags2;
    233   1.7  thorpej #define READ_ELEMENT_STATUS_INVERT	0x40
    234   1.7  thorpej #define READ_ELEMENT_STATUS_SVALID	0x80
    235  1.18  reinoud 	u_int8_t	ssea[2];	/* source storage element address */
    236   1.7  thorpej 
    237   1.7  thorpej 	/*
    238   1.7  thorpej 	 * bytes 12-47:	Primary volume tag information.
    239   1.7  thorpej 	 *		(field omitted if PVOLTAG = 0)
    240   1.7  thorpej 	 *
    241   1.7  thorpej 	 * bytes 48-83:	Alternate volume tag information.
    242   1.7  thorpej 	 *		(field omitted if AVOLTAG = 0)
    243   1.7  thorpej 	 *
    244   1.7  thorpej 	 * bytes 84-87:	Reserved (moved up if either of the above fields
    245   1.7  thorpej 	 *		are omitted)
    246   1.7  thorpej 	 *
    247   1.7  thorpej 	 * bytes 88-end: Vendor-specific: (moved up if either of the
    248   1.7  thorpej 	 *		 above fields are missing)
    249   1.7  thorpej 	 */
    250   1.7  thorpej };
    251   1.7  thorpej 
    252  1.13  thorpej /*
    253  1.13  thorpej  * Volume Tag format:
    254  1.13  thorpej  *
    255  1.13  thorpej  * Volume Tags are a sequence of ASCII characters, unused portion is
    256  1.13  thorpej  * blank-filled.  There should be no blanks in the significant portion
    257  1.13  thorpej  * of the tag.  For maximum compatibility, volume tag characters should
    258  1.13  thorpej  * be limited to '0'..'9', 'A'..'Z', '_'.
    259  1.13  thorpej  */
    260  1.13  thorpej struct changer_volume_tag {
    261  1.18  reinoud 	u_int8_t volid[32];	/* 32 bytes of ASCII, blank-terminated */
    262  1.18  reinoud 	u_int8_t reserved[2];
    263  1.18  reinoud 	u_int8_t volseq[2];	/* volume sequence number */
    264  1.14  thorpej };
    265  1.14  thorpej 
    266  1.14  thorpej /*
    267  1.14  thorpej  * Send a volume tag.
    268  1.14  thorpej  */
    269  1.14  thorpej struct scsi_send_volume_tag {
    270  1.18  reinoud 	u_int8_t	opcode;
    271  1.14  thorpej #define	SEND_VOLUME_TAG		0xb6
    272  1.18  reinoud 	u_int8_t	byte2;
    273  1.18  reinoud 	u_int8_t	eaddr[2];	/* element address */
    274  1.18  reinoud 	u_int8_t	reserved0;
    275  1.18  reinoud 	u_int8_t	sac;		/* send action code */
    276  1.14  thorpej #define	SAC_TRANSLATE_ALL		0x00
    277  1.14  thorpej #define	SAC_TRANSLATE_PRIMARY		0x01
    278  1.14  thorpej #define	SAC_TRANSLATE_ALT		0x02
    279  1.14  thorpej #define	SAC_TRANSLATE_ALL_NOSEQ		0x04
    280  1.14  thorpej #define	SAC_TRANSLATE_PRIMARY_NOSEQ	0x05
    281  1.14  thorpej #define	SAC_TRANSLATE_ALT_NOSEQ		0x06
    282  1.14  thorpej #define	SAC_ASSERT_PRIMARY		0x08
    283  1.14  thorpej #define	SAC_ASSERT_ALT			0x09
    284  1.14  thorpej #define	SAC_REPLACE_PRIMARY		0x0a
    285  1.14  thorpej #define	SAC_REPLACE_ALT			0x0b
    286  1.14  thorpej #define	SAC_UNDEFINED_PRIMARY		0x0c
    287  1.14  thorpej #define	SAC_UNDEFINED_ALT		0x0d
    288  1.14  thorpej 				/*	0x0e - 0x1b	reserved */
    289  1.14  thorpej 				/*	0x1c - 0x1f	vendor-specific */
    290  1.18  reinoud 	u_int8_t	reserved1[2];
    291  1.22   andvar 	u_int8_t	length[2];	/* parameter list length */
    292  1.18  reinoud 	u_int8_t	reserved2;
    293  1.18  reinoud 	u_int8_t	control;
    294  1.13  thorpej };
    295   1.7  thorpej 
    296   1.7  thorpej /* Element type codes */
    297   1.7  thorpej #define ELEMENT_TYPE_MASK	0x0f	/* Note: these aren't bits */
    298   1.7  thorpej #define ELEMENT_TYPE_ALL	0x00
    299   1.7  thorpej #define ELEMENT_TYPE_MT		0x01
    300   1.7  thorpej #define ELEMENT_TYPE_ST		0x02
    301   1.7  thorpej #define ELEMENT_TYPE_IE		0x03
    302   1.7  thorpej #define ELEMENT_TYPE_DT		0x04
    303   1.7  thorpej 
    304   1.7  thorpej /*
    305   1.7  thorpej  * Device capabilities page.
    306   1.7  thorpej  *
    307  1.15      wiz  * This page defines characteristics of the element types in the
    308   1.7  thorpej  * medium changer device.
    309   1.7  thorpej  *
    310   1.7  thorpej  * Note in the definitions below, the following abbreviations are
    311   1.7  thorpej  * used:
    312   1.7  thorpej  *		MT	Medium transport element (picker)
    313   1.7  thorpej  *		ST	Storage transport element (slot)
    314   1.7  thorpej  *		IE	Import/export element (portal)
    315  1.15      wiz  *		DT	Data transfer element (tape/disk drive)
    316   1.7  thorpej  */
    317   1.7  thorpej struct page_device_capabilities {
    318  1.18  reinoud 	u_int8_t	pg_code;	/* page code (0x1f) */
    319  1.18  reinoud 	u_int8_t	pg_length;	/* page length (0x12) */
    320   1.7  thorpej 
    321   1.7  thorpej 	/*
    322   1.7  thorpej 	 * The STOR_xx bits indicate that an element of a given
    323   1.7  thorpej 	 * type may provide independent storage for a unit of
    324   1.7  thorpej 	 * media.  The top four bits of this value are reserved.
    325   1.7  thorpej 	 */
    326  1.18  reinoud 	u_int8_t	stor;
    327   1.7  thorpej #define STOR_MT		0x01
    328   1.7  thorpej #define STOR_ST		0x02
    329   1.7  thorpej #define STOR_IE		0x04
    330   1.7  thorpej #define STOR_DT		0x08
    331   1.7  thorpej 
    332  1.18  reinoud 	u_int8_t	reserved0;
    333   1.7  thorpej 
    334   1.7  thorpej 	/*
    335   1.7  thorpej 	 * The MOVE_TO_yy bits indicate the changer supports
    336   1.7  thorpej 	 * moving a unit of medium from an element of a given type to an
    337   1.7  thorpej 	 * element of type yy.  This is used to determine if a given
    338   1.7  thorpej 	 * MOVE MEDIUM command is legal.  The top four bits of each
    339   1.7  thorpej 	 * of these values are reserved.
    340   1.7  thorpej 	 */
    341  1.18  reinoud 	u_int8_t	move_from_mt;
    342  1.18  reinoud 	u_int8_t	move_from_st;
    343  1.18  reinoud 	u_int8_t	move_from_ie;
    344  1.18  reinoud 	u_int8_t	move_from_dt;
    345   1.7  thorpej #define MOVE_TO_MT	0x01
    346   1.7  thorpej #define MOVE_TO_ST	0x02
    347   1.7  thorpej #define MOVE_TO_IE	0x04
    348   1.7  thorpej #define MOVE_TO_DT	0x08
    349   1.7  thorpej 
    350  1.18  reinoud 	u_int8_t	reserved1[4];
    351   1.7  thorpej 
    352   1.7  thorpej 	/*
    353   1.7  thorpej 	 * Similar to above, but for EXCHANGE MEDIUM.
    354   1.7  thorpej 	 */
    355  1.18  reinoud 	u_int8_t	exchange_with_mt;
    356  1.18  reinoud 	u_int8_t	exchange_with_st;
    357  1.18  reinoud 	u_int8_t	exchange_with_ie;
    358  1.18  reinoud 	u_int8_t	exchange_with_dt;
    359   1.7  thorpej #define EXCHANGE_WITH_MT	0x01
    360   1.7  thorpej #define EXCHANGE_WITH_ST	0x02
    361   1.7  thorpej #define EXCHANGE_WITH_IE	0x04
    362   1.7  thorpej #define EXCHANGE_WITH_DT	0x08
    363   1.7  thorpej };
    364   1.7  thorpej 
    365   1.7  thorpej /*
    366  1.15      wiz  * Medium changer element address assignment page.
    367   1.7  thorpej  *
    368   1.7  thorpej  * Some of these fields can be a little confusing, so an explanation
    369   1.7  thorpej  * is in order.
    370   1.7  thorpej  *
    371  1.21  msaitoh  * Each component within a medium changer apparatus is called an
    372   1.7  thorpej  * "element".
    373   1.7  thorpej  *
    374   1.7  thorpej  * The "medium transport element address" is the address of the first
    375   1.7  thorpej  * picker (robotic arm).  "Number of medium transport elements" tells
    376   1.7  thorpej  * us how many pickers exist in the changer.
    377   1.7  thorpej  *
    378   1.7  thorpej  * The "first storage element address" is the address of the first
    379   1.7  thorpej  * slot in the tape or disk magazine.  "Number of storage elements" tells
    380   1.7  thorpej  * us how many slots exist in the changer.
    381   1.7  thorpej  *
    382   1.7  thorpej  * The "first import/export element address" is the address of the first
    383   1.7  thorpej  * medium portal accessible both by the medium changer and an outside
    384   1.7  thorpej  * human operator.  This is where the changer might deposit tapes destined
    385   1.7  thorpej  * for some vault.  The "number of import/export elements" tells us
    386   1.7  thorpej  * not many of these portals exist in the changer.  NOTE: this number may
    387   1.7  thorpej  * be 0.
    388   1.7  thorpej  *
    389   1.7  thorpej  * The "first data transfer element address" is the address of the first
    390   1.7  thorpej  * tape or disk drive in the changer.  "Number of data transfer elements"
    391   1.7  thorpej  * tells us how many drives exist in the changer.
    392   1.7  thorpej  */
    393   1.7  thorpej struct page_element_address_assignment {
    394  1.18  reinoud 	u_int8_t	pg_code;	/* page code (0x1d) */
    395  1.18  reinoud 	u_int8_t	pg_length;	/* page length (0x12) */
    396   1.7  thorpej 
    397   1.7  thorpej 	/* Medium transport element address */
    398  1.18  reinoud 	u_int8_t	mtea[2];
    399   1.7  thorpej 
    400   1.7  thorpej 	/* Number of medium transport elements */
    401  1.18  reinoud 	u_int8_t	nmte[2];
    402   1.7  thorpej 
    403   1.7  thorpej 	/* First storage element address */
    404  1.18  reinoud 	u_int8_t	fsea[2];
    405   1.7  thorpej 
    406   1.7  thorpej 	/* Number of storage elements */
    407  1.18  reinoud 	u_int8_t	nse[2];
    408   1.7  thorpej 
    409   1.7  thorpej 	/* First import/export element address */
    410  1.18  reinoud 	u_int8_t	fieea[2];
    411   1.7  thorpej 
    412   1.7  thorpej 	/* Number of import/export elements */
    413  1.18  reinoud 	u_int8_t	niee[2];
    414   1.7  thorpej 
    415   1.7  thorpej 	/* First data transfer element address */
    416  1.18  reinoud 	u_int8_t	fdtea[2];
    417   1.7  thorpej 
    418  1.15      wiz 	/* Number of data transfer elements */
    419  1.18  reinoud 	u_int8_t	ndte[2];
    420   1.7  thorpej 
    421  1.18  reinoud 	u_int8_t	reserved[2];
    422   1.7  thorpej };
    423   1.7  thorpej 
    424   1.7  thorpej /*
    425   1.7  thorpej  * Transport geometry parameters page.
    426   1.7  thorpej  *
    427   1.7  thorpej  * Defines whether each medium transport element is a member of a set of
    428   1.7  thorpej  * elements that share a common robotics subsystem and whether the element
    429   1.7  thorpej  * is capable of media rotation.  One transport geometry descriptor is
    430   1.7  thorpej  * transferred for each medium transport element, beginning with the first
    431   1.7  thorpej  * medium transport element (other than the default transport element address
    432   1.7  thorpej  * of 0).
    433   1.7  thorpej  */
    434   1.7  thorpej struct page_transport_geometry_parameters {
    435  1.18  reinoud 	u_int8_t	pg_code;	/* page code (0x1e) */
    436  1.18  reinoud 	u_int8_t	pg_length;	/* page length; variable */
    437   1.7  thorpej 
    438   1.7  thorpej 	/* Transport geometry descriptor(s) are here. */
    439   1.7  thorpej 
    440  1.18  reinoud 	u_int8_t	misc;
    441   1.7  thorpej #define CAN_ROTATE	0x01
    442   1.7  thorpej 
    443   1.7  thorpej 	/* Member number in transport element set. */
    444  1.18  reinoud 	u_int8_t	member;
    445   1.1      cgd };
    446