Changeset 7344fba9 in rtems


Ignore:
Timestamp:
Aug 10, 1998, 9:45:01 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
df8d3601
Parents:
c153a7b
Message:

Can now reply to multiple successive pings successfully without being in
promiscuous mode.

It still dies somewhere between 16 and 20 pings.

Location:
c/src/lib/libbsp/powerpc/dmv177/sonic
Files:
2 edited

Legend:

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

    rc153a7b r7344fba9  
    11331133
    11341134  if (broadcastFlag)
    1135     sonic_write_register( rp, SONIC_REG_RCR, RCR_BRD | RDA_STATUS_PRO );
     1135    sonic_write_register( rp, SONIC_REG_RCR, RCR_BRD );
    11361136  else
    1137     sonic_write_register( rp, SONIC_REG_RCR, 0  | RDA_STATUS_PRO);
     1137    sonic_write_register( rp, SONIC_REG_RCR, 0 );
    11381138
    11391139  /*
     
    11771177
    11781178  /*
    1179    * Set up the SONIC CAM with our hardware address.
    1180    * Use the Receive Resource Area to hold the CAM Descriptor Area.
    1181    */
     1179   *  Set up the SONIC CAM with our hardware address.
     1180   */
     1181
    11821182  hwaddr = dp->iface->hwaddr;
    11831183  cdp = dp->cdp;
    1184 
    1185   for (i=0 ; i<16 ; i++ ) {
    1186     /*
    1187      *  cap0, cap1, and cap2 are zeroed by sonic_allocate.
    1188      */
    1189     cdp->desc[i].cep = i;
    1190   }
    11911184
    11921185#if (SONIC_DEBUG & SONIC_DEBUG_CAM)
     
    11941187     hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5] );
    11951188#endif
    1196   cdp->desc[0].cep = 0;      /* Fill first entry in CAM */
    1197   cdp->desc[0].cap2 = hwaddr[0] << 8 | hwaddr[1];
    1198   cdp->desc[0].cap1 = hwaddr[2] << 8 | hwaddr[3];
    1199   cdp->desc[0].cap0 = hwaddr[4] << 8 | hwaddr[5];
    1200   cdp->ce = 0x0001;    /* Enable first entry in CAM */
    1201 
    1202   sonic_write_register( rp, SONIC_REG_CDC, 16 );      /* 16 entries in CDA */
     1189
     1190  cdp->cep  = 0;                     /* Fill first and only entry in CAM */
     1191  cdp->cap0 = hwaddr[1] << 8 | hwaddr[0];
     1192  cdp->cap1 = hwaddr[3] << 8 | hwaddr[2];
     1193  cdp->cap2 = hwaddr[5] << 8 | hwaddr[4];
     1194  cdp->ce   = 0x0001;                /* Enable first entry in CAM */
     1195
     1196  sonic_write_register( rp, SONIC_REG_CDC, 1 );      /* 1 entry in CDA */
    12031197  sonic_write_register( rp, SONIC_REG_CDP, LSW(cdp) );
    1204   sonic_write_register( rp, SONIC_REG_CR, CR_LCAM );  /* Load the CAM */
     1198  sonic_write_register( rp, SONIC_REG_CR,  CR_LCAM );  /* Load the CAM */
     1199
    12051200  while (sonic_read_register( rp, SONIC_REG_CR ) & CR_LCAM)
    12061201    continue;
     
    12171212      "  Wrote %04x%04x%04x - %#x\n"
    12181213      "   Read %04x%04x%04x - %#x\n",
    1219         cdp->desc[0].cap2, cdp->desc[0].cap1, cdp->desc[0].cap0, cdp->ce,
     1214        cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
    12201215        sonic_read_register( rp, SONIC_REG_CAP2 ),
    12211216        sonic_read_register( rp, SONIC_REG_CAP1 ),
     
    12251220
    12261221  sonic_write_register( rp, SONIC_REG_CEP, 0 );  /* Select first entry in CAM */
    1227   if ((sonic_read_register( rp, SONIC_REG_CAP2 ) != cdp->desc[0].cap2)
    1228    || (sonic_read_register( rp, SONIC_REG_CAP1 ) != cdp->desc[0].cap1)
    1229    || (sonic_read_register( rp, SONIC_REG_CAP0 ) != cdp->desc[0].cap0)
     1222  if ((sonic_read_register( rp, SONIC_REG_CAP2 ) != cdp->cap2)
     1223   || (sonic_read_register( rp, SONIC_REG_CAP1 ) != cdp->cap1)
     1224   || (sonic_read_register( rp, SONIC_REG_CAP0 ) != cdp->cap0)
    12301225   || (sonic_read_register( rp, SONIC_REG_CE ) != cdp->ce)) {
    12311226    printf ("Failed to load Ethernet address into SONIC CAM.\n"
    12321227      "  Wrote %04x%04x%04x - %#x\n"
    12331228      "   Read %04x%04x%04x - %#x\n",
    1234         cdp->desc[0].cap2, cdp->desc[0].cap1, cdp->desc[0].cap0, cdp->ce,
     1229        cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
    12351230        sonic_read_register( rp, SONIC_REG_CAP2 ),
    12361231        sonic_read_register( rp, SONIC_REG_CAP1 ),
  • c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h

    rc153a7b r7344fba9  
    334334
    335335typedef struct {
    336   struct {
    337     rtems_unsigned32  cep;  /* CAM Entry Pointer */
    338     rtems_unsigned32  cap0; /* CAM Address Port 0 xx-xx-xx-xx-YY-YY */
    339     rtems_unsigned32  cap1; /* CAM Address Port 1 xx-xx-YY-YY-xxxx */
    340     rtems_unsigned32  cap2; /* CAM Address Port 2 YY-YY-xx-xx-xx-xx */
    341   } desc[16];
     336  rtems_unsigned32  cep;  /* CAM Entry Pointer */
     337  rtems_unsigned32  cap0; /* CAM Address Port 0 xx-xx-xx-xx-YY-YY */
     338  rtems_unsigned32  cap1; /* CAM Address Port 1 xx-xx-YY-YY-xxxx */
     339  rtems_unsigned32  cap2; /* CAM Address Port 2 YY-YY-xx-xx-xx-xx */
    342340  rtems_unsigned32  ce;
    343341} CamDescriptor_t;
Note: See TracChangeset for help on using the changeset viewer.