2007-07-07 16:27:12

by [email protected]

[permalink] [raw]
Subject: Errors when firmware is missing

I have a new Broadcom 4318 adapter (which has exactly the same issues
with promiscuous mode). I didn't have the right firmware down for it
and I received this error message when I did "ifconfig wlan up"
SIOCSIFFLAGS: No such file or directory. This is not the most user
friendly error message, but I did receive a log entry.

I tried the same thing with the zd1211. In this case the wlan0 device
didn't get created.

Does it make sense to specify consistent behavior when the firmware is missing?

--
Jon Smirl
[email protected]


2007-07-07 21:28:26

by Dan Williams

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Sat, 2007-07-07 at 20:37 +0200, Michael Buesch wrote:
> On Saturday 07 July 2007 20:08:50 Larry Finger wrote:
> > Jon Smirl wrote:
> > > I have a new Broadcom 4318 adapter (which has exactly the same issues
> > > with promiscuous mode). I didn't have the right firmware down for it
> > > and I received this error message when I did "ifconfig wlan up"
> > > SIOCSIFFLAGS: No such file or directory. This is not the most user
> > > friendly error message, but I did receive a log entry.
> >
> > If the firmware did not load correctly, the bcm43xx driver logs appropriate messages. This error
> > would have been encountered and logged when the interface was brought up. Is that what you meant
> > when you say that you received a log entry? The ifconfig error message is output by the user code,
> > and is not controlled by any driver.
>
> Well it is. It's -ENOENT, which we return in the driver.
> I'd like to return, -ENOFIRMWARE, but there's no such error.
> So I selected the most sane error code (to me), which says
> file not found...

This should be what all drivers do; if, when setting IFF_UP, the device
can't find firmware, it should return -ENOENT, which is the return code
from request_firmware() when it fails to find the firmware. Thus,
userspace can detect that firmware is missing and attempt to
intelligently inform the user.

Dan



2007-07-07 21:30:13

by Dan Williams

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Sat, 2007-07-07 at 18:41 +0200, Johannes Berg wrote:
> On Sat, 2007-07-07 at 12:27 -0400, Jon Smirl wrote:
> > I have a new Broadcom 4318 adapter (which has exactly the same issues
> > with promiscuous mode).
>
> Huh? That's really weird.
>
> > I didn't have the right firmware down for it
> > and I received this error message when I did "ifconfig wlan up"
> > SIOCSIFFLAGS: No such file or directory. This is not the most user
> > friendly error message, but I did receive a log entry.
> >
> > I tried the same thing with the zd1211. In this case the wlan0 device
> > didn't get created.
> >
> > Does it make sense to specify consistent behavior when the firmware is missing?
>
> It does, and I believe we've talked about it at the wireless summits,
> but I'm not aware that we've reached a conclusion. It would probably be
> nice to have an error message -EFIRMWARE or something; that for zd1211
> no device is created is probably counter-productive, that way userspace
> will never know that a wireless adapter is plugged in.

Drivers should be returning -ENOENT (the error from request_firmware()
when the firmware isn't found) when userspace sets IFF_UP on the device,
so that userspace has the faintest hope of intelligently informing the
user.

Dan



2007-07-07 18:08:52

by Larry Finger

[permalink] [raw]
Subject: Re: Errors when firmware is missing

Jon Smirl wrote:
> I have a new Broadcom 4318 adapter (which has exactly the same issues
> with promiscuous mode). I didn't have the right firmware down for it
> and I received this error message when I did "ifconfig wlan up"
> SIOCSIFFLAGS: No such file or directory. This is not the most user
> friendly error message, but I did receive a log entry.

If the firmware did not load correctly, the bcm43xx driver logs appropriate messages. This error
would have been encountered and logged when the interface was brought up. Is that what you meant
when you say that you received a log entry? The ifconfig error message is output by the user code,
and is not controlled by any driver.

For me, the BCM4318 works in promiscuous mode. I regularly use both the 4318 and a 4311 with Kismet
for testing. What kernel version were you using? If older than 2.6.21, was it patched?

Larry


2007-07-07 18:38:42

by Michael Büsch

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Saturday 07 July 2007 20:08:50 Larry Finger wrote:
> Jon Smirl wrote:
> > I have a new Broadcom 4318 adapter (which has exactly the same issues
> > with promiscuous mode). I didn't have the right firmware down for it
> > and I received this error message when I did "ifconfig wlan up"
> > SIOCSIFFLAGS: No such file or directory. This is not the most user
> > friendly error message, but I did receive a log entry.
>
> If the firmware did not load correctly, the bcm43xx driver logs appropriate messages. This error
> would have been encountered and logged when the interface was brought up. Is that what you meant
> when you say that you received a log entry? The ifconfig error message is output by the user code,
> and is not controlled by any driver.

Well it is. It's -ENOENT, which we return in the driver.
I'd like to return, -ENOFIRMWARE, but there's no such error.
So I selected the most sane error code (to me), which says
file not found...


--
Greetings Michael.

2007-07-11 09:40:57

by Johannes Berg

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Sat, 2007-07-07 at 13:24 -0400, Daniel Drake wrote:

> It implies that you have a way of reading the MAC address before
> uploading firmware. I only figured this out for zd1211 by reverse
> engineering the boot code to an extent.

Hm. Good point. I sure hope no such devices ever show up ;) Or you just
create a device with a fixed (but random locally assigned) MAC address.
Or even better we globally define a locally assigned address for "no
idea yet" :)

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-07-07 17:25:54

by Daniel Drake

[permalink] [raw]
Subject: Re: Errors when firmware is missing

Johannes Berg wrote:
> that for zd1211
> no device is created is probably counter-productive, that way userspace
> will never know that a wireless adapter is plugged in.

This is fixed for zd1211rw in my latest bunch of patches. But it
certainly wouldn't surprise me if future hardware/drivers are not able
to create an interface before loading firmware.

It implies that you have a way of reading the MAC address before
uploading firmware. I only figured this out for zd1211 by reverse
engineering the boot code to an extent.

Daniel

2007-07-07 16:40:17

by Johannes Berg

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Sat, 2007-07-07 at 12:27 -0400, Jon Smirl wrote:
> I have a new Broadcom 4318 adapter (which has exactly the same issues
> with promiscuous mode).

Huh? That's really weird.

> I didn't have the right firmware down for it
> and I received this error message when I did "ifconfig wlan up"
> SIOCSIFFLAGS: No such file or directory. This is not the most user
> friendly error message, but I did receive a log entry.
>
> I tried the same thing with the zd1211. In this case the wlan0 device
> didn't get created.
>
> Does it make sense to specify consistent behavior when the firmware is missing?

It does, and I believe we've talked about it at the wireless summits,
but I'm not aware that we've reached a conclusion. It would probably be
nice to have an error message -EFIRMWARE or something; that for zd1211
no device is created is probably counter-productive, that way userspace
will never know that a wireless adapter is plugged in.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-07-11 09:40:42

by Johannes Berg

[permalink] [raw]
Subject: Re: Errors when firmware is missing

On Sat, 2007-07-07 at 17:34 -0400, Dan Williams wrote:

> Drivers should be returning -ENOENT (the error from request_firmware()
> when the firmware isn't found) when userspace sets IFF_UP on the device,
> so that userspace has the faintest hope of intelligently informing the
> user.

Makes sense to me. Since it knows which driver is used it could even
tell the user where to get firmware :P

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part