Low Level Controller
if (pt->pt_state & PT_TX_ACTIVE && pt->pt_op_mode != PT_MD_AUTO)
return (ACK_ACCESS_FAULT);
if (pt->pt_op_mode == PT_MD_AUTO)
{
/* it is not allowed to send an I
/* frame in the timer recovery
/* or in waiting_for_acknowledge
/* status
*/
*/
*/
*/
if (inp(pt->pt_r_star2) & (STAR2_TREC | STAR2_WFA))
if (frame_type == PT_FR_I)
return (ACK_ACCESS_FAULT);
if (inp(pt->pt_r_star2) & STAR2_WFA)
if (pt->pt_state & PT_TX_MMU_FREE)
{
MMU_free (pt->pt_tx_start);
pt->pt_state &= ~PT_TX_MMU_FREE;
}
}
pt->pt_state
pt->pt_tx_start = frame_ptr;
pt->pt_tx_frame = frame_type;
|= PT_TX_ACTIVE;
/* transmitter is active
/* store data frame pointer
/* and frame type
*/
*/
*/
if (cnt <= 32)
{
/* if the number of bytes is <=32
/* the frame can be shifted
/* completely into the XFIFO
*/
*/
*/
STRING_OUT (frame_ptr, pt->pt_r_fifo, cnt);
pt->pt_tx_cnt = 0;
}
else
{
/* if the number of bytes is
/* greater 32 the first 32 are
/* shifted into the XFIFO, the
/* remaining are sent later
/* (interrupt service routine)
*/
*/
*/
*/
*/
STRING_OUT (frame_ptr, pt->pt_r_fifo, 32);
pt->pt_tx_cnt = cnt - 32;
pt->pt_tx_curr = frame_ptr + 32;
}
/* compute the command byte for
/* the CMDR register:
*/
*/
*/
*/
*/
*/
*/
*/
/* in automode the ’transmit I
/* frame’ command must be used
/* when it is an HDLC I frame.
/* The ’transmit transparent
/* frame’ command must be used in
/* all other cases
if (pt->pt_op_mode == PT_MD_AUTO)
{
cmd = (pt->pt_tx_frame == PT_FR_I) ? CMDR_XIF : CMDR_XTF;
Semiconductor Group
293