1*34406Skarels /* 2*34406Skarels * @(#)psproto.h 7.1 (Berkeley) 05/21/88 3*34406Skarels */ 430224Ssam 530224Ssam /* 630224Ssam * PS300-Host Handshake Protocol Definitions. 730224Ssam */ 830224Ssam 930224Ssam /* 1030224Ssam * Commands sent from host->PS300. 1130224Ssam * 1230224Ssam * In the initial handshake carried out when requesting 1330224Ssam * one of these commands be performed, the PS300 always 1430224Ssam * returns the identical code to indicate success. 1530224Ssam */ 1630224Ssam #define PS_ABORT 0x1000 /* abort current command */ 1730224Ssam #define PS_RESET 0x3000 /* reset device */ 1830224Ssam #define PS_RDNET 0x5000 /* logical read */ 1930224Ssam #define PS_LOOKUP 0x8000 /* name lookup */ 2030224Ssam #define PS_RDPHY 0x9000 /* physical read */ 2130224Ssam #define PS_WRPHY_SYNC 0xa000 /* physical write w/ sync */ 2230224Ssam #define PS_WRPHY 0xb000 /* physical write */ 2330224Ssam #define PS_WRNET 0xc000 /* logical write */ 2430224Ssam #define PS_DETACH 0xd000 /* normal/diagnostic detach */ 2530224Ssam #define PS_ATTACH 0xe000 /* normal attach */ 2630224Ssam #define PS_DATTACH 0xf000 /* diagnostic attach */ 2730224Ssam 2830224Ssam #define PS_DIOREAD 0x4000 /* internal, wait for dioread attention */ 2930224Ssam 3030224Ssam /* 3130224Ssam * Command responses from PS300->host. 3230224Ssam */ 3330224Ssam #define PS_DMAOK(code) ((code)|0x0a00) /* successful dma transfer */ 3430224Ssam #define PS_ADROK(code) ((code)|0x0100) /* successful address tranfer */ 3530224Ssam 3630224Ssam #define PS_CODE(v) ((v)&0xf000) /* extract code from PS300 msg */ 3730224Ssam #define PS_LUNIT(v) ((v)&0x000f) /* extract PS300 unit from msg */ 3830224Ssam 3930224Ssam /* 4030224Ssam * Single unit PS300 address list. 4130224Ssam */ 4230224Ssam struct psalist { 4330224Ssam u_short nblocks; /* # of i/o vectors (we always use 1) */ 4430224Ssam u_short addr[2]; /* PS300 address */ 4530224Ssam u_short wc; /* transfer size */ 4630224Ssam }; 4730224Ssam 4830224Ssam /* 4930224Ssam * The max dma size is actually 64KB, but 5030224Ssam * we limit it to be just large enough for 5130224Ssam * the maximum vector list as this is sufficient 5230224Ssam * for our needs and we must allocate real 5330224Ssam * memory to the intermediate buffer. 5430224Ssam */ 5530224Ssam #define PS_MAXDMA (1024+2048*12) 5630224Ssam 5730224Ssam /* 5830224Ssam * Pseudo commands used internally by the driver. 5930224Ssam */ 6030224Ssam #define PS_DMAOUT 0x0100 /* dma buffer host->PS300 */ 6130224Ssam #define PS_DMAIN 0x0200 /* dma buffer PS300->host */ 6230224Ssam 6330224Ssam /* 6430224Ssam * Default timeouts. 6530224Ssam */ 6630224Ssam #define PS_TIMEOUT 30 /* dma/attention timeout (in hz) */ 6730224Ssam #define PS_DIOTIMO 1000 /* dio polling timeout */ 68