mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
Patch from Eric Norum <eric@skatter.usask.ca> to use new network
interface naming convention.
This commit is contained in:
@@ -1502,23 +1502,27 @@ rtems_sonic_driver_attach (
|
|||||||
struct sonic_softc *sc;
|
struct sonic_softc *sc;
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
int mtu;
|
int mtu;
|
||||||
int i;
|
int unitNumber;
|
||||||
|
char *unitName;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find an unused entry
|
* Parse driver name
|
||||||
*/
|
*/
|
||||||
i = 0;
|
if ((unitNumber = rtems_bsdnet_parse_driver_name (config, &unitName)) < 0)
|
||||||
sc = sonic_softc;
|
return 0;
|
||||||
for (;;) {
|
|
||||||
if (sc == &sonic_softc[NSONIC]) {
|
/*
|
||||||
printf ("No more SONIC devices.\n");
|
* Is driver free?
|
||||||
return 0;
|
*/
|
||||||
}
|
if ((unitNumber <= 0) || (unitNumber > NSONIC)) {
|
||||||
ifp = &sc->arpcom.ac_if;
|
printf ("Bad SONIC unit number.\n");
|
||||||
if (ifp->if_softc == NULL)
|
return 0;
|
||||||
break;
|
}
|
||||||
sc++;
|
sc = &sonic_softc[unitNumber - 1];
|
||||||
i++;
|
ifp = &sc->arpcom.ac_if;
|
||||||
|
if (ifp->if_softc != NULL) {
|
||||||
|
printf ("Driver already in use.\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1562,8 +1566,8 @@ rtems_sonic_driver_attach (
|
|||||||
* Set up network interface values
|
* Set up network interface values
|
||||||
*/
|
*/
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
ifp->if_unit = i + 1;
|
ifp->if_unit = unitNumber;
|
||||||
ifp->if_name = "sonic";
|
ifp->if_name = unitName;
|
||||||
ifp->if_mtu = mtu;
|
ifp->if_mtu = mtu;
|
||||||
ifp->if_init = sonic_init;
|
ifp->if_init = sonic_init;
|
||||||
ifp->if_ioctl = sonic_ioctl;
|
ifp->if_ioctl = sonic_ioctl;
|
||||||
|
|||||||
@@ -1502,23 +1502,27 @@ rtems_sonic_driver_attach (
|
|||||||
struct sonic_softc *sc;
|
struct sonic_softc *sc;
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
int mtu;
|
int mtu;
|
||||||
int i;
|
int unitNumber;
|
||||||
|
char *unitName;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find an unused entry
|
* Parse driver name
|
||||||
*/
|
*/
|
||||||
i = 0;
|
if ((unitNumber = rtems_bsdnet_parse_driver_name (config, &unitName)) < 0)
|
||||||
sc = sonic_softc;
|
return 0;
|
||||||
for (;;) {
|
|
||||||
if (sc == &sonic_softc[NSONIC]) {
|
/*
|
||||||
printf ("No more SONIC devices.\n");
|
* Is driver free?
|
||||||
return 0;
|
*/
|
||||||
}
|
if ((unitNumber <= 0) || (unitNumber > NSONIC)) {
|
||||||
ifp = &sc->arpcom.ac_if;
|
printf ("Bad SONIC unit number.\n");
|
||||||
if (ifp->if_softc == NULL)
|
return 0;
|
||||||
break;
|
}
|
||||||
sc++;
|
sc = &sonic_softc[unitNumber - 1];
|
||||||
i++;
|
ifp = &sc->arpcom.ac_if;
|
||||||
|
if (ifp->if_softc != NULL) {
|
||||||
|
printf ("Driver already in use.\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1562,8 +1566,8 @@ rtems_sonic_driver_attach (
|
|||||||
* Set up network interface values
|
* Set up network interface values
|
||||||
*/
|
*/
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
ifp->if_unit = i + 1;
|
ifp->if_unit = unitNumber;
|
||||||
ifp->if_name = "sonic";
|
ifp->if_name = unitName;
|
||||||
ifp->if_mtu = mtu;
|
ifp->if_mtu = mtu;
|
||||||
ifp->if_init = sonic_init;
|
ifp->if_init = sonic_init;
|
||||||
ifp->if_ioctl = sonic_ioctl;
|
ifp->if_ioctl = sonic_ioctl;
|
||||||
|
|||||||
Reference in New Issue
Block a user