Changeset 367cc5e in rtems


Ignore:
Timestamp:
Mar 24, 1999, 10:29:32 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c9b07e92
Parents:
33508cb
Message:

Patch from Eric Norum <eric@…> to use new network
interface naming convention.

Location:
c/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libchip/network/sonic.c

    r33508cb r367cc5e  
    15031503  struct ifnet *ifp;
    15041504  int mtu;
    1505   int i;
    1506 
    1507   /*
    1508    * Find an unused entry
    1509    */
    1510   i = 0;
    1511   sc = sonic_softc;
    1512   for (;;) {
    1513     if (sc == &sonic_softc[NSONIC]) {
    1514       printf ("No more SONIC devices.\n");
    1515       return 0;
    1516     }
    1517     ifp = &sc->arpcom.ac_if;
    1518     if (ifp->if_softc == NULL)
    1519       break;
    1520     sc++;
    1521     i++;
     1505  int unitNumber;
     1506  char *unitName;
     1507
     1508  /*
     1509   * Parse driver name
     1510   */
     1511  if ((unitNumber = rtems_bsdnet_parse_driver_name (config, &unitName)) < 0)
     1512    return 0;
     1513
     1514  /*
     1515   * Is driver free?
     1516   */
     1517  if ((unitNumber <= 0) || (unitNumber > NSONIC)) {
     1518    printf ("Bad SONIC unit number.\n");
     1519     return 0;
     1520  }
     1521  sc = &sonic_softc[unitNumber - 1];
     1522  ifp = &sc->arpcom.ac_if;
     1523  if (ifp->if_softc != NULL) {
     1524    printf ("Driver already in use.\n");
     1525    return 0;
    15221526  }
    15231527
     
    15631567   */
    15641568  ifp->if_softc = sc;
    1565   ifp->if_unit = i + 1;
    1566   ifp->if_name = "sonic";
     1569  ifp->if_unit = unitNumber;
     1570  ifp->if_name = unitName;
    15671571  ifp->if_mtu = mtu;
    15681572  ifp->if_init = sonic_init;
  • c/src/libchip/network/sonic.c

    r33508cb r367cc5e  
    15031503  struct ifnet *ifp;
    15041504  int mtu;
    1505   int i;
    1506 
    1507   /*
    1508    * Find an unused entry
    1509    */
    1510   i = 0;
    1511   sc = sonic_softc;
    1512   for (;;) {
    1513     if (sc == &sonic_softc[NSONIC]) {
    1514       printf ("No more SONIC devices.\n");
    1515       return 0;
    1516     }
    1517     ifp = &sc->arpcom.ac_if;
    1518     if (ifp->if_softc == NULL)
    1519       break;
    1520     sc++;
    1521     i++;
     1505  int unitNumber;
     1506  char *unitName;
     1507
     1508  /*
     1509   * Parse driver name
     1510   */
     1511  if ((unitNumber = rtems_bsdnet_parse_driver_name (config, &unitName)) < 0)
     1512    return 0;
     1513
     1514  /*
     1515   * Is driver free?
     1516   */
     1517  if ((unitNumber <= 0) || (unitNumber > NSONIC)) {
     1518    printf ("Bad SONIC unit number.\n");
     1519     return 0;
     1520  }
     1521  sc = &sonic_softc[unitNumber - 1];
     1522  ifp = &sc->arpcom.ac_if;
     1523  if (ifp->if_softc != NULL) {
     1524    printf ("Driver already in use.\n");
     1525    return 0;
    15221526  }
    15231527
     
    15631567   */
    15641568  ifp->if_softc = sc;
    1565   ifp->if_unit = i + 1;
    1566   ifp->if_name = "sonic";
     1569  ifp->if_unit = unitNumber;
     1570  ifp->if_name = unitName;
    15671571  ifp->if_mtu = mtu;
    15681572  ifp->if_init = sonic_init;
Note: See TracChangeset for help on using the changeset viewer.