From 64666ed6e74a96a40433b5ca0ac21b0f08e14acb Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Tue, 7 Jan 2003 04:26:45 +0000 Subject: Don't call fw_bus_probe() twice when successive self-id packets received. This change should stabilize SBP-II device probing. --- sys/dev/firewire/firewire.c | 10 +++++++++- sys/dev/firewire/firewirereg.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/dev/firewire') diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index 612997cd925c..e6023cb24516 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -522,6 +522,13 @@ firewire_attach( device_t dev ) #endif sc->fc->timeouthandle = timeout((timeout_t *)sc->fc->timeout, (void *)sc->fc, hz * 10); + callout_init(&sc->fc->busprobe_callout +#if __FreeBSD_version >= 500000 + , /* mpsafe? */ 0); +#else + ); +#endif + /* Locate our children */ bus_generic_probe(dev); @@ -1215,7 +1222,8 @@ void fw_sidrcv(struct firewire_comm* fc, caddr_t buf, u_int len, u_int off) } #endif #if 1 - timeout((timeout_t *)fw_bus_probe, (void *)fc, hz/4); + callout_reset(&fc->busprobe_callout, hz/4, + (void *)fw_bus_probe, (void *)fc); #else fw_bus_probe(fc); #endif diff --git a/sys/dev/firewire/firewirereg.h b/sys/dev/firewire/firewirereg.h index 9549a299c22f..bfa7256cbb7b 100644 --- a/sys/dev/firewire/firewirereg.h +++ b/sys/dev/firewire/firewirereg.h @@ -225,7 +225,7 @@ struct firewire_comm{ u_int32_t *config_rom; struct fw_topology_map *topology_map; struct fw_speed_map *speed_map; - struct callout_handle tlhandle; + struct callout busprobe_callout; struct callout_handle bmrhandle; struct callout_handle timeouthandle; struct callout_handle retry_probe_handle; -- cgit v1.2.3