Changeset 43ce60a in rtems


Ignore:
Timestamp:
Apr 11, 2011, 5:28:04 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
8aa7be21
Parents:
425927e
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

    r425927e r43ce60a  
     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

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