esp.h revision 13105
1130812Smarcel/*-
2130812Smarcel * Copyright (c) 1995 Sean Eric Fagan.
3130812Smarcel * All rights reserved.
4130812Smarcel *
5130812Smarcel * Redistribution and use in source and binary forms, with or without
6130812Smarcel * modification, are permitted provided that the following conditions
7130812Smarcel * are met:
8130812Smarcel * 1. Redistributions of source code must retain the above copyright
9130812Smarcel *    notice, this list of conditions and the following disclaimer.
10130812Smarcel * 2. Redistributions in binary form must reproduce the above copyright
11130812Smarcel *    notice, this list of conditions and the following disclaimer in the
12130812Smarcel *    documentation and/or other materials provided with the distribution.
13130812Smarcel * 3. Neither the name of the author nor the names of contributors
14130812Smarcel *    may be used to endorse or promote products derived from this software
15130812Smarcel *    without specific prior written permission.
16130812Smarcel *
17130812Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18130812Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19130812Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20130812Smarcel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21130812Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22130812Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23130812Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24130812Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25130812Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26130812Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27130812Smarcel * SUCH DAMAGE.
28130812Smarcel *
29130812Smarcel *	$Id$
30130812Smarcel */
31130812Smarcel
32130812Smarcel#ifndef _IC_ESP_H_
33130812Smarcel#define	_IC_ESP_H_
34130812Smarcel
35130812Smarcel/*
36130812Smarcel * Definitions for Hayes ESP serial cards.
37130812Smarcel */
38130812Smarcel
39130812Smarcel/*
40130812Smarcel * CMD1 and CMD2 are the command ports, offsets from <esp_iobase>.
41130812Smarcel */
42130812Smarcel#define	ESP_CMD1	4
43130812Smarcel#define	ESP_CMD2	5
44130812Smarcel
45130812Smarcel/*
46130812Smarcel * STAT1 and STAT2 are to get return values and status bytes;
47130812Smarcel * they overload CMD1 and CMD2.
48130812Smarcel */
49130812Smarcel#define	ESP_STATUS1	ESP_CMD1
50130812Smarcel#define	ESP_STATUS2	ESP_CMD2
51130812Smarcel
52130812Smarcel/*
53130812Smarcel * Commands.  Commands are given by writing the command value to
54130812Smarcel * ESP_CMD1 and then writing or reading some number of bytes from
55130812Smarcel * ESP_CMD2 or ESP_STATUS2.
56130812Smarcel */
57130812Smarcel#define	ESP_GETTEST	0x01	/* self-test command (1 byte + extras) */
58130812Smarcel#define	ESP_GETDIPS	0x02	/* get on-board DIP switches (1 byte) */
59130812Smarcel#define	ESP_SETFLOWTYPE	0x08	/* set type of flow-control (2 bytes) */
60130812Smarcel#define	ESP_SETRXFLOW	0x0a	/* set Rx FIFO flow control levels (4 bytes) */
61130812Smarcel#define	ESP_SETMODE	0x10	/* set board mode (1 byte) */
62130812Smarcel
63130812Smarcel/* Mode bits (ESP_SETMODE). */
64130812Smarcel#define	ESP_MODE_FIFO	0x02	/* act like a 16550 (compatibility mode) */
65130812Smarcel#define	ESP_MODE_RTS	0x04	/* use RTS hardware flow control */
66130812Smarcel#define	ESP_MODE_SCALE	0x80	/* scale FIFO trigger levels */
67130812Smarcel
68130812Smarcel/* Flow control type bits (ESP_SETFLOWTYPE). */
69130812Smarcel#define	ESP_FLOW_RTS	0x04	/* cmd1: local Rx sends RTS flow control */
70130812Smarcel#define	ESP_FLOW_CTS	0x10	/* cmd2: local transmitter responds to CTS */
71130812Smarcel
72130812Smarcel/* Used by ESP_SETRXFLOW. */
73130812Smarcel#define	HIBYTE(w)	(((w) >> 8) & 0xff)
74130812Smarcel#define	LOBYTE(w)	((w) & 0xff)
75130812Smarcel
76130812Smarcel#endif /* !_IC_ESP_H_ */
77130812Smarcel