11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	usa26msg.h
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Copyright (C) 1998-2000 InnoSys Incorporated.  All Rights Reserved
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	This file is available under a BSD-style copyright
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Keyspan USB Async Message Formats for the USA28X
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Redistribution and use in source and binary forms, with or without
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	modification, are permitted provided that the following conditions are
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	met:
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	1. Redistributions of source code must retain this licence text
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   	without modification, this list of conditions, and the following
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   	disclaimer.  The following copyright notice must appear immediately at
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   	the beginning of all source files:
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds        	Copyright (C) 1998-2000 InnoSys Incorporated.  All Rights Reserved
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds        	This file is available under a BSD-style copyright
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	2. The name of InnoSys Incorporated may not be used to endorse or promote
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   	products derived from this software without specific prior written
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   	permission.
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	SUCH DAMAGE.
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Third revision: USA28X version (aka USA26)
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Buffer formats for RX/TX data messages are not defined by
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	a structure, but are described here:
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	USB OUT (host -> USAxx, transmit) messages contain a
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	REQUEST_ACK indicator (set to 0xff to request an ACK at the
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	completion of transmit; 0x00 otherwise), followed by data:
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		RQSTACK DAT DAT DAT ...
481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	with a total data length of 63.
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	USB IN (USAxx -> host, receive) messages begin with a status
521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	byte in which the 0x80 bit is either:
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		(a)	0x80 bit clear
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			indicates that the bytes following it are all data
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			bytes:
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds				STAT DATA DATA DATA DATA DATA ...
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			for a total of up to 63 DATA bytes,
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	or:
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		(b)	0x80 bit set
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			indiates that the bytes following alternate data and
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			status bytes:
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds				STAT DATA STAT DATA STAT DATA STAT DATA ...
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			for a total of up to 32 DATA bytes.
711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	The valid bits in the STAT bytes are:
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		OVERRUN	0x02
751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		PARITY	0x04
761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		FRAMING	0x08
771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		BREAK	0x10
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Notes:
801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	(1) The OVERRUN bit can appear in either (a) or (b) format
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		messages, but the but the PARITY/FRAMING/BREAK bits
831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		only appear in (b) format messages.
841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	(2) For the host to determine the exact point at which the
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		overrun occurred (to identify the point in the data
861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		stream at which the data was lost), it needs to count
871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		128 characters, starting at the first character of the
881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		message in which OVERRUN was reported; the lost character(s)
891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		would have been received between the 128th and 129th
901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		characters.
911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	(3)	An RX data message in which the first byte has 0x80 clear
921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		serves as a "break off" indicator.
931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	revision history:
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	1999feb10	add reportHskiaChanges to allow us to ignore them
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	1999feb10	add txAckThreshold for fast+loose throughput enhancement
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	1999mar30	beef up support for RX error reporting
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	1999apr14	add resetDataToggle to control message
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	2000jan04	merge with usa17msg.h
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	2000jun01	add extended BSD-style copyright text
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	2001jul05	change message format to improve OVERRUN case
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	Note on shared names:
1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	In the case of fields which have been merged between the USA17
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	and USA26 definitions, the USA26 definition is the first part
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	of the name and the USA17 definition is the second part of the
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	name; both meanings are described below.
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds*/
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef	__USA26MSG__
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	__USA26MSG__
1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct keyspan_usa26_portControlMessage
1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/*
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		there are three types of "commands" sent in the control message:
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		1.	configuration changes which must be requested by setting
1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			the corresponding "set" flag (and should only be requested
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			when necessary, to reduce overhead on the USA26):
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	*/
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	setClocking,	// BOTH: host requests baud rate be set
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		baudLo,		// BOTH: host does baud divisor calculation
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		baudHi,		// BOTH: baudHi is only used for first port (gives lower rates)
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		externalClock_txClocking,
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA26: 0=internal, other=external
1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA17: 0=internal, other=external/RI
1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxClocking,		// USA17: 0=internal, 1=external/RI, other=external/DSR
1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		setLcr,			// BOTH: host requests lcr be set
1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		lcr,			// BOTH: use PARITY, STOPBITS, DATABITS below
1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		setFlowControl,		// BOTH: host requests flow control be set
1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		ctsFlowControl,		// BOTH: 1=use CTS flow control, 0=don't
1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		xonFlowControl,		// BOTH: 1=use XON/XOFF flow control, 0=don't
1401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		xonChar,		// BOTH: specified in current character format
1411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		xoffChar,		// BOTH: specified in current character format
1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		setTxTriState_setRts,
1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA26: host requests TX tri-state be set
1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA17: host requests RTS output be set
1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		txTriState_rts,		// BOTH: 1=active (normal), 0=tristate (off)
1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		setHskoa_setDtr,
1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA26: host requests HSKOA output be set
1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// USA17: host requests DTR output be set
1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		hskoa_dtr,		// BOTH: 1=on, 0=off
1521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		setPrescaler,		// USA26: host requests prescalar be set (default: 13)
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		prescaler;		// BOTH: specified as N/8; values 8-ff are valid
1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// must be set any time internal baud rate is set;
1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// must not be set when external clocking is used
1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// note: in USA17, prescaler is applied whenever
1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					// setClocking is requested
1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/*
1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		3.	configuration data which is simply used as is (no overhead,
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			but must be specified correctly in every host message).
1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	*/
1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	forwardingLength,  // BOTH: forward when this number of chars available
1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		reportHskiaChanges_dsrFlowControl,
1661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds						// USA26: 1=normal; 0=ignore external clock
1671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds						// USA17: 1=use DSR flow control, 0=don't
1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		txAckThreshold,	// BOTH: 0=not allowed, 1=normal, 2-255 deliver ACK faster
1691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		loopbackMode;	// BOTH: 0=no loopback, 1=loopback enabled
1701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	/*
1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		4.	commands which are flags only; these are processed in order
1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			(so that, e.g., if both _txOn and _txOff flags are set, the
1741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds			port ends in a TX_OFF state); any non-zero value is respected
1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	*/
1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	_txOn,			// BOTH: enable transmitting (and continue if there's data)
1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		_txOff,			// BOTH: stop transmitting
1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		txFlush,		// BOTH: toss outbound data
1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		txBreak,		// BOTH: turn on break (cleared by _txOn)
1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxOn,			// BOTH: turn on receiver
1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxOff,			// BOTH: turn off receiver
1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxFlush,		// BOTH: toss inbound data
1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxForward,		// BOTH: forward all inbound data, NOW (as if fwdLen==1)
1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		returnStatus,	// BOTH: return current status (even if it hasn't changed)
1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		resetDataToggle;// BOTH: reset data toggle state to DATA0
1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// defines for bits in lcr
1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_DATABITS_5		0x00
1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_DATABITS_6		0x01
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_DATABITS_7		0x02
1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_DATABITS_8		0x03
1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	STOPBITS_5678_1	0x00	// 1 stop bit for all byte sizes
1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	STOPBITS_5_1p5	0x04	// 1.5 stop bits for 5-bit byte
1961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	STOPBITS_678_2	0x04	// 2 stop bits for 6/7/8-bit byte
1971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_PARITY_NONE		0x00
1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_PARITY_ODD		0x08
1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	USA_PARITY_EVEN		0x18
2001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	PARITY_1		0x28
2011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	PARITY_0		0x38
2021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// all things called "StatusMessage" are sent on the status endpoint
2041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct keyspan_usa26_portStatusMessage	// one for each port
2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
2071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	port,			// BOTH: 0=first, 1=second, other=see below
2081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		hskia_cts,		// USA26: reports HSKIA pin
2091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds						// USA17: reports CTS pin
2101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		gpia_dcd,		// USA26: reports GPIA pin
2111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds						// USA17: reports DCD pin
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		dsr,			// USA17: reports DSR pin
2131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		ri,				// USA17: reports RI pin
2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		_txOff,			// port has been disabled (by host)
2151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		_txXoff,		// port is in XOFF state (either host or RX XOFF)
2161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		rxEnabled,		// as configured by rxOn/rxOff 1=on, 0=off
2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		controlResponse;// 1=a control message has been processed
2181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// bits in RX data message when STAT byte is included
2211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	RXERROR_OVERRUN	0x02
2221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	RXERROR_PARITY	0x04
2231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	RXERROR_FRAMING	0x08
2241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	RXERROR_BREAK	0x10
2251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct keyspan_usa26_globalControlMessage
2271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
2281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	sendGlobalStatus,	// 2=request for two status responses
2291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		resetStatusToggle,	// 1=reset global status toggle
2301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		resetStatusCount;	// a cycling value
2311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct keyspan_usa26_globalStatusMessage
2341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
2351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	port,				// 3
2361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		sendGlobalStatus,	// from request, decremented
2371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		resetStatusCount;	// as in request
2381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct keyspan_usa26_globalDebugMessage
2411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
2421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8	port,				// 2
2431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		a,
2441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		b,
2451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		c,
2461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds		d;
2471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// ie: the maximum length of an EZUSB endpoint buffer
2501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	MAX_DATA_LEN			64
2511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// update status approx. 60 times a second (16.6666 ms)
2531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	STATUS_UPDATE_INTERVAL	16
2541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds// status rationing tuning value (each port gets checked each n ms)
2561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	STATUS_RATION	10
2571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif
2591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
261