forked from Imagelibrary/rtems
Patch from Eric Norum <eric@cls.usask.ca> to add "attaching" argument
to driver attach routine.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user