[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hw-detect and yenta_socket



On Sun, May 30, 2004 at 10:26 -0300, Joey Hess wrote:
> I'm unsure of the following code you recently added to he-detect:

It's not very nice, no.

> This is to load the bridge support so discover can scan for devices on the
> bridge?

Yes.

> Why only on 2.6?

Because the method used on 2.4 doesn't work on 2.6. For some reason,
there is a slight delay after loading yenta_socket until the cards can
be seen by discover. Conversely, the method used on 2.6 doesn't work
on 2.4 because we can't tell which network interfaces are provided by
Cardbus cards by looking in /sys.

If there was a way to easily look up a module in the discover data
given the PCI ID, this could be done in the same way on both kernel
versions. That would also remove the need for current "snapshot" hack,
and the yenta-loading code. Maybe I should consider adding this
functionality to discover.

> What is this magic number;

It is the PCI class number of Cardbus bridges.

> Isn't there a clean fix for this, such as running discover again after
> loading a brdige module?

Yes, that could be done. But we would still need a delay. Something
like:

run_discover
if ! expr $(uname -r) : "2.4.*" >/dev/null 2>&1 && \
   lsmod | grep -q ^yenta_socket; then
   sleep 3
   run_discover
fi

Assuming we had a function run_discover which ran discover and loaded
modules.

-- 
Pelle



Reply to: