3

I've some problems with the wlan0 interface on an embedded linux distro (compiled with yocto). The problem is that when I use the command:

iwconfig

the wlan0 results with no wireless extensions. But if I write the command:

iw wlan0 scan

it works correctly! And it also works well if I use connman as connection manager instead of iwconfig. I've tried to get up the interfaces with the follow commands:

ip link set wlan0 up

or

ifconfig wlan0 up

but when I checked the status of the file in /sys/class/net/wlan0/operstate the result is always "down". How can I solve this problem?

i want that iwconfig recognize the wlan0 interface.

3

It sounds like either your kernel or the driver for the wireless interface will only support the newer cfg80211 configuration interface used by the iw tool, not the older wireless-extensions interface used by iwconfig.

Does your kernel configuration enable the CONFIG_WIRELESS_EXT option, and/or the CONFIG_CFG80211_WEXT option? The latter option will enable a compatibility layer that will allow old userspace programs like iwconfig to access the configuration of newer-style drivers.

Note that when you use ip link set wlan0 up or ifconfig wlan0 up you'll be setting the administrative state of the interface, or basically the state the interface will want to be in. The /sys/class/net/wlan0/operstate tells you about the operational state of the interface, i.e. what state the interface has actually managed to achieve.

For a wired interface, the operational state changes to up basically reflects the state of the link LED of the interface: when the interface detects the link pulses from the other end (and successfully negotiates the connection speed and other parameters, if applicable), the link LED will light, and the operational state will change to up.

A wireless interface has no cable to plug in, so the equivalent task is associating with a wireless network (and completing any necessary authentication, if applicable). So you should first configure the wireless interface with a network with an ESSID and any necessary network passwords or authentication keys. If the wireless interface is out of range of the wireless AP or the authentication settings are not correct, the wireless interface won't be able to actually transfer packets - and that's what the operational state "down" means.

1
  • thank you!! i'm trying to develop a librarie, that use netlink socket instead of ioctl, thanks to your answer!
    – Sguit
    Jul 31 '19 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.