/**
 * real interrupt handler.
 */
static void rt_com_isr( unsigned int com ) {

  struct rt_com_struct   *p = &(rt_com_table[com]);
  unsigned                B = p->port;
  unsigned char           data;
  unsigned char           isr;
  unsigned char           sta;
  char                    loop = 4;



  do {

    /* get available data from port */
    sta = inb(B+RT_COM_LSR);

    while(sta & DATA_READY) {

      data = inb_p(B+RT_COM_RXB);
      rt_com_irq_put(p,data);
      sta = inb_p(B+RT_COM_LSR);
    };

/*
 * the line where i thing there is a bit problem
 */
    /* if possible, put data to port */
====>    sta = inb(B+RT_COM_MSR); /* in place of inb(B+RT_COM_MSR); */

    if(sta & 0x20) {

      /* Data Set Ready */
      if(rt_com_irq_get(p,&data)) {

                /* data in output buffer */
                do {

                  outb(data,B+RT_COM_TXB);
                  sta = inb(B+RT_COM_LSR);
                } while(--loop>0 && rt_com_irq_get(p,&data));
      } else {

        /* no data in output buffer, disable Transmitter Holding
Register Empty Interrupt */
        p->ier &= ~0x02;
        outb( p->ier, B + RT_COM_IER );
      }

      sta = inb(B+RT_COM_LSR);
    };

    isr = inb(B+RT_COM_IIR) & 0x0F;
    /* check the low nibble of IIR wether there is another pending
interrupt */
  } while((isr) && --loop>0);
  return;
}
 

Perhaps i do a mistake cat you tell me what do you think?


        thanks....


Reply via email to