home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / sys / tahoe / vba / psproto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-08  |  3.9 KB  |  99 lines

  1. /*
  2.  * Copyright (c) 1986 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)psproto.h    7.3 (Berkeley) 6/28/90
  34.  */
  35.  
  36. /*
  37.  * PS300-Host Handshake Protocol Definitions.
  38.  */
  39.  
  40. /*
  41.  * Commands sent from host->PS300.
  42.  *
  43.  * In the initial handshake carried out when requesting
  44.  * one of these commands be performed, the PS300 always
  45.  * returns the identical code to indicate success.
  46.  */
  47. #define PS_ABORT        0x1000  /* abort current command */
  48. #define PS_RESET        0x3000  /* reset device */
  49. #define PS_RDNET        0x5000  /* logical read */
  50. #define PS_LOOKUP       0x8000  /* name lookup */
  51. #define PS_RDPHY        0x9000  /* physical read */
  52. #define PS_WRPHY_SYNC   0xa000  /* physical write w/ sync */
  53. #define PS_WRPHY        0xb000  /* physical write */
  54. #define PS_WRNET        0xc000  /* logical write */
  55. #define PS_DETACH       0xd000  /* normal/diagnostic detach */
  56. #define PS_ATTACH       0xe000  /* normal attach */
  57. #define PS_DATTACH      0xf000  /* diagnostic attach */
  58.  
  59. #define PS_DIOREAD      0x4000  /* internal, wait for dioread attention */
  60.  
  61. /*
  62.  * Command responses from PS300->host.
  63.  */
  64. #define PS_DMAOK(code)  ((code)|0x0a00) /* successful dma transfer */ 
  65. #define PS_ADROK(code)  ((code)|0x0100) /* successful address tranfer */
  66.  
  67. #define PS_CODE(v)      ((v)&0xf000)    /* extract code from PS300 msg */
  68. #define PS_LUNIT(v)     ((v)&0x000f)    /* extract PS300 unit from msg */
  69.  
  70. /*
  71.  * Single unit PS300 address list.
  72.  */
  73. struct  psalist {
  74.         u_short nblocks;                /* # of i/o vectors (we always use 1) */
  75.         u_short addr[2];                /* PS300 address */
  76.         u_short wc;                     /* transfer size */
  77. };
  78.  
  79. /*
  80.  * The max dma size is actually 64KB, but
  81.  * we limit it to be just large enough for
  82.  * the maximum vector list as this is sufficient
  83.  * for our needs and we must allocate real
  84.  * memory to the intermediate buffer.
  85.  */
  86. #define PS_MAXDMA       (1024+2048*12)
  87.  
  88. /*
  89.  * Pseudo commands used internally by the driver.
  90.  */
  91. #define PS_DMAOUT       0x0100          /* dma buffer host->PS300 */
  92. #define PS_DMAIN        0x0200          /* dma buffer PS300->host */
  93.  
  94. /*
  95.  * Default timeouts.
  96.  */
  97. #define PS_TIMEOUT      30              /* dma/attention timeout (in hz) */
  98. #define PS_DIOTIMO      1000            /* dio polling timeout */
  99.