Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jun 2003 14:32:01 -0600
From:      Scott Long <scottl@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:    Re: cvs commit: src/sys/dev/ips ips.c ips.h ips_commands.c ips_pci.c
Message-ID:  <3EFB5841.8000500@freebsd.org>
In-Reply-To: <XFMail.20030626114023.jhb@FreeBSD.org>
References:  <XFMail.20030626114023.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote:
> On 26-Jun-2003 Scott Long wrote:
> 
>>scottl      2003/06/25 17:03:59 PDT
>>
>>  FreeBSD src repository
>>
>>  Modified files:
>>    sys/dev/ips          ips.c ips.h ips_commands.c ips_pci.c 
>>  Log:
>>  - Zero the buffers used to hold configuration data from the card.  Not doing
>>    so can leave stale data in the buffer and confuse the driver.
>>  - enable the ability to set the 'disable' hint for the driver to keep it
>>    from attaching.  i.e. 'hw.ips.0.disable=1' will prevent the driver from
>>    attaching.
> 
> 
> Should be "hint.ips.0.disabled".

Mea Culpa

> Perhaps we need to add a resource_disabled()
> function to abstract this so people stop getting it wrong.  Something like:
>

This sounds like an excellent idea.  Should it be part of newbus?  I'm
pretty ambivolent about the syntax that is used; doing it in one common
place ensures that all the drivers will have in the same way, which is
the most important attribute.

Scott


> int
> resource_disabled(const char *name, int unit)
> {
>         int error, value;
> 
>         value = resource_int_value(name, unit, "disabled", &error);
>         if (error == 0)
>                 return (value);
>         return (0);
> }
> 
> You could then expand this function to check 'disable' as well if
> desired and allow for 'true' and 'false', 'on' and 'off' in addition
> to '0' and '1'.
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EFB5841.8000500>