Changeset 1105818d in rtems


Ignore:
Timestamp:
Mar 18, 1999, 4:36:50 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
b64b1ed
Parents:
dfe7746
Message:

Patch from Ian Lance Taylor <ian@…>:

Erik Ivanenko pointed out a problem in the ne2000.c driver I
submitted: it did not work correctly with bootp. Here is a patch,
based on a patch he sent me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c

    rdfe7746 r1105818d  
    366366{
    367367  unsigned int port = sc->port;
    368   unsigned char prom[16];
    369368  int i;
    370369  rtems_irq_connect_data irq;
     
    388387  outport_byte (port + BNRY, NE_STOP_PAGE - 1);
    389388
    390   /* Read the PROM to get the Ethernet hardware address.  FIXME: We
    391      should let config->hardware_address from rtems_ne_driver_attach
    392      override this.  */
    393 
    394   ne_read_data (sc, 0, sizeof prom, prom);
    395 
    396   for (i = 0; i < ETHER_ADDR_LEN; ++i)
    397     sc->arpcom.ac_enaddr[i] = prom[i * 2];
    398 
    399389  /* Set the Ethernet hardware address.  */
    400390
     
    910900  /* Handle the options passed in by the caller.  */
    911901
    912   if (config->hardware_address != NULL)
    913     memcpy (sc->arpcom.ac_enaddr, config->hardware_address,
    914             ETHER_ADDR_LEN);
    915   else
    916     memset (sc->arpcom.ac_enaddr, 0, ETHER_ADDR_LEN);
    917 
    918902  if (config->mtu != 0)
    919903    mtu = config->mtu;
     
    936920
    937921  sc->accept_broadcasts = ! config->ignore_broadcast;
     922
     923  if (config->hardware_address != NULL)
     924    memcpy (sc->arpcom.ac_enaddr, config->hardware_address,
     925            ETHER_ADDR_LEN);
     926  else
     927    {
     928      unsigned char prom[16];
     929      int ia;
     930
     931      /* Read the PROM to get the Ethernet hardware address.  */
     932
     933      outport_byte (sc->port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STP);
     934      outport_byte (sc->port + DCR, MSK_FT10 | MSK_BMS | MSK_WTS);
     935      outport_byte (sc->port + RBCR0, 0);
     936      outport_byte (sc->port + RBCR1, 0);
     937      outport_byte (sc->port + RCR, MSK_MON);
     938      outport_byte (sc->port + TCR, MSK_LOOP);
     939      outport_byte (sc->port + IMR, 0);
     940      outport_byte (sc->port + ISR, 0xff);
     941
     942      ne_read_data (sc, 0, sizeof prom, prom);
     943
     944      outport_byte (sc->port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STP);
     945
     946      for (ia = 0; ia < ETHER_ADDR_LEN; ++ia)
     947        sc->arpcom.ac_enaddr[ia] = prom[ia * 2];
     948    }
    938949
    939950  /* Set up the network interface.  */
Note: See TracChangeset for help on using the changeset viewer.