From owner-freebsd-hackers Wed Mar 21 5:26:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from amsmta04-svc.chello.nl (mail-out.chello.nl [213.46.240.7]) by hub.freebsd.org (Postfix) with ESMTP id C332F37B71E for ; Wed, 21 Mar 2001 05:26:44 -0800 (PST) (envelope-from wvengen@stack.nl) Received: from stack.nl ([213.46.110.240]) by amsmta04-svc.chello.nl (InterMail vK.4.03.02.00 201-232-124 license 9a0f3c09abb1b740b3b0b1917e20d81c) with ESMTP id <20010321131940.BEDG11230.amsmta04-svc@stack.nl>; Wed, 21 Mar 2001 14:19:40 +0100 Message-ID: <3AB8A9A0.3A35227E@stack.nl> Date: Wed, 21 Mar 2001 14:16:16 +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: Takanori Watanabe , freebsd-hackers@freebsd.org Subject: Re: driver: probe not called when smbus child References: <200103210448.NAA57784@shidahara1.planet.sci.kobe-u.ac.jp> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Takanori Watanabe wrote: > > In message <3AB77C31.8213C158@stack.nl>, Willem van Engen さんいわく: > >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); > > } > > } > > 'smbus' code do not have 'bus_add_child' method.So the BUS_ADD_CHILD > call do not take effect. > Call device_add_child(parent,"my",-1); or define bus_add_child method. I'm now using the above device_add_child and it works. It gets attached to smbus0 and the smbus_attach,detach,readw and writew commands work (probabely others too, but I only use these). Thanks! > > And you will need to know grandparent device name to bind the device > collectly.(Or should we need a way to get device attribute such as > Mother board, Video Capture BitBang,Video Capture Cooked,VGA Card and etc.) I don't quite understand this; I guess I don't know enough about newbus or so. > > Takanori Watanabe > > Public Key > Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A - Willem To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message