linux/drivers/usb/serial/keyspan_usa90msg.h

/* SPDX-License-Identifier: BSD-3-Clause */
/*
	usa90msg.h

	Copyright (c) 1998-2003 InnoSys Incorporated.  All Rights Reserved
	This file is available under a BSD-style copyright

	Keyspan USB Async Message Formats for the USA19HS

	Redistribution and use in source and binary forms, with or without
	modification, are permitted provided that the following conditions are
	met:

	1. Redistributions of source code must retain this licence text
   	without modification, this list of conditions, and the following
   	disclaimer.  The following copyright notice must appear immediately at
   	the beginning of all source files:

        	Copyright (c) 1998-2003 InnoSys Incorporated.  All Rights Reserved

        	This file is available under a BSD-style copyright

	2. The name of InnoSys Incorporated may not be used to endorse or promote
   	products derived from this software without specific prior written
   	permission.

	THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR
	IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
	OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
	NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
	INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
	SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
	CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
	LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
	OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
	SUCH DAMAGE.    

	Revisions:

	2003feb14		add setTxMode/txMode  and cancelRxXoff to portControl
	2003mar21		change name of PARITY_0/1 to add MARK/SPACE
*/

#ifndef	__USA90MSG__
#define __USA90MSG__

struct keyspan_usa90_portControlMessage
{};

// defines for bits in lcr
#define USA_DATABITS_5
#define USA_DATABITS_6
#define USA_DATABITS_7
#define USA_DATABITS_8
#define STOPBITS_5678_1
#define STOPBITS_5_1p5
#define STOPBITS_678_2
#define USA_PARITY_NONE
#define USA_PARITY_ODD
#define USA_PARITY_EVEN
#define PARITY_MARK_1
#define PARITY_SPACE_0

#define TXFLOW_CTS	
#define TXFLOW_DSR
#define TXFLOW_XOFF	
#define TXFLOW_XOFF_ANY	
#define TXFLOW_XOFF_BITS

#define RXFLOW_XOFF	
#define RXFLOW_RTS	
#define RXFLOW_DTR
#define RXFLOW_DSR_SENSITIVITY

#define RXMODE_BYHAND	
#define RXMODE_DMA	

#define TXMODE_BYHAND	
#define TXMODE_DMA	


// all things called "StatusMessage" are sent on the status endpoint

struct keyspan_usa90_portStatusMessage	
{};

// bits in RX data message when STAT byte is included

#define RXERROR_OVERRUN
#define RXERROR_PARITY
#define RXERROR_FRAMING
#define RXERROR_BREAK

#define PORTSTATE_ENABLED
#define PORTSTATE_TXFLUSH
#define PORTSTATE_TXBREAK
#define PORTSTATE_LOOPBACK

// MSR bits

#define USA_MSR_dCTS
#define USA_MSR_dDSR
#define USA_MSR_dRI
#define USA_MSR_dDCD

#define USA_MSR_CTS
#define USA_MSR_DSR
#define USA_USA_MSR_RI
#define MSR_DCD

// ie: the maximum length of an endpoint buffer
#define MAX_DATA_LEN

#endif