How to get a device_t

Bernd Walter ticso at
Fri Aug 8 15:26:24 PDT 2003

On Fri, Aug 08, 2003 at 04:32:43PM -0400, John Baldwin wrote:
> On 08-Aug-2003 Bernd Walter wrote:
> > On Fri, Aug 08, 2003 at 03:48:22PM -0400, John Baldwin wrote:
> >> On 08-Aug-2003 Bernd Walter wrote:
> >> > However - I would still like to know why
> >> > device_add_child(nexus, "elanbb", -1);
> >> > results in an elanbb instance numer 1 connected to pci0.
> >> > And why I don't get any iicbb childs.
> >> 
> >> I would have to see your code changes in order to try to tell you that.
> > 
> >
> First off, the iicbb driver does not know have an elanbb attachment.
> You need a set of driver methods and corresponding
> DRIVER_MODULE(iicbb, elanbb, ...)

I really should have known, because I made the same mistake in one of
my first versions for ehci and hunted for the usb bus not coming up...

> For the iicbb child of elanbb to get a driver that probes it and attaches
> to it.


> Hmm, what you want to do is not hijack the legacy/pcib identify
> routine I think, but add an identify routine to your elanbb driver
> and have elanbb live off the nexus (so DRIVER_MODULE(elan, nexus))
> and have its identify routine use pci_cfgreg() to get the devid for
> device 0 and if it is the right one call init_AMD_Elan_sc520() and
> add it's probe routine.  Or rather.  I've fixed all this and you can

Agreed - it was just the quick and dirty - get it running way.
I also might want new files for a new driver as well...

> get the changes (whcih should fix bogus elanbb0 and make iicbb0 show
> up) at  It includes
> your patch above but fixes a few things.  One other bug I fixed is
> that since yout elan was hung off of pci and had an empty probe
> routine, any unclaimed PCI device got "claimed" by your elanbb driver,
> hence your bogus elanbb0.  Note that the version of elanbb in

OK - I still don't now the exact bug, but I got an idea.
The elanbb part was build with viapm as sample.

> elan.patch uses a private identify routine that calls
> init_AMD_Elan_sc250(), so it will work both with and without ACPI.

Thank you for the work.
Well elanbb is the wrong driver for calling init_AMD_Elan_sc250.
It is just one of many possible users of elan mmcr extensions.

> However, the warning printf about CPU_ELAN won't show up with ACPI.
> I left the printf in pci_bus.c for now.  A better place to put it would
> be in the hostb driver itself.  Well, I went ahead and did that too,
> so now the warning will show up both for ACPI and non-ACPI systems.


B.Walter                   BWCT      
ticso at                                  info at

More information about the freebsd-hackers mailing list