NetBSD-Users archive

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

overly-chatty wpi driver

If wpi0 is disabled by the hardware switch on my laptop (Thinkpad T42),
the driver grumbles 'Radio is disabled by hardware switch'.  This
happens repeatedly, since wpi_supplicant is trying to listen on the
interface.  I think that that's wrong on several levels.

First -- the driver shouldn't print such a message on the console;
rather, it should pass an error back to the higher layer that called
it.  The message is coming from wpi_init(); it isn't clear to me if
that is ever called from interrupt level, or only in response to a
direct application request.

Second -- what should the return code be?  Right now, it passes back
EBUSY, which doesn't seem right per errno(2).  Looking at that man
page, there are a few that (to my eye) are a bit more appropriate, but
they're still stretching the actual meaning of the error code.  EAGAIN,

Third -- wpa_supplicant (and probably dhclient and dhcpcd) should
recognize that error code, print a message once, and then back off.  But
that would work a lot better if there were some call-back to user level
indicating that the switch had been reenabled.  Is there a driver
interrupt when that happens?  I have the impression that the attempt to
enable the device is comparatively expensive, and the failure condition
is likely to persist for a matter of many minutes, not seconds or
milliseconds.  (I have my radio disabled right now because I'm on an
airplane.  I won't reenable it until I get to my hotel tonight.)

Fourth -- what other drivers are affected?  I see the same text in
iwi0.  Are there others?

                --Steve Bellovin,

Home | Main Index | Thread Index | Old Index