The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sqtzdc/zdc.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991 Carnegie Mellon University
    4  * Copyright (c) 1991 Sequent Computer Systems
    5  * All Rights Reserved.
    6  * 
    7  * Permission to use, copy, modify and distribute this software and its
    8  * documentation is hereby granted, provided that both the copyright
    9  * notice and this permission notice appear in all copies of the
   10  * software, derivative works or modified versions, and any portions
   11  * thereof, and that both notices appear in supporting documentation.
   12  * 
   13  * CARNEGIE MELLON AND SEQUENT COMPUTER SYSTEMS ALLOW FREE USE OF
   14  * THIS SOFTWARE IN ITS "AS IS" CONDITION.  CARNEGIE MELLON AND
   15  * SEQUENT COMPUTER SYSTEMS DISCLAIM ANY LIABILITY OF ANY KIND FOR
   16  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   17  * 
   18  * Carnegie Mellon requests users of this software to return to
   19  * 
   20  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   21  *  School of Computer Science
   22  *  Carnegie Mellon University
   23  *  Pittsburgh PA 15213-3890
   24  * 
   25  * any improvements or extensions that they make and grant Carnegie Mellon 
   26  * the rights to redistribute these changes.
   27  */
   28 
   29 /*
   30  * HISTORY
   31  * $Log:        zdc.h,v $
   32  * Revision 2.4  93/03/11  14:05:53  danner
   33  *      u_long -> u_int
   34  *      [93/03/10            danner]
   35  * 
   36  * Revision 2.3  91/07/31  18:08:29  dbg
   37  *      Changed copyright.
   38  *      [91/07/31            dbg]
   39  * 
   40  * Revision 2.2  91/05/08  13:08:20  dbg
   41  *      Adapted for pure Mach kernel.
   42  *      [90/10/04            dbg]
   43  * 
   44  */
   45 
   46 /*
   47  * $Header: zdc.h,v 2.4 93/03/11 14:05:53 danner Exp $
   48  *
   49  * zdc.h
   50  *      ZDC disk controller definitions and data structures.
   51  */
   52 
   53 /*
   54  * Revision 1.1  89/07/05  13:21:06  kak
   55  * Initial revision
   56  * 
   57  * Revision 1.10  88/03/23  18:27:44  neal
   58  * Added m2382k (swallow 5) support to ZDC.
   59  * 
   60  */
   61 #ifndef _SQTZDC_ZDC_H_
   62 #define _SQTZDC_ZDC_H_
   63 
   64 #include <sys/types.h>
   65 #include <mach/time_value.h>
   66 #include <device/buf.h>
   67 #include <sqt/mutex.h>
   68 
   69 #define ZDC_MAXDRIVES   16                      /* drives on a controller */
   70 #define ZDC_MAXDRSHFT    4                      /* drives on ctrlr log2 */
   71 #define NCBPERDRIVE      2                      /* no. of CBs per drive */
   72 #define NCBDRSHFT        1                      /* drive on ctrlr log2 */
   73 #define NCBPERZDC       (NCBPERDRIVE*ZDC_MAXDRIVES)     /* no. of CBs per ZDC */
   74 #define NCBZDCSHFT      (NCBDRSHFT+ZDC_MAXDRSHFT)       /* shft for NCBPERZDC */
   75 #define NSTATBYTES      7                       /* no of status bytes */
   76 #define CBBIN           7                       /* SLIC Bin for CB commands */
   77 #define CLRERRBIN       5                       /* SLIC Bin to clear ctlr errors */
   78 
   79 #ifndef ZDC_MICROCODE
   80 /*
   81  * Software / firmware interface command block.
   82  */
   83 struct cb {
   84         u_int   cb_reserved0;           /* reserved for SEQUENT use */
   85         struct diskaddr {
   86                 u_char  da_sect;        /* sector */
   87                 u_char  da_head;        /* head */
   88                 u_short da_cyl;         /* cylinder */
   89         } cb_diskaddr;
   90         u_int   cb_addr;                /* If cb_iovec nonzero, then
   91                                          * virtual address. Else,
   92                                          * physical address.  */
   93         u_int   cb_count;               /* transfer count */
   94         u_int   *cb_iovec;              /* if nonzero, physical address
   95                                          * of list of iovectors. */
   96         u_char  cb_status[NSTATBYTES];  /* drive status and extended status */
   97         u_char  cb_reqstat;             /* Internal to ZDC only */
   98         u_char  cb_psect;               /* phys sector - offset from index */
   99         u_char  cb_mod;                 /* ZDC command modifiers */
  100         u_char  cb_cmd;                 /* ZDC command */
  101         u_char  cb_compcode;            /* completion code */
  102 
  103         /* start of Software only part */
  104         struct  buf *cb_bp;             /* ptr to buf header 
  105                                          * null == CB not busy */
  106         u_int   *cb_iovstart;           /* start of cb_iovec buffer */
  107         u_short cb_errcnt;              /* retries */
  108         short   cb_unit;                /* index into unit table; -1 invalid */
  109         struct  diskaddr cb_contaddr;   /* where to continue after revectoring */
  110         int     cb_contiovsz;           /* # of bytes iovecs on continuation */
  111         int     cb_transfrd;            /* # of bytes transferred previously */
  112         u_char  cb_state;               /* current job state */
  113         u_int   cb_fill[1];             /* fill to 64 byte size */
  114 };
  115 #define cb_cyl  cb_diskaddr.da_cyl
  116 #define cb_head cb_diskaddr.da_head
  117 #define cb_sect cb_diskaddr.da_sect
  118 #endif  ZDC_MICROCODE
  119 
  120 #define ADDRALIGN       16              /* cb_addr must be 16-byte aligned */
  121 #define CNTMULT         16              /* cb_count must be 16-byte multiple */
  122 #define IOVALIGN        32              /* cb_iovec's must be 32-byte aligned */
  123 #define FWCBSIZE        32              /* size excluding SW only half */
  124 
  125 /*
  126  * ZDC command codes    (ZDC ucode depends on the order of these)
  127  */
  128 #define ZDC_READ                0x01    /* normal read */
  129 #define ZDC_WRITE               0x02    /* normal write */
  130 #define ZDC_INIT                0x03    /* initialize ZDC */
  131 #define ZDC_PROBE               0x04    /* get drive configuration */
  132 #define ZDC_NOP                 0x05    /* Do nothing */
  133 #define ZDC_READ_LRAM           0x06    /* Read 4 bytes of ZDC Local RAM */
  134 #define ZDC_WRITE_LRAM          0x07    /* Write 4 bytes of ZDC Local RAM */
  135 #define ZDC_SEEK                0x08    /* seek to given cylinder/head */
  136 #define ZDC_STAT                0x09    /* read drive status */
  137 #define ZDC_RESET               0x0a    /* reset drive */
  138 #define ZDC_PROBEDRIVE          0x0b    /* get drive config - specific drive */
  139 #define ZDC_GET_CHANCFG         0x0c    /* get the channel configuration */
  140 #define ZDC_SET_CHANCFG         0x0d    /* set the channel configuration */
  141 #define ZDC_FMT_SS              0x0e    /* format special sector */
  142 #define ZDC_READ_SS             0x0f    /* read special sector */
  143 #define ZDC_WRITE_SS            0x10    /* write special sector */
  144 #define ZDC_FMTTRK              0x11    /* format a track */
  145 #define ZDC_READ_HDRS           0x12    /* read all headers on a track */
  146 #define ZDC_WHDR_WDATA          0x13    /* Write a sector's header and data */
  147 #define ZDC_LONG_READ           0x14    /* read sector and ECC appendage */
  148 #define ZDC_LONG_WRITE          0x15    /* write sector and ECC appendage */
  149 #define ZDC_REC_DATA            0x16    /* Recover data from sector w/bad hdr */
  150 
  151 #define ZDC_MAXCMD              0x16    /* Last legal command */
  152 
  153 /*
  154  * Command Modifier Codes
  155  */
  156 #define ZDC_SERVOPLUS           0x01    /* Servo offset plus */
  157 #define ZDC_SERVOMINUS          0x02    /* Servo offset minus */
  158 #define ZDC_STROBEARLY          0x04    /* Data Strobe early */
  159 #define ZDC_STROBELATE          0x08    /* Data Strobe late */
  160 #define ZDC_NOECC               0x10    /* Inhibit ECC correction */
  161 #define ZDC_NOREVECTOR          0x20    /* Inhibit Auto-revectoring */
  162 
  163 /*
  164  * ZDC completion codes.
  165  */
  166 #define ZDC_BUSY                0x00    /* ZDC processing CB */
  167 #define ZDC_DONE                0x01    /* successful completion */
  168 #define ZDC_DRVPROT             0x02    /* write protect fault */
  169 #define ZDC_DRVFLT              0x03    /* Drive Fault */
  170 #define ZDC_SEEKERR             0x04    /* Seek error */
  171 #define ZDC_SEEK_TO             0x05    /* seek timeout */
  172 #define ZDC_CH_TO               0x06    /* Channel timeout */
  173 #define ZDC_DMA_TO              0x07    /* DMA timeout */
  174 #define ZDC_HDR_ECC             0x08    /* header ECC error */
  175 #define ZDC_SOFTECC             0x09    /* soft ECC error (retry successful) */
  176 #define ZDC_CORRECC             0x0a    /* correctable ECC error */
  177 #define ZDC_ECC                 0x0b    /* uncorrectable ECC error */
  178 #define ZDC_SNF                 0x0c    /* sector not found */
  179 #define ZDC_REVECT              0x0d    /* bad data sector */
  180 #define ZDC_SO                  0x0e    /* sector overrun */
  181 #define ZDC_NDS                 0x0f    /* no data synch */
  182 #define ZDC_FDL                 0x10    /* fifo data lost */
  183 #define ZDC_ILLCMD              0x11    /* illegal cb_cmd */
  184 #define ZDC_ILLMOD              0x12    /* illegal cb_mod */
  185 #define ZDC_ILLCHS              0x13    /* illegal disk address */
  186 #define ZDC_ILLALIGN            0x14    /* cb_addr not 16-byte aligned */
  187 #define ZDC_ILLCNT              0x15    /* cb_count not multiple of 16 */
  188 #define ZDC_ILLIOV              0x16    /* cb_iovec not 32-byte aligned */
  189 #define ZDC_ILLVECIO            0x17    /* cb_iovec != 0 && page size invalid */
  190 #define ZDC_ILLPGSZ             0x18    /* illegal icb_pagesize */
  191 #define ZDC_ILLDUMPADR          0x19    /* icb_dumpaddr not 1K-byte aligned */
  192 #define ZDC_BADDRV              0x1a    /* drive not online... */
  193 #define ZDC_CBREUSE             0x1b    /* in use CB was reused */
  194 #define ZDC_ACCERR              0x1c    /* access error during DMA */
  195 #define ZDC_NOCFG               0x1d    /* channel not configured */
  196 #define ZDC_CH_RESET            0x1e    /* channel was reset */
  197 #define ZDC_DDC_STAT            0x1f    /* unexpected status from DDC */
  198 
  199 /*
  200  * State bit codes
  201  */
  202 #define ZD_NORMAL       0x00    /* Normal state */
  203 #define ZD_REVECTOR     0x01    /* Revectoring to replacement sector */
  204 #define ZD_RESET        0x02    /* Reset for retry sequence in progress */
  205 
  206 #ifndef ZDC_MICROCODE
  207 /*
  208  * Command block for ZDC_INIT command.
  209  */
  210 struct init_cb {
  211         u_int   icb_reserved0[3];       /* reserved for SEQUENT use */
  212         u_int   icb_pagesize;           /* page size in bytes */
  213         caddr_t icb_dumpaddr;           /* Physical address of 8 KB region in
  214                                          * memory where LRAM may be dumped.
  215                                          */
  216 
  217         /* completion interrupts initialization */
  218 
  219         u_char  icb_dest;               /* slic destination */
  220         u_char  icb_bin;                /* slic bin */
  221         u_char  icb_vecbase;            /* slic message (vector) */
  222         u_char  icb_reserved1;          /* more reserved */
  223 
  224         u_char  icb_errdest;            /* slic destination, ctlr errs */
  225         u_char  icb_errbin;             /* slic bin, ctlr errs */
  226         u_char  icb_errvector;          /* slic message, ctlr errs */
  227         u_char  icb_reserved2;          /* more reserved */
  228 
  229         u_char  icb_reserved3;          /* more reserved */
  230         u_char  icb_ctrl;               /* ZDC Control */
  231         u_char  icb_cmd;                /* ZDC command */
  232         u_char  icb_compcode;           /* completion code */
  233 
  234         /* start of Software only part */
  235         u_int   icb_sw[8];              /* Reserved for Sequent SW use */
  236 };
  237 #endif  ZDC_MICROCODE
  238 
  239 /*
  240  * Control byte encoding.
  241  */
  242 #define ZDC_ENABLE_INTR         0x01    /* Enable interrupts */
  243 #define ZDC_DUMPONPANIC         0x02    /* Dump LRAM on controller panic */
  244 #define ZDC_SIXTEEN             0x04    /* Do 16 byte DMA; else 8 byte */
  245 
  246 #define ZDC_LRAMSZ      8192    /* 8K local RAM to dump at icb_dumpaddr */
  247 
  248 #ifndef ZDC_MICROCODE
  249 /*
  250  * Command Block for ZDC_PROBE command.
  251  */
  252 struct probe_cb {
  253         u_int   pcb_reserved0[3];               /* reserved for SEQUENT use */
  254         u_char  pcb_drivecfg[ZDC_MAXDRIVES];    /* drive configuration */
  255         u_short pcb_reserved1;                  /* more reserved */
  256         u_char  pcb_cmd;                        /* ZDC command */
  257         u_char  pcb_compcode;                   /* completion code */
  258 
  259         /* start of Software only part */
  260         u_int   pcb_sw[8];                      /* reserved Sequent SW use */
  261 };
  262 #endif  ZDC_MICROCODE
  263 
  264 /*
  265  * Drive configuration bit encoding.
  266  */
  267 #define ZD_PRESENT      0x01            /* Drive present */
  268 #define ZD_ONLINE       0x02            /* Drive is online (spun up) */
  269 #define ZD_FORMATTED    0x04            /* Drive is formatted */
  270 #define ZD_MATCH        0x08            /* Format matches rest of channel */
  271 #define ZD_READONLY     0x10            /* Drive is write-protected */
  272 
  273 #define ZD_NOTFOUND     0x00            /* Drive not found */
  274 
  275 /*
  276  * SLIC slave status register (SL_Z_STATUS) error bits
  277  */
  278 #define ZDC_ERRMASK     0x2F            /* mask to determine error type */
  279 #define ZDC_SRESET      0x00            /* ZDC in reset state */
  280 #define ZDC_SINIT       0x21            /* ZDC initializing */
  281 #define ZDC_READY       0x28            /* If no parity error present */
  282 /*
  283  * This consists of errors where the controller is still running.
  284  * Note that codes: 0x25 - 0x27 are reserved for future use.
  285  */
  286 #define ZDC_OBCB        0x22            /* Error - Out of Bounds CB */
  287 #define ZDC_NOCB        0x23            /* Error - Request without CB base */
  288 #define ZDC_CBACCESS    0x24            /* Error - CB Access Error */
  289 /*
  290  * The following error codes are for fatal errors where the HSC stops.
  291  * These currently include Parity errors (SLB_ZPARERR),
  292  * FW internal errors (Panic) and DMA C timeout.
  293  * Note that codes: 0x0a - 0x0f are reserved.
  294  */
  295 #define ZDC_WCSPE       0x01            /* WCS Parity Error */
  296 #define ZDC_ZDCTOOK     0x02            /* ZDC->OK Parity Error */
  297 #define ZDC_OKTOZDC     0x03            /* OK->ZDC Parity Error */
  298 #define ZDC_LRAMTOHSC   0x04            /* LRAM->HSC Parity Error */
  299 #define ZDC_LRAMTOBUS   0x05            /* LRAM->SB8000 Parity Error */
  300 #define ZDC_LRAMTOCHA   0x07            /* LRAM->Channel A Parity Error */
  301 #define ZDC_LRAMTOCHB   0x06            /* LRAM->Channel B Parity Error */
  302 
  303 #define ZDC_FW_PANIC    0x08            /* Error - FW panic (internal error) */
  304 #define ZDC_DMAC_TO     0x09            /* Error - DMA C Timeout */
  305 
  306 #ifndef ZDC_MICROCODE
  307 /*
  308  * Track 0 Disk Description structure definition
  309  * Note: these fields are order dependent since shared data with microcode.
  310  */
  311 struct zdcdd {
  312         u_int   zdd_magic;              /* magic number for sanity */
  313         u_char  zdd_ecc_bytes;          /* # of bytes of ECC */
  314         u_char  zdd_spare;              /* spares per track */
  315         u_char  zdd_sectors;            /* sectors per track (formatted) */
  316         u_char  zdd_tracks;             /* tracks per cylinder */
  317         u_short zdd_cyls;               /* number of cylinders */
  318 
  319         u_char  zdd_drive_type;         /* Soft drive type.  That is, the type
  320                                          * of the drive as it was formatted.
  321                                          * Used in driver for selection of
  322                                          * partition tables.
  323                                          */
  324         u_char  zdd_xfer_rate;          /* drive transfer rate in MHz */
  325         u_short zdd_runt;               /* no. of bytes in runt sector */
  326         u_short zdd_chdelay;            /* channel delay */
  327         u_char  zdd_hsdelay;            /* head switch delay */
  328         u_char  zdd_hpo_rd_bc;          /* header postamble byte cnt (read) */
  329         u_char  zdd_hpo_fmt_bc;         /* header postamble byte cnt (fmt) */
  330         u_char  zdd_cskew;              /* format skew between cylinders */
  331         u_char  zdd_tskew;              /* format skew between tracks */
  332         u_char  zdd_hdr_bc;             /* header byte cnt (inc head scatter) */
  333         u_short zdd_sector_bc;          /* sector byte cnt (inc header & gap) */
  334         u_char  zdd_strt_ign_bc;        /* bytes at the start of the sector
  335                                          * where defects can be ignored.
  336                                          */
  337         u_char  zdd_end_ign_bc;         /* bytes at the end of the sector
  338                                          * where defects can be ignored.
  339                                          */
  340         u_char  reserved1[2];
  341         u_int   reserved2[3];           /* reserved */
  342 
  343         /*
  344          * The following structure contains an entry for each register
  345          * in the NSC DP8466 (DDC) in order of hex address.
  346          * Read only registers are included for convenience of the
  347          * ZDC microcode.  They are marked "RO".
  348          */
  349         struct ddc_regs {
  350                 u_char  dr_status;      /* RO  status register */
  351                 u_char  dr_error;       /* RO  error register */
  352 
  353                 u_char  dr_ppb0;        /* polynomial preset byte 0 */
  354                 u_char  dr_ppb1;        /* polynomial preset byte 1 */
  355                 u_char  dr_ppb2;        /* polynomial preset byte 2 */
  356                 u_char  dr_ppb3;        /* polynomial preset byte 3 */
  357                 u_char  dr_ppb4;        /* polynomial preset byte 4 */
  358                 u_char  dr_ppb5;        /* polynomial preset byte 5 */
  359                 u_char  dr_ptb0;        /* polynomial tap byte 0 */
  360                 u_char  dr_ptb1;        /* polynomial tap byte 1 */
  361                 u_char  dr_ptb2;        /* polynomial tap byte 2 */
  362                 u_char  dr_ptb3;        /* polynomial tap byte 3 */
  363                 u_char  dr_ptb4;        /* polynomial tap byte 4 */
  364                 u_char  dr_ptb5;        /* polynomial tap byte 5 */
  365                 u_char  dr_ec_ctrl;     /* ECC/CRC control */
  366 
  367                 u_char  dr_hbc;         /* header byte count */
  368 
  369                 u_char  dr_dc;          /* drive command register */
  370                 u_char  dr_oc;          /* operation command register */
  371                 u_char  dr_sc;          /* sector count */
  372                 u_char  dr_nso;         /* number of sector operations */
  373 
  374                 u_char  dr_hb0_pat;     /* header byte 0 pattern */
  375                 u_char  dr_hb1_pat;     /* header byte 1 pattern */
  376                 u_char  dr_hb2_pat;     /* header byte 2 pattern */
  377                 u_char  dr_hb3_pat;     /* header byte 3 pattern */
  378                 u_char  dr_hb4_pat;     /* header byte 4 pattern */
  379                 u_char  dr_hb5_pat;     /* header byte 5 pattern */
  380 
  381                 u_short dr_rdbc;        /* remote data byte count */
  382                 u_int   dr_dma_addr;    /* DMA address */
  383 
  384                 u_char  dr_dpo_bc;      /* data postamble byte count */
  385                 u_char  dr_hpr_bc;      /* header preamble byte count */
  386                 u_char  dr_hs1_bc;      /* header synch #1 byte count */
  387                 u_char  dr_hs2_bc;      /* header synch #2 byte count */
  388 
  389                 u_char  dr_hb0_ctrl;    /* header byte 0 control */
  390                 u_char  dr_hb1_ctrl;    /* header byte 1 control */
  391                 u_char  dr_hb2_ctrl;    /* header byte 2 control */
  392                 u_char  dr_hb3_ctrl;    /* header byte 3 control */
  393                 u_char  dr_hb4_ctrl;    /* header byte 4 control */
  394                 u_char  dr_hb5_ctrl;    /* header byte 5 control */
  395 
  396                 u_char  dr_extdecc_bc;  /* external data ECC byte count */
  397                 u_char  dr_exthecc_bc;  /* external header ECC byte count */
  398 
  399                 u_char  dr_hpo_wr_bc;   /* header postamble byte count (write)*/
  400                 u_char  dr_dpr_wr_bc;   /* data preamble byte count (write) */
  401                 u_char  dr_ds1_bc;      /* data synch #1 byte count */
  402                 u_char  dr_ds2_bc;      /* data synch #2 byte count */
  403                 u_char  dr_dpo_pat;     /* data postamble pattern */
  404                 u_char  dr_hpr_pat;     /* header preamble pattern */
  405                 u_char  dr_hs1_pat;     /* header synch #1 pattern */
  406                 u_char  dr_hs2_pat;     /* header synch #2 pattern */
  407                 u_char  dr_gap_bc;      /* gap byte count */
  408 
  409                 u_char  dr_df;          /* disk format register */
  410                 u_char  dr_ltr;         /* local transfer register */
  411                 u_char  dr_rtr;         /* remote transfer register */
  412 
  413                 u_short dr_sector_bc;   /* sector byte count */
  414 
  415                 u_char  dr_gap_pat;     /* gap pattern */
  416                 u_char  dr_dfmt_pat;    /* data format pattern */
  417                 u_char  dr_hpo_pat;     /* header postamble pattern */
  418                 u_char  dr_dpr_pat;     /* data preamble pattern */
  419                 u_char  dr_ds1_pat;     /* data synch #1 pattern */
  420                 u_char  dr_ds2_pat;     /* data synch #2 pattern */
  421         } zdd_ddc_regs;
  422 
  423         struct zdd_format_desc {        /* Format description */
  424                 time_t  fd_fdate;       /* date/time of format */
  425                 u_char  fd_rev;         /* revision of formatter */
  426                 u_char  fd_passes;      /* number of verify passes */
  427         } zdd_format_desc;
  428 
  429         u_char  zdd_filler[15];
  430         u_char  zdd_checksum;
  431 };
  432 #endif  ZDC_MICROCODE
  433 
  434 #define ZDD_DDCYL       0                       /* disk desc cylinder */
  435 #define ZDD_SS_SIZE     (DEV_BSIZE - 64)        /* SS sector size */
  436 
  437 /*
  438  * Format specific defines.
  439  */
  440 #define ZDD_NDDSECTORS  4       /* no. of sectors containing zdcdd structure */
  441 #define ZDD_NDGNCYL     2       /* no. of cylinders reserved for diagnostics */
  442 #define ZDD_NDGNSPT     32      /* Min good sectors needed per DGN track */
  443 #define ZDD_NDGNSPTRKS  4       /* no. of dgn special tracks */
  444 
  445 /*
  446  * Header types
  447  */
  448 #define ZD_GOODSECT     0xC9    /* A Good Used sector */
  449 #define ZD_GOODRPL      0x36    /* A Good Replacement sector */
  450 #define ZD_GOODSS       0x0A    /* A Good Special Sector */
  451 #define ZD_BADREVECT    0x50    /* A Bad (auto)Revector sector */
  452 #define ZD_BADUNUSED    0xA5    /* A Bad Unused sector */
  453 #define ZD_GOODSPARE    0x6C    /* A Good Spare sector (formatter only) */
  454 
  455 #define ZD_TORESOLVE    0x2     /* Flag byte - sector bad. Replacement tbd */
  456 #define ZD_ERRTYPE      0x1     /* Flag byte - sector bad. Error type. */
  457 
  458 #define ZD_BUCYL        0xC9C9  /* cyl # in ZD_BADUNUSED header */
  459 #define ZD_BUHEAD       0xC9    /* head # in ZD_BADUNUSED header */
  460 
  461 #define ZD_AUTOBIT      0x80    /* top bit set - autorevector replacement */
  462 #define ZD_INVALSECT    0xFF    /* Invalid sector number */
  463 #define ZD_MAXSECT      (ZD_INVALSECT - 1)      /* Max. valid sector number */
  464 
  465 /*
  466  * Drive types
  467  *
  468  * Used as index into partition table list
  469  * and as well as disk description table list.
  470  *
  471  * Drive types 0-15 are reserved for Sequent use
  472  * Customer added drive types start at 16
  473  */
  474 
  475 #define ZDT_M2333K      0       /* Fujitsu M2333K (swallow) */
  476 #define ZDT_M2351A      1       /* Fujitsu M2351A (eagle) */
  477 #define ZDT_M2344K      2       /* Fujitsu M2344K (swallow 4) */
  478 #define ZDT_M2382K      3       /* Fujitsu M2382K (swallow 5) */
  479 
  480 #define ZDT_CDC9715_340 16      /* CDC 9715-340 (FSD) */
  481 #define ZDT_CDC9771_800 17      /* CDC 9771-800 (XMD) */
  482 
  483 #ifndef ZDC_MICROCODE
  484 /*
  485  * Software only. Structure definitions and miscellaneaous definitions.
  486  */
  487 
  488 #define NUMPARTS        8               /* Number of partitions on drive */
  489 #define ZDC_MAXCTRLR    8               /* Maximum number of controllers */
  490 
  491 /*
  492  * ZDC controller structure
  493  *
  494  * 1 per ZDC.
  495  * Contains info collected via ZDC_PROBE and ZDC_GET_CHANCFG.
  496  */
  497 struct  zdc_ctlr {
  498         simple_lock_data_t
  499                 zdc_ctlrlock;                   /* mutex when necessary */ 
  500         u_char  zdc_slicaddr;                   /* 6-bit slic address (slot). */
  501         u_char  zdc_diagflag;                   /* copy from cfg_zdc */
  502         u_char  zdc_state;                      /* see below */
  503         u_char  zdc_dma_throttle;               /* DMA channel throttled? */
  504         struct  cb *zdc_cbp;                    /* cb array for controller */
  505         caddr_t zdc_dumpaddr;                   /* ZDC fw dump region */
  506         u_char  zdc_drivecfg[ZDC_MAXDRIVES];    /* drive cfg info */
  507         struct  zdcdd zdc_chanA;                /* disk desc. channel A */
  508         struct  zdcdd zdc_chanB;                /* disk desc. channel B */
  509 };
  510 
  511 /* State field encoding */
  512 #define ZDC_NOTFOUND    0               /* not found */
  513 #define ZDC_DEAD        1               /* dead */
  514 #define ZDC_ALIVE       2               /* alive and operational */
  515 
  516 /*
  517  * ZDC unit structure
  518  *
  519  * 1 per configured drive.
  520  */
  521 
  522 #ifdef  KERNEL
  523 #define ZD_MAXUNITS     32              /* Maximum number of units */
  524 
  525 struct zd_unit {
  526         simple_lock_data_t
  527                 zu_lock;                /* mutex access to this thing */
  528         char    zu_ctrlr;               /* controller */
  529         char    zu_drive;               /* drive */
  530         char    zu_drive_type;          /* Configured drive type */
  531         u_char  zu_state;               /* If set, unit valid */
  532         u_char  zu_cfg;                 /* drive cfg info for this unit */
  533         short   zu_nopen;               /* no. of concurrent opens */
  534         struct  cb      *zu_cbptr;      /* ptr to first CB for drive */
  535         struct  zdbad   *zu_zdbad;      /* bad block list */
  536         struct  dk      *zu_dkstats;    /* statistics */
  537         time_value_t    zu_starttime;   /* start time for busy drive */
  538         sema_t  zu_ocsema;              /* Semaphore to serialize opens */
  539         struct  buf     zu_bhead;       /* buffer queue */
  540         struct  buf     zu_ioctl;       /* buffer for ioctls */
  541         struct  cb      zu_ioctlcb;     /* cb for ioctls */
  542 };
  543 
  544 /*
  545  * zu_state values
  546  */
  547 #define ZU_NOTFOUND     0               /* unit not found */
  548 #define ZU_BAD          1               /* unit unusable */
  549 #define ZU_NO_RW        2               /* unit usable; no read/write allowed */
  550 #define ZU_GOOD         3               /* unit usable */
  551 #endif  KERNEL
  552 
  553 /* spl level when using zu_lock */
  554 #define SPLZD   SPL5
  555 
  556 /*
  557  * Partition data
  558  * The partition tables for a given drive type are defined
  559  * in the binary configuration file.
  560  */
  561 struct  zdsize  {
  562         long    p_length;               /* length in blocks */
  563         long    p_cyloff;               /* starting cylinder */
  564 };
  565 #endif  ZDC_MICROCODE
  566 
  567 #endif  /* _SQTZDC_ZDC_H_ */

Cache object: ff2754bcfc4a3cb5e94540aefabb5039


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.