Actually, if you're using add_drv to reload your driver, you probably
aren't following the right approach.

You need to specify -i when you use add_drv for most devices, because
that's the way the system associates the device nodes in the device tree
with your driver. (The exception here is for devices where the parent
nexus explicitly asks for the driver in question by creating the device
node with the same name as the device driver.)

If you're just reloading the driver to update to new binaries, you
should *not* re-run add_drv. Instead, you just need to replace the
binaries. If your driver is unloadable, you don't even need to touch the
filesystem during debug -- just modunload -i xxx to unload the old one,
then modload xxx to load the new one (which can be from some place like
the build directory, even over NFS!) and then devfsadm -i xxx to trigger
the devices to attach.

If you prefer to use add_drv, what you need to do is run rem_drv first,
and then use the -i argument each time to recreate the full path-to-inst
information.

-- Garrett

ZhouAaron wrote:
>
> It seems your driver attatch() routine has something wrong! you can
> check system log when running add_drv your driver.
>
> > From: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]; [email protected]
> > Date: Mon, 3 Nov 2008 16:41:06 +0800
> > Subject: Re: [driver-discuss] why does my driver not load after a
> reboot?
> >
> > Seems the driver alias information has been lost. The driver alias
> "my_label" is used to bind dirver to corresponding devices.
> > If you use `add_drv -i "my_label" mydriver` to add your driver,
> could you find something like `mydriver "mylabel"` in your
> /etc/driver_alias after reboot?
> >
> > Masopust, Christian <mailto:[EMAIL PROTECTED]> wrote:
> > > hello,
> > >
> > > already tried this, but behaviour is still the same,
> > > "add_drv -i ... mydriver" works but "add_drv mydriver" not.
> > >
> > > the message i get when running add_drv without "-i" is:
> > > Warning: Driver (mydriver) successfully added to system but failed to
> > > attach
> > >
> > > and debug-messages within /var/adm/messages show that only _info and
> > > _init have been called, no probe and no attach !!
> > >
> > > why ??
> > >
> > > thanks,
> > > christian
> > >
> > >
> > >
> > >> -----Original Message-----
> > >> From: Liu, Jiang [mailto:[EMAIL PROTECTED]
> > >> Sent: Monday, November 03, 2008 9:00 AM
> > >> To: Masopust, Christian; [email protected]
> > >> Subject: RE: why does my driver not load after a reboot?
> > >>
> > >> Hi Masopust,
> > >> The device driver will be loaded when you first access
> > >> the corresponding devices. You may force loading your driver
> > >> at boot time by adding "ddi-forceattach=1" to mydriver.conf file.
> > >>
> > >> Masopust, Christian <> wrote:
> > >>> hello,
> > >>>
> > >>> i've written a driver which runs now fine but i still have
> > >>> the problem that it won't load after a reboot. also after a
> > >>> reboot i cannot load it with simply running "add_drv mydriver",
> > >>> i always have to specify "-i ...." to load it.
> > >>>
> > >>> what did i wrong? any hints?
> > >>>
> > >>> thanks a lot,
> > >>> christian
> > _______________________________________________
> > driver-discuss mailing list
> > [email protected]
> > http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>
>
> ------------------------------------------------------------------------
> 使用新一代 Windows Live Messenger 轻松交流和共享! 立刻下载!
> <http://im.live.cn/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> driver-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/driver-discuss
>   

_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to