Changeset 1bab8a6d in rtems


Ignore:
Timestamp:
Feb 10, 2010, 1:59:57 AM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, master
Children:
55bbc89
Parents:
5068f3f9
Message:

2010-02-09 Till Straumann <strauman@…>

  • network/tsec.c: Added code to restart halted DMA after a TX error (from error-isr). Added statistics counters for restarts and DMA bus errors.
Location:
c/src/lib/libbsp/powerpc/mvme3100
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mvme3100/ChangeLog

    r5068f3f9 r1bab8a6d  
     12010-02-09      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * network/tsec.c: Added code to restart halted DMA
     4        after a TX error (from error-isr). Added statistics
     5        counters for restarts and DMA bus errors.
     6
    172009-10-22      Sebastian Huber <sebastian.huber@embedded-brains.de>
    28
  • c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c

    r5068f3f9 r1bab8a6d  
    197197#if EV_PER_UNIT > 1
    198198#define EV_IS_PHY(ev)                   ( (ev) & 2 )
     199#endif
     200
     201#ifndef MAXEBERRS
     202#define MAXEBERRS 10
    199203#endif
    200204
     
    698702                unsigned        odrops;
    699703                unsigned        repack;
     704                unsigned        eberrs;
     705                unsigned        dmarst;
    700706        }               stats;
    701707        uint16_t                mc_refcnt[NUM_MC_HASHES];
     
    15811587        fprintf(f, "RX  IRQS: %u\n", mp->stats.rirqs);
    15821588        fprintf(f, "ERR IRQS: %u\n", mp->stats.eirqs);
     1589        fprintf(f, "bus errs: %u\n", mp->stats.eberrs);
     1590        fprintf(f, "dmawhack: %u\n", mp->stats.dmarst);
    15831591        fprintf(f, "LNK IRQS: %u\n", mp->stats.lirqs);
    15841592        fprintf(f, "maxchain: %u\n", mp->stats.maxchain);
     
    22732281struct tsec_private   *mp = (struct tsec_private *)arg;
    22742282rtems_interrupt_level l;
     2283uint32_t              pending;
    22752284
    22762285        rtems_interrupt_disable( l );
    2277                 mp->irq_pending |= tsec_dis_clr_irqs( mp );
     2286                /* make local copy since ISR may ack and clear mp->pending;
     2287                 * also, we want the fresh bits not the ORed state including
     2288                 * the past...
     2289                 */
     2290                mp->irq_pending |= (pending = tsec_dis_clr_irqs( mp ));
    22782291        rtems_interrupt_enable( l );
    22792292
     
    22842297        else
    22852298                rtems_event_send( mp->tid, mp->event );
     2299
     2300        if ( (TSEC_IEVENT_TXE & pending) ) {
     2301                if ( (TSEC_IEVENT_EBERR & pending) && ++mp->stats.eberrs > MAXEBERRS ) {
     2302                        printk(DRVNAME" BAD error: max # of DMA bus errors reached\n");
     2303                } else {
     2304                        /* Restart DMA -- do we have to clear DMACTRL[GTS], too ?? */
     2305                        fec_wr( mp->base, TSEC_TSTAT, TSEC_TSTAT_THLT );
     2306                        mp->stats.dmarst++;
     2307                }
     2308        }
    22862309}
    22872310
Note: See TracChangeset for help on using the changeset viewer.