Low Level Controller
if (Two)
{
/* two byte control field ?
*/
if (pt->pt_rx_cnt == 0)
frame_status = MUTILATED;
if (pt->pt_rx_cnt > 0)
pt->pt_rx_cnt--;
ctrl <<= 8;
ctrl |= (WORD) *ptr++;
}
break;
}
if (pt->pt_rx_cnt > 260)
{
/* I part greater than 260 ?
/* must reset the controller
*/
*/
pt->pt_rx_frame = PT_FR_OVERFLOW;
N201_ERROR(pei);
outp (pt->pt_r_cmdr, CMDR_RMC | CMDR_RHR | CMDR_XRES);
outp (pt->pt_r_timr, inp(pt->pt_r_timr));
pt->pt_state |= PT_HDLC_RESET;
FREE_TX_PATH (pt->pt_pei);
}
else
if (!CR_of_I_valid)
{
/* C/R of I frame invalid in TE ?
/* prevent acknowledging S-frame
/* beeing sent and create
*/
*/
*/
*/
/* PROTOCOL_ERROR message.
pt->pt_rx_frame = PT_FR_FAULT;
PROTOCOL_ERROR (pt->pt_pei);
/* must reset the controller
*/
outp (pt->pt_r_cmdr, CMDR_RMC | CMDR_RHR | CMDR_XRES);
outp (pt->pt_r_timr, inp(pt->pt_r_timr));
pt->pt_state |= PT_HDLC_RESET;
FREE_TX_PATH (pt->pt_pei);
}
else
outp (pt->pt_r_cmdr, CMDR_RMC | (inp (pt->pt_r_star) & CMDR_RNR));
/* enter ’RMC’ command if not
*/
/************************************************************************/
/*
*/
*/
*/
*/
*/
*/
*/
/* Now all information about the received frame is available:
/*
/*
/*
/*
/*
- performed address recognition or TEI and SAPI values.
- HDLC control field
- type of frame (HDLC U, UI, S, I frame).
- info about the validity of the frame
/************************************************************************/
if (rsta = (rsta & (RSTA_RDO | RSTA_CRC | RSTA_RAB)) ^RSTA_CRC)
pt->pt_rx_frame = PT_FR_FAULT;
switch (pt->pt_rx_frame)
Semiconductor Group
305