summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xlreg.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-08-18 19:24:30 +0000
committerjhb <jhb@FreeBSD.org>2005-08-18 19:24:30 +0000
commit3e470d1fddb1f66d5b35aa8b9bd75ec462af481d (patch)
tree74cb215e56a06c8e5d3d309235af7f7e6845af6f /sys/pci/if_xlreg.h
parentffa1fe108a2209f7e4701eb9e2816e9401da3213 (diff)
downloadFreeBSD-src-3e470d1fddb1f66d5b35aa8b9bd75ec462af481d.zip
FreeBSD-src-3e470d1fddb1f66d5b35aa8b9bd75ec462af481d.tar.gz
Various fixups to locking:
- Remove a lot of superfluous locking during attach. There is no need to lock access to the driver until some other thread has a way of getting to it. For ethernet drivers the other ways include registering an interrupt handler via bus_setup_intr(), calling ether_ifattach() to hook into the network stack, and kicking off a callout-driven timer via callout_reset(). - Use callout_* rather than timeout/untimeout. - Break out of xl_rxeof() if IFF_DRV_RUNNING is clear after ifp->if_input returns to handle the case where the interface was stopped while we were passing a packet up the stack. Don't call xl_rxeof() in xl_rxeof_task() unless IFF_DRV_RUNNING is set. With these fixes in place, any outstanding task will gracefully terminate as soon as it gets a chance to run after the interface has been stopped via xl_stop(). As a result, taskqueue_drain() is no longer required in xl_stop(). The task is still drained in detach() however to make sure that detach() can safely destroy the driver mutex at the end of the function. - Lock the driver lock in the ifmedia callouts and don't lock across ifmedia_ioctl() in xl_ioctl(). Note: glebius came up with most of (3) as well independently. I took a rather roundabout way of arriving at the same conclusion. MFC after: 3 days
Diffstat (limited to 'sys/pci/if_xlreg.h')
-rw-r--r--sys/pci/if_xlreg.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h
index d1d2e8f..f999b71 100644
--- a/sys/pci/if_xlreg.h
+++ b/sys/pci/if_xlreg.h
@@ -601,7 +601,7 @@ struct xl_softc {
int xl_if_flags;
struct xl_list_data xl_ldata;
struct xl_chain_data xl_cdata;
- struct callout_handle xl_stat_ch;
+ struct callout xl_stat_callout;
int xl_flags;
struct resource *xl_fres;
bus_space_handle_t xl_fhandle;
OpenPOWER on IntegriCloud