Changeset 4f38b713 in rtems


Ignore:
Timestamp:
Aug 12, 1998, 4:28:17 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
3f9da79
Parents:
b032c17
Message:

Fixed bug where the last link of the RDA was not initialized properly.

File:
1 edited

Legend:

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

    rb032c17 r4f38b713  
    5656#define SONIC_DEBUG_DESCRIPTORS      0x0010
    5757
    58 #define SONIC_DEBUG \
    59     (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS)
     58#define SONIC_DEBUG (SONIC_DEBUG_NONE)
     59
     60/* (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS) */
    6061
    6162/* SONIC_DEBUG_ALL */
     
    195196  int                             rdaCount;
    196197  ReceiveResourcePointer_t        rsa;
     198  ReceiveResourcePointer_t        rea;
    197199  CamDescriptorPointer_t          cdp;
    198200  ReceiveDescriptorPointer_t      rda;
     
    483485    free_p ((struct mbuf **)&dp->tdaTail->mbufp);
    484486
    485 /*  XXX this does not help when you wrap
    486     dp->tdaTail->frag_count        = 1;
     487/*  XXX this does not help when you wrap */
    487488    dp->tdaTail->frag[0].frag_link = LSW(dp->tdaTail->link_pad);
    488 */
     489    dp->tdaTail->frag_count        = 0;
    489490
    490491    /*
     
    656657  tdp->linkp = &(fp+1)->frag_link;
    657658  *tdp->linkp = LSW(tdp->next) | TDA_LINK_EOL;
    658   *dp->tdaHead->linkp &= ~TDA_LINK_EOL;
     659  if ( dp->tdaHead->frag_count )
     660    *dp->tdaHead->linkp &= ~TDA_LINK_EOL;
    659661  dp->tdaActiveCount++;
    660662  dp->tdaHead = tdp;
     
    804806            RTEMS_NO_TIMEOUT);
    805807  }
     808#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
     809  printf( "RDA %p\n", rdp );
     810#endif
    806811}
    807812
     
    823828
    824829  rwp = dp->rsa;
    825   rea = rwp;
     830  rea = dp->rea; /* XXX was rwp; */
    826831  rdp = dp->rda; /* XXX was rdp_last */
    827832
     
    846851    }
    847852
    848 /* printf( "Incoming packet %p\n", rdp ); */
     853#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS)
     854    printf( "Incoming packet %p status=0x%04x\n", rdp, rdp->status );
     855#endif
    849856
    850857    /*
     
    913920      rwp->buff_ptr_msw = MSW(bp->data);
    914921      rwp++;
    915       if (rwp == rea)
     922      if (rwp == rea) {
     923#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
     924        printf( "Wrapping RWP from %p to %p\n", rwp, dp->rsa );
     925#endif
    916926        rwp = dp->rsa;
     927      }
    917928      sonic_write_register( rp, SONIC_REG_RWP , LSW(rwp) );
    918929
     
    973984  TransmitDescriptorPointer_t tdp;
    974985  ReceiveDescriptorPointer_t ordp, rdp;
    975   ReceiveResourcePointer_t rwp, rea;
     986  ReceiveResourcePointer_t rwp;
    976987  struct mbuf *bp;
    977988  CamDescriptorPointer_t cdp;
     
    10141025*/
    10151026
    1016     tdp->frag_count        = 1;
     1027    tdp->frag_count        = 0;
    10171028    tdp->frag[0].frag_link = LSW(tdp + 1);
    10181029    tdp->link_pad          = LSW(tdp + 1) | TDA_LINK_EOL;
     
    10601071   *  of the list.
    10611072   */
    1062   ordp->next  = dp->rda;
    1063   ordp->link |= RDA_LINK_EOL;
     1073  ordp->next   = dp->rda;
     1074  ordp->link   = LSW(dp->rda) | RDA_LINK_EOL;
    10641075  dp->rdp_last = rdp;
    10651076 
     
    11061117    rwp->buff_wc_msw = 0;
    11071118  }
    1108   rea = rwp;
     1119  dp->rea = rwp;
     1120#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
     1121  printf( "rea area = %p\n", dp->rea );
     1122#endif
     1123
    11091124
    11101125  /*
     
    11581173  sonic_write_register( rp, SONIC_REG_RSA, LSW(dp->rsa) );
    11591174
    1160   sonic_write_register( rp, SONIC_REG_REA, LSW(rea) );
     1175  sonic_write_register( rp, SONIC_REG_REA, LSW(dp->rea) );
    11611176
    11621177  sonic_write_register( rp, SONIC_REG_RRP, LSW(dp->rsa) );
Note: See TracChangeset for help on using the changeset viewer.