Changeset 1253f39 in rtems


Ignore:
Timestamp:
Aug 13, 1998, 4:20:14 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
af3e81c9
Parents:
70502bc4
Message:

Cleaned up some debugging stuff.

Redid interrupt handler to read imr/isr once and to write the imr once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c

    r70502bc4 r1253f39  
    1 void break_when_you_get_here();
    21/*
    32 *******************************************************************
     
    5756#define SONIC_DEBUG_ERRORS           0x0020
    5857
    59 #define SONIC_DEBUG (SONIC_DEBUG_ERRORS)
    60 
    61 /* (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS) */
    62 
    63 /* SONIC_DEBUG_ALL */
    64 
     58#define SONIC_DEBUG (SONIC_DEBUG_NONE)
    6559
    6660/*
     
    132126 */
    133127#define RDA_COUNT     20
    134 #define TDA_COUNT     100
     128#define TDA_COUNT     10
    135129
    136130/*
     
    372366{
    373367  struct sonic *dp = sonic;
     368  unsigned32    isr, imr;
    374369  void *rp;
    375370
     
    393388  dp->Interrupts++;
    394389
     390  isr = sonic_read_register( rp, SONIC_REG_ISR );
     391  imr = sonic_read_register( rp, SONIC_REG_IMR );
     392
    395393  /*
    396394   * Packet received or receive buffer area exceeded?
    397395   */
    398   if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PRXEN | IMR_RBAEEN)) &&
    399       (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PKTRX | ISR_RBAE))) {
    400     sonic_write_register(
    401        rp,
    402        SONIC_REG_IMR,
    403        sonic_read_register( rp, SONIC_REG_IMR) & ~(IMR_PRXEN | IMR_RBAEEN)
    404     );
     396  if ((imr & (IMR_PRXEN | IMR_RBAEEN)) &&
     397      (isr & (ISR_PKTRX | ISR_RBAE))) {
     398    imr &= ~(IMR_PRXEN | IMR_RBAEEN);
    405399    dp->rxInterrupts++;
    406400    rtems_event_send (dp->iface->rxproc, INTERRUPT_EVENT);
     
    410404   * Packet started, transmitter done or transmitter error?
    411405   */
    412   if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN))
    413    && (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PINT | ISR_TXDN | ISR_TXER))) {
    414     sonic_write_register(
    415        rp,
    416        SONIC_REG_IMR,
    417        sonic_read_register( rp, SONIC_REG_IMR) &
    418                   ~(IMR_PINTEN | IMR_PTXEN | IMR_TXEREN)
    419     );
     406  if ((imr & (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN))
     407   && (isr & (ISR_PINT | ISR_TXDN | ISR_TXER))) {
     408    imr &= ~(IMR_PINTEN | IMR_PTXEN | IMR_TXEREN);
    420409    dp->txInterrupts++;
    421410    rtems_event_send (dp->txWaitTid, INTERRUPT_EVENT);
    422411  }
     412
     413  sonic_write_register( rp, SONIC_REG_IMR, imr );
    423414}
    424415
     
    15241515};
    15251516#endif
     1517
    15261518void sonic_write_register(
    15271519  void       *base,
Note: See TracChangeset for help on using the changeset viewer.