/*********************************************************************** 
* NOTICE
* All files contained on this disk are subject to the licensing conditions
* issued by MOTOROLA Inc.
*
* All files are copyright 1993 by MOTOROLA Inc. 
************************************************************************/


/********************************************************
 * File:	smc_tm.c
 *
 * Description:
 *	The driver routines for handling a SMC UART port.
 *
 * Routines:
 *	smc_tm_init
 *
 * Author:
 *	Ofrit Lesser
 ********************************************************/

#include "gct.h"
#include "msg.h"
#include "config.h"
#include "types.h"
#include "mtypes.h"
#include "bss.h"
#include "quicc.h"
#include "states.h"
#include "smc_tm.h"





/********************************************************
 * routine:	smc_tm_init
 *
 * description:
 *	Initialize the driver tables for
 *	SMC UART ports.
 *
 * arguments:
 *	n		the driver's child number
 *	tm		points to an smc configuration structure
 *
 * return code:
 *
 * side effects:
 *
 ********************************************************/
smc_tm_init(n, smc)
int n;
struct smc *smc;
{
	GCT *gct;
	int (* *protocol)();
	unsigned adr, rom;
	CHILD *child;
	WORK_AREA *wa;
	int i;
	extern int smc_tm_txreq(), smc_tm_rxfr(), smc_tm_conf(),
		smc_return_to_pool(), smc_tm_busy(), smc_tm_abort();

	GETGCT(gct);
	protocol = gct->driver->protocol;
	rom = gct->driver->rom;
	adr = (unsigned)smc_tm_txreq + rom;
	child = &gct->driver->child[n];
	wa = (WORK_AREA *)child->work_area;

	adr = (unsigned)smc_tm_txreq + rom;
	protocol[SUB(TX_REQ) | SMC_TM_STATE] = (int (*)())adr;
	adr = (unsigned)smc_tm_rxfr + rom;
	protocol[SUB(RX_IND) | SMC_TM_STATE] = (int (*)())adr;
	adr = (unsigned)smc_tm_conf + rom;
	protocol[SUB(RTP) | SMC_TM_STATE] = (int (*)())adr;
	adr = (unsigned)smc_tm_busy + rom;
	protocol[SUB(BUSY) | SMC_TM_STATE] = (int (*)())adr;
	adr = (unsigned)smc_return_to_pool + rom;
	protocol[SUB(RTP) | SMC_TM_STATE] = (int (*)())adr;
	adr = (unsigned)smc_tm_abort + rom;
	protocol[SUB(ABORT) | SMC_TM_STATE] = (int (*)())adr;

	gct->driver->child[n].upper = smc->upper;
	gct->driver->child[n].state = SMC_TM_STATE;
	gct->driver->child[n].smac = &protocol[SMC_TM_STATE];
	wa->minpool = 0;	/* always zero */


	wa->BDfirst = 0;
	wa->BDlast = T_I | T_L;
	wa->BDrx = R_I;
	wa->intr_rxfr = TM_RBD;
	wa->intr_txbd = TM_TBD;
	wa->intr_terr = TM_TXE;
	wa->intr_busy = TM_BSY;
	wa->t_error = TM_T_ERROR;
}



smc_tm_status()
{
}
