summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-01-03 13:20:30 +0000
committerwpaul <wpaul@FreeBSD.org>2004-01-03 13:20:30 +0000
commit79a95fe15c1400e22ec9af52d14c5b62559caf9c (patch)
tree37fb615bef64304844c0cbea0174031441dabfe3 /sys/dev/if_ndis
parent046c0f006559f9c152b68863e7e868122fe49e0d (diff)
downloadFreeBSD-src-79a95fe15c1400e22ec9af52d14c5b62559caf9c.zip
FreeBSD-src-79a95fe15c1400e22ec9af52d14c5b62559caf9c.tar.gz
In if_ndis.c:ndis_attach(), temporarily set the IFF_UP flag while
calling the haltfunc. If an interrupt is triggered by the init or halt func, the IFF_UP flag must be set in order for us to be able to service it. In kern_ndis.c: implement a handler for NdisMSendResourcesAvailable() (currently does nothing since we don't really need it). In subr_ndis.c: - Correct ndis_init_string() and ndis_unicode_to_ansi(), which were both horribly broken. - Implement NdisImmediateReadPciSlotInformation() and NdisImmediateWritePciSlotInformation(). - Implement NdisBufferLength(). - Work around my first confirmed NDIS driver bug. The SMC 9462 gigE driver (natsemi 83820-based copper) incorrectly creates a spinlock in its DriverEntry() routine and then destroys it in its MiniportHalt() handler. This is wrong: spinlocks should be created in MiniportInit(). In a Windows environment, this is often not a problem because DriverEntry()/MiniportInit() are called once when the system boots and MiniportHalt() or the shutdown handler is called when the system halts. With this stuff in place, this driver now seems to work: ndis0: <SMC EZ Card 1000> port 0xe000-0xe0ff mem 0xda000000-0xda000fff irq 10 at device 9.0 on pci0 ndis0: assign PCI resources... ndis_open_file("FLASH9.hex", 18446744073709551615) ndis0: Ethernet address: 00:04:e2:0e:d3:f0
Diffstat (limited to 'sys/dev/if_ndis')
-rw-r--r--sys/dev/if_ndis/if_ndis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index e2f8c88..67a1a1b 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -222,7 +222,7 @@ ndis_attach(dev)
{
u_char eaddr[ETHER_ADDR_LEN];
struct ndis_softc *sc;
- struct ifnet *ifp;
+ struct ifnet *ifp = NULL;
int unit, error = 0, rid, len;
void *img;
struct ndis_type *t;
@@ -588,7 +588,9 @@ fail:
ndis_detach(dev);
/* We're done talking to the NIC for now; halt it. */
+ ifp->if_flags |= IFF_UP;
ndis_halt_nic(sc);
+ ifp->if_flags &= ~IFF_UP;
return(error);
}
OpenPOWER on IntegriCloud