Changeset 17cc97d in rtems


Ignore:
Timestamp:
Apr 11, 2011, 5:27:57 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10
Children:
ec9d486
Parents:
46604fcc
Message:

2011-04-11 Keith Robertson <kjrobert at alumni dot uwaterloo dot ca>

  • ne2000/ne2000.c: Add multicast support. Patch submitted to mailing list 2005-12-21.
Location:
c/src/lib/libbsp/i386/pc386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    r46604fcc r17cc97d  
     12011-04-11      Keith Robertson <kjrobert at alumni dot uwaterloo dot ca>
     2
     3        * ne2000/ne2000.c: Add multicast support. Patch submitted to mailing
     4        list 2005-12-21.
     5
    162011-03-07      Joel Sherrill <joel.sherrilL@OARcorp.com>
    27
  • c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c

    r46604fcc r17cc97d  
    506506  outport_byte (port + RCR, (sc->accept_broadcasts ? MSK_AB : 0));
    507507
     508  /* accept multicast */
     509  outport_byte (port + RCR, MSK_AM);
     510
    508511  /* Start interface */
    509512  outport_byte (port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STA);
     
    10741077}
    10751078
     1079static int ne_set_multicast_filter(struct ne_softc* sc)
     1080{
     1081  int i=0;
     1082  unsigned int port = sc->port;
     1083  unsigned char cmd = 0;
     1084       
     1085  /* Save CMDR settings */
     1086  inport_byte(port + CMDR, cmd);
     1087  /* Change to page 1 */
     1088  outport_byte(port + CMDR, cmd | MSK_PG1);
     1089
     1090  /* Set MAR to accept _all_ multicast packets */
     1091  for (i = 0; i < MARsize; ++i) {
     1092    outport_byte (port + MAR + i, 0xFF);
     1093  }
     1094
     1095  /* Revert to original CMDR settings */
     1096  outport_byte(port + CMDR, cmd);
     1097
     1098  return 0;
     1099}
     1100
    10761101/* NE2000 driver ioctl handler.  */
    10771102
     
    11071132    }
    11081133    break;
     1134 
     1135  case SIOCADDMULTI:
     1136  case SIOCDELMULTI:
     1137  {
     1138    struct ifreq* ifr = (struct ifreq*) data;
     1139    error = (command == SIOCADDMULTI ?
     1140      ether_addmulti(ifr, &(sc->arpcom)) :
     1141      ether_delmulti(ifr, &(sc->arpcom)) );
     1142    /* ENETRESET indicates that driver should update its multicast filters */
     1143    if(error == ENETRESET) {
     1144      error = ne_set_multicast_filter(sc);
     1145    }
     1146    break;
     1147  }
    11091148
    11101149  case SIO_RTEMS_SHOW_STATS:
    11111150    ne_stats (sc);
    11121151    break;
    1113 
    1114     /* FIXME: Multicast commands must be added here.  */
    11151152
    11161153  default:
     
    12651302  ifp->if_start = ne_start;
    12661303  ifp->if_output = ether_output;
    1267   ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
     1304  ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
    12681305  if (ifp->if_snd.ifq_maxlen == 0)
    12691306    ifp->if_snd.ifq_maxlen = ifqmaxlen;
Note: See TracChangeset for help on using the changeset viewer.