"Kenneth D. Merry" wrote:
> On Mon, Aug 19, 2002 at 13:52:33 -0700, Terry Lambert wrote:
> > "Kenneth D. Merry" wrote:
> > > I don't think that's the problem.  I think the problem is that the device
> > > at target 8 is getting identified to camperiphnextunit() as a wired devic
    e,
> > > when it isn't.
> > > 
> > > Try the attached patch and see if it fixes things for you.
> > > 
> > > I haven't tried compiling or running this, so beware.
> > 
> > 
> > That's some sneaky code.  8-).  If this works and you commit it,
> > can you add an expository comment?
> 
> Maybe.  Peter Wemm wrote the hardwiring code, and would likely be in a
> slightly better position to explain it.

Actually, Justin implemented the original design, I just changed the
underlying mechanism that it uses.  It still uses Justin's algorithms but
looks in different places for the source data.  I sort-of understand it,
but it has been a while since I looked at it. :-)

Regarding the patch, yes, it does look like the 'hit = 0' should go inside
the loop.  I would have done it more explicitly though, eg:

+++ cam_periph.c        2002/08/20 06:48:50
@@ -332,3 +332,2 @@
        unit = 0;
-       hit = 0;
 
@@ -338,2 +337,3 @@
        while ((i = resource_locate(i, periph_name)) != -1) {
+               hit = 0;
                dname = resource_query_name(i);

The same problem is on -current too.  It is probably worth changing "hit"
to "wired" since that is what it means.

I think this bug came from an earlier verson of the changes where this was
a multi-layered loop, and the resetting of 'hit' got moved too far out when
it collapsed to a single loop.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to