/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Van Jacobson of Lawrence Berkeley Laboratory.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)scsireg.h 8.1 (Berkeley) 6/10/93
*/
/*
* HP 98265A SCSI Interface Hardware Description.
*/
/*
* Page Two - Disconnect / Reconnect Control Parameters
*/
struct scsi_disco_reco {
u_char page_savable : 1; /* save parameters */
u_char rsvd : 1;
u_char page_code : 6; /* = 0x02 */
u_char page_length; /* = 10 */
u_char buffer_full_ratio; /* write, how full before reconnect? */
u_char buffer_empty_ratio; /* read, how full before reconnect? */
u_short bus_inactivity_limit; /* how much bus time for busy */
u_short disconnect_time_limit; /* min to remain disconnected */
u_short connect_time_limit; /* min to remain connected */
u_short reserved_1;
};
/*
* Page Three - Direct Access Device Format Parameters
*/
struct scsi_format {
u_char page_savable : 1; /* save parameters */
u_char rsvd : 1;
u_char page_code : 6; /* = 0x03 */
u_char page_length; /* = 22 */
u_short tracks_per_zone; /* Handling of Defects Fields */
u_short alt_sect_zone;
u_short alt_tracks_zone;
u_short alt_tracks_vol;
u_short sect_track; /* Track Format Field */
u_short data_sect; /* Sector Format Fields */
u_short interleave;
u_short track_skew_factor;
u_short cyl_skew_factor;
u_char ssec : 1; /* Drive Type Field */
u_char hsec : 1;
u_char rmb : 1;
u_char surf : 1;
u_char ins : 1;
u_char reserved_1 : 3;
u_char reserved_2;
u_char reserved_3;
u_char reserved_4;
};
/*
* Page Four - Rigid Disk Drive Geometry Parameters
*/
struct scsi_geometry {
u_char page_savable : 1; /* save parameters */
u_char rsvd : 1;
u_char page_code : 6; /* = 0x04 */
u_char page_length; /* = 18 */
u_char cyl_ub; /* number of cylinders */
u_char cyl_mb;
u_char cyl_lb;
u_char heads; /* number of heads */
u_char precomp_cyl_ub; /* cylinder to start precomp */
u_char precomp_cyl_mb;
u_char precomp_cyl_lb;
u_char current_cyl_ub; /* cyl to start reduced current */
u_char current_cyl_mb;
u_char current_cyl_lb;
u_short step_rate; /* drive step rate */
u_char landing_cyl_ub; /* landing zone cylinder */
u_char landing_cyl_mb;
u_char landing_cyl_lb;
u_char reserved_1;
u_char reserved_2;
u_char reserved_3;
};
/*
* Control for SCSI "format" mode.
*
* "Format" mode allows a privileged process to issue direct SCSI
* commands to a drive (it is intended primarily to allow on-line
* formatting). SDIOCSFORMAT with a non-zero arg will put the drive
* into format mode; a zero arg will take it out. When in format
* mode, only the process that issued the SDIOCFORMAT can read or
* write the drive.
*
* In format mode, process is expected to
* - do SDIOCSCSICOMMAND to supply cdb for next SCSI op
* - do read or write as appropriate for cdb
* - if i/o error, optionally do SDIOCSENSE to get completion
* status and sense data from last scsi operation.
*/
struct scsi_fmt_cdb {
int len; /* cdb length (in bytes) */
u_char cdb[28]; /* cdb to use on next read/write */
};
struct scsi_fmt_sense {
u_int status; /* completion status of last op */
u_char sense[28]; /* sense data (if any) from last op */
};