Date: Mon, 23 May 2011 16:13:41 +0200 From: Philip Soeberg <philip-freebsd1@soeberg.net> To: freebsd-hackers@freebsd.org Subject: device_detach() on a device used by ixgbe driver (FreeBSD 7-STABLE through to 9-CURRENT) Message-ID: <4DDA6B95.3090704@soeberg.net>
next in thread | raw e-mail | index | archive | help
Hi fellow FreeBSD hackers, I've just completed designing a new driver for the Intels IXGBE suite of network adapters, but is building my driver as a kernel module to be loaded after system boot. The current sys/dev/ixgbe/ixgbe.c driver which attach to Intels adapters return a zero in it's probe() function (which equals to BUS_PROBE_SPECIFIC).. This has the distinct disadvantage that I cannot, through my module, call a device_detach() on the devices I support, and afterward expect being probed for them. A BUS_PROBE_SPECIFIC, according to wording in sys/sys/bus.h, inform the OS that "Only I can use this device". I assume this (transcanding from FreeBSD 7.0-STABLE through to FreeBSD 9-CURRENT) is in error? I would expect sys/dev/ixgbe/ixgbe.c's probe() function to return BUS_PROBE_DEFAULT, which is the "Base OS default driver".. If this is true, then we should probably also update sys/kern/device_if.m's description of the probe() method as to reflect the BUS_PROBE_* return values in a clearer way than is currently described. Do you want me to provide a patch? (it's really a one liner for ixgbe.c and a couple of alterations to the device_if.m, if need be) I would also expect the ixgbe.c driver to do a quick resource_disabled() in it's attach() function, so that we can disable specific adapters through kenv hint.ix.0.disabled=1.. Given that I can't use device_detach() on a device hogged by the IXGBE driver, can any one of you help me with a way around this problem? I can't use the hints, and I can't detach() the device.. how can I get my kernel module to attach the device? Thanks, Phil
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DDA6B95.3090704>