Subject: Re: Cardbus
To: Hayakawa Koichi <>
From: Lennart Augustsson <>
List: tech-kern
Date: 12/21/1999 02:24:14
Hayakawa Koichi wrote:

>  Hi,
>  From: Lennart Augustsson <>
>  Subject: Cardbus
>  Date: Tue, 21 Dec 1999 01:50:54 +0100
>  Message-ID: <>
>   >  * make the code KNF (this is easy, I can do that).
>  Please do that.
>  # I feel 8 columns for each indentation is too big.
>I do too, but this is the coding standard for the kernel. :)
>   >  * make card eject work.  Maybe it works for others, but not on my
>   >    Vaio 505TX and I'm soon desperate for hot swapping cards.
>  Now, network card can be detached?

No, but last I tried there seemed to be problems with other cards too.
I ejected my USB controller card, but there were no messages or
calls to the detach code for the OHCI controller.
But I've not tried it in the last month or so.

Speaking of detaching network card.  Is anyone working on this?
I guess I can borrow the code from OpenBSD to do it, because
I want to be able to switch network cards.

>   >  * remove calls to delay().  There should NO calls to delay for
>   >    periods longer than a few microseconds, perhaps 100 if you're
>   >    desperate.  Busy wait is evil.  (I think the PCMCIA code still
>   >    calls delay() for long periods from the interrupt routine!)
>  I have a test code no to use delay() in thread context.  But
>  at the boottime (before kernel thread wake up), delay()
>  should be used.  This test code is based on NetBSD-1.4L.

Indeed, you need to be careful with that.  For the USB code I keep a
flag with the controller to tell what to do.
An easier solution is probably to have a special delay routine that
tests the `cold' flag to see if it should tsleep() or delay().
This cannot be called from the interrupt routine, of course.  But that
should never be necessary, there is timeout() for that purpose.


        -- Lennart