Ignore:
Timestamp:
Feb 17, 2009, 6:37:02 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 5, master
Children:
94dd4f6
Parents:
49633b9
Message:

2009-02-17 Till Straumann <strauman@…>

PR 1371/bsps

  • network/network.c: mvme167 network driver buggy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mvme167/network/network.c

    r49633b9 rf6cef3a  
    3030*/
    3131
     32#define IGNORE_SPURIOUS_IRQ
     33#define IGNORE_NO_RFA
     34#define IGNORE_MULTIPLE_RF
     35
    3236/*
    3337 * Default number of buffer descriptors and buffer sizes.
     
    7074
    7175/* If we are running interrupt driven I/O no debug output is printed */
    72 #if CD2401_POLLED_IO == 1
    73    #define printk(arglist) printk arglist;
     76#if CD2401_IO_MODE == 0
     77   #define printk(arglist) do { printk arglist; printk("\r"); } while (0);
    7478#else
    7579   #define printk(arglist)
     
    907911
    908912  uti596_softc.pEndRFA->next = I596_NULL;
    909   UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" )
     913  UTI_596_ASSERT(uti596_softc.countRFD == num,"INIT:WRONG RFD COUNT\n" )
    910914
    911915  #ifdef DBG_INIT
     
    10301034   * internal triggering, linear mode
    10311035   */
    1032   sc->pScp->sysbus = 0x54;
     1036  sc->pScp->sysbus = 0x44;
    10331037
    10341038  /* provide the iscp to the scp, keep a pointer for our use */
     
    12201224  }
    12211225
    1222   sc->pEndRFA->next = sc->pSavedRfdQueue;
     1226  sc->pEndRFA->next = (i596_rfd*)word_swap((uint32_t)sc->pSavedRfdQueue);
    12231227  if ( sc->pSavedRfdQueue != I596_NULL ) {
    12241228    sc->pEndRFA = sc->pEndSavedQueue;
     
    18471851    #endif
    18481852  }
     1853 
     1854  /*
     1855   * In case the ISR discovers there are no resources it reclaims
     1856   * them and restarts
     1857   */
     1858  sc->started = 1;
    18491859
    18501860  /*
     
    21332143)
    21342144{
     2145int fullStatus;
     2146
    21352147        #ifdef DBG_ISR
    21362148  printk(("uti596_DynamicInterruptHandler: begins"))
     
    21392151 uti596_wait (&uti596_softc, UTI596_WAIT_FOR_CU_ACCEPT);
    21402152
    2141  scbStatus = uti596_softc.scb.status & 0xf000;
     2153 scbStatus = (fullStatus = uti596_softc.scb.status) & 0xf000;
    21422154
    21432155 if ( scbStatus ) {
     
    21672179  }
    21682180  else {
    2169     printk(("\n***ERROR: Spurious interrupt. Resetting...\n"))
     2181#ifndef IGNORE_SPURIOUS_IRQ
     2182    printk(("\n***ERROR: Spurious interrupt (full status 0x%x). Resetting...\n", fullStatus))
    21702183    uti596_softc.nic_reset = 1;
     2184#endif
    21712185  }
    21722186
     
    22182232    if ( uti596_softc.pBeginRFA == I596_NULL ||
    22192233       !( uti596_softc.pBeginRFA -> stat & STAT_C)) {
     2234#ifndef IGNORE_NO_RFA
    22202235      uti596_dump_scb();
    22212236      uti596_softc.nic_reset = 1;
     2237#endif
    22222238    }
    22232239    else {
     
    22292245                                #endif
    22302246        count_rx ++;
     2247#ifndef IGNORE_MULTIPLE_RF
    22312248        if ( count_rx > 1) {
    2232           printk(("****WARNING: Received 2 frames on 1 interrupt \n"))
    2233                                 }
     2249          printk(("****WARNING: Received %i frames on 1 interrupt \n", count_rx))
     2250                }
     2251#endif
    22342252       /* Give Received Frame to the ULCS */
    22352253        uti596_softc.countRFD--;
     
    27122730  for( pRfd = uti596_softc.pSavedRfdQueue;
    27132731       pRfd != I596_NULL;
    2714        pRfd = pRfd -> next) {
     2732       pRfd = (i596_rfd*)word_swap((uint32_t)pRfd -> next)) {
    27152733      printk(("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd))
    27162734  }
     
    27202738  for( pRfd = uti596_softc.pInboundFrameQueue;
    27212739       pRfd != I596_NULL;
    2722        pRfd = pRfd -> next) {
     2740       pRfd = (i596_rfd*)word_swap((uint32_t)pRfd -> next)) {
    27232741    printk(("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd))
    27242742  }
     
    27292747  for( pRfd = uti596_softc.pBeginRFA;
    27302748       pRfd != I596_NULL;
    2731        pRfd = pRfd -> next) {
     2749       pRfd = (i596_rfd*)word_swap((uint32_t)pRfd -> next)) {
    27322750    printk(("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd))
    27332751  }
     
    27522770  for ( pRfd = uti596_softc.pBeginRFA;
    27532771        pRfd != I596_NULL;
    2754         pRfd = pRfd->next) {
     2772        pRfd = (i596_rfd *)word_swap((uint32_t)pRfd->next) ) {
    27552773    printk(("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
    27562774            pRfd, pRfd->stat, pRfd->cmd))
     
    27602778  for ( pRfd = uti596_softc.pInboundFrameQueue;
    27612779        pRfd != I596_NULL;
    2762         pRfd = pRfd->next) {
     2780        pRfd = (i596_rfd *)word_swap((uint32_t)pRfd->next) ) {
    27632781    printk(("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
    27642782            pRfd, pRfd->stat, pRfd->cmd))
     
    27692787  for ( pRfd = uti596_softc.pSavedRfdQueue;
    27702788        pRfd != I596_NULL;
    2771         pRfd = pRfd->next) {
     2789        pRfd = (i596_rfd *)word_swap((uint32_t)pRfd->next) ) {
    27722790    printk(("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
    27732791             pRfd, pRfd->stat, pRfd->cmd))
     
    27942812        pRfd != I596_NULL &&
    27952813        pRfd != NULL;
    2796         pRfd = pRfd->next) {
     2814        pRfd = (i596_rfd *)word_swap((uint32_t)pRfd->next) ) {
    27972815    printk(("0x%p\n", pRfd))
    27982816  }
     
    28052823        pRfd != I596_NULL &&
    28062824        pRfd != NULL;
    2807         pRfd = pRfd->next) {
     2825        pRfd = (i596_rfd *)word_swap((uint32_t)pRfd->next) ) {
    28082826    printk(("0x%p\n", pRfd))
    28092827  }
Note: See TracChangeset for help on using the changeset viewer.