Patch from Eric Norum <eric@cls.usask.ca> to add "attaching" argument

to driver attach routine.
This commit is contained in:
Joel Sherrill
2000-08-02 21:08:44 +00:00
parent 409a221198
commit 3393f6dda3
2 changed files with 11 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ extern "C" {
* Network driver configuration
*/
struct rtems_bsdnet_ifconfig;
extern int rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config);
extern int rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching);
#define RTEMS_BSP_NETWORK_DRIVER_NAME "scc1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_scc1_driver_attach

View File

@@ -942,7 +942,7 @@ scc_ioctl (struct ifnet *ifp, int command, caddr_t data)
* Attach an SCC driver to the system
*/
int
rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config)
rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching)
{
struct scc_softc *sc;
struct ifnet *ifp;
@@ -950,6 +950,14 @@ rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config)
int unitNumber;
char *unitName;
/*
* Make sure we're really being attached
*/
if (!attaching) {
printf ("SCC1 driver can not be detached.\n");
return 0;
}
/*
* Parse driver name
*/
@@ -1049,4 +1057,4 @@ rtems_scc1_driver_attach (struct rtems_bsdnet_ifconfig *config)
if_attach (ifp);
ether_ifattach (ifp);
return 1;
};
}