From owner-freebsd-hackers Tue Mar 20 14:19:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from amsmta02-svc.chello.nl (mail-out.chello.nl [213.46.240.7]) by hub.freebsd.org (Postfix) with ESMTP id BA2DD37B78D for ; Tue, 20 Mar 2001 14:19:29 -0800 (PST) (envelope-from wvengen@stack.nl) Received: from stack.nl ([213.46.110.240]) by amsmta02-svc.chello.nl (InterMail vK.4.03.02.00 201-232-124 license 123510a18e2ad992799e3cab97e0f17c) with ESMTP id <20010320220554.KLN21800.amsmta02-svc@stack.nl> for ; Tue, 20 Mar 2001 23:05:54 +0100 Message-ID: <3AB7D52A.3EBDD198@stack.nl> Date: Tue, 20 Mar 2001 23:09:46 +0100 From: Willem van Engen X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: driver: probe not called when smbus child References: <3AB77C31.8213C158@stack.nl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG It's currently working as an isa-child, but I'm still wondering if it's the 'clean' way, since I only use smbus commands. - Willem Willem van Engen wrote: > > I'm trying to write a module which should be a child of the smbus. > When I make the driver a child of the isa bus, identify, probe, > and attach functions are properly called. I use the following > code to do that: > DRIVER_MODULE(my, isa, my_driver, my_devclass, 0, 0); > But when I put it on the smbus using > DRIVER_MODULE(my, smbus, my_driver, my_devclass, 0, 0); > only identify is called. The identify function is as follows: > > static void > my_identify(driver_t *driver, device_t parent) > { > devclass_t dc; > device_t child; > > printf("my: my_identify called\n"); > dc = devclass_find("my"); > if (devclass_get_device(dc, 0)==NULL) { > child = BUS_ADD_CHILD(parent, 0, "my", -1); > } > } > > The driver only uses smbus calls, so I think the best parent > would be smbus. > And when I do a smbus_request_bus, the call waits forever as > it seems. That seems sensible to me, because it asks the > parent for the bus and the isa bus can't grant requests for > the smbus. So I think the driver has to be a child of the smbus. > > Looking in the kernel sources, I see that the only smbus child > I can find, smb, (if there are others, I'm certainly interested) > is attached in the smbus code itself. So the next question rises: > Is it possible to have an smbus child in a dynamically loadable > module (I can't find smbus.ko in /modules, so loading the child > first and then smbus isn't an option I guess) ? > > - Willem van Engen > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message