/*++
 * Copyright (c) 1990-96 Digi International Inc., All Rights Reserved
 * 
 * This software contains proprietary and confidential information of Digi
 * International Inc.  By accepting transfer of this copy, Recipient agrees
 * to retain this software in confidence, to prevent disclosure to others,
 * and to make no use of this software other than that for which it was
 * delivered.  This is an unpublished copyrighted work of Digi International
 * Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
 * prohibited.
 * 
 * Restricted Rights Legend
 *
 * Use, duplication, or disclosure by the Government is subject to
 * restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
 * Technical Data and Computer Software clause at DFARS 252.227-7031 or
 * subparagraphs (c)(1) and (2) of the Commercial Computer Software -
 * Restricted Rights at 48 CFR 52.227-19, as applicable.
 *
 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
 *
 *
 * Last Update: $Date: 10/22/97 11:56a $
 *
 * $Header: /Components/Windows/NT/Sync/Build/Mp570/hwsca.h 4     10/22/97 11:56a Darinh $
 *
 * Revision History:
 * $Log: /Components/Windows/NT/Sync/Build/Mp570/hwsca.h $
 * 
 * 4     10/22/97 11:56a Darinh
 * Changes to make multiple board installations work better.
 * 
 * 3     6/06/97 1:48p Darinh
 * Everything seems functional, but more testing is required.
 * 
 * 2     4/08/97 4:55p Darinh
 * Changes made to correspond to the new DigiUtil library.  It
 * successfully transmits data!  I don't know about receiving data yet.
 * 
 * 1     4/02/97 10:08a Darinh
 * Initial checkin; ISA cards initialize, but do not pass data.
 * 
--*/

#ifndef _HWSCA_H
#define _HWSCA_H

#include <ntddk.h>
#include "digilib.h"
#include "def570.h"
#include "def64570.h"
#include "board.h"
#include "io.h"
#include "dsmp.h"


//
//  Prototypes from hwsca.c
//

VOID
fnDisableScaInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

BOOLEAN
fnSetScaLinkConfig (IN PVOID Context);

VOID
fnSetupScaIMVR (
	IN PDEVICE_EXT	pDeviceExt);

BOOLEAN
fnStopChannel (
	IN PVOID	Context);

BOOLEAN
fnStartChannel (
	IN PVOID	Context);

VOID
fnStartRxDma (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStartRxMsci (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStartReceiver (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableRxDmaInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableRxMsciInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableRxInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableRxDmaInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableRxMsciInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableRxInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckDsrStatus (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopRxDma (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopRxMsci (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopReceiver (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckRxDmaError (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckRxDmaGood (
	IN PDEVICE_EXT	pDeviceExt);

BOOLEAN
fnCheckRxMsciError (
	IN PDEVICE_EXT	pDeviceExt,
	IN USHORT		RxFrameLen,
	IN UCHAR		DmaStatus);

VOID
fnUpdateDmaDspFrameErrorStatus (
	IN PDEVICE_EXT	pDeviceExt,
	IN USHORT		FirstDmaDspInd);

VOID
fnAdjustRxDmacEdaDsp (
	IN PDEVICE_EXT pDeviceExt);

USHORT
fnGetReceivedFrameLen (
	IN PDEVICE_EXT	pDeviceExt);


//
//  Prototypes from hwtxsca.c
//
VOID
fnEnableTxMsciInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableTxDmaInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableTxInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnEnableTimerInterrupt (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableTimerInterrupt (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopTimer (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableTxMsciInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableTxDmaInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnDisableTxInterrupts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopTxMsci (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopTxDma (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStopTransmit (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnUpdateDmaDsp (
	IN PDEVICE_EXT	pDeviceExt,
	IN USHORT		BytesCopied,
	IN UCHAR		TotalBuffers,
	IN BOOLEAN		LastFrame,
	IN USHORT		TxDspIn);

VOID
fnSetupDma (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStartTxMsci (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStartTxDma (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnStartTransmit (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckCtsStatus (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckTxDmaError (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckTxDmaGood (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnRtsDropDelay (
	IN PDEVICE_EXT	pDeviceExt,
	IN USHORT		iMultiplier);

VOID
fnRaiseRts (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnCheckTimer (
	IN PDEVICE_EXT	pDeviceExt);

VOID
fnSetAndStartTimer (
	IN PDEVICE_EXT	pDeviceExt,
	IN USHORT		TimeOutValue);

UCHAR
ReadAndClearFrameStatus (
	IN ULONG_PTR	RealAddress,
	IN PDEVICE_EXT	pDeviceExt);

VOID
UpdateInOutIndex (
	IN PUSHORT		DspInOut,
	IN PDEVICE_EXT	pDeviceExt);

#endif // _HWSCA_H
