Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3643 - iwinfo returns bad data #8680

Open
openwrt-bot opened this issue Feb 26, 2021 · 8 comments
Open

FS#3643 - iwinfo returns bad data #8680

openwrt-bot opened this issue Feb 26, 2021 · 8 comments
Labels

Comments

@openwrt-bot
Copy link

Goerge255:

OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.054.03371-3b137b5
Device: Netgear R6120

Bad data returned by iwinfo for a wireless adapter connected via USB.

root@OpenWrt:~# iwinfo

wlan0 ESSID: "myssid0"
Access Point: BA:AD:F0:0D:BA:AD
Mode: Client Channel: 9 (2.452 GHz)
Tx-Power: 20 dBm Link Quality: 51/70
Signal: -59 dBm Noise: unknown
Bit Rate: 52.0 MBit/s
Encryption: WPA2 PSK (TKIP, CCMP)
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0

wlan1 ESSID: "myssid1"
Access Point: BA:AD:F0:0D:BA:DD
Mode: Client Channel: 44 (5.220 GHz)
Tx-Power: 20 dBm Link Quality: 43/70
Signal: -67 dBm Noise: unknown
Bit Rate: 54.0 MBit/s
Encryption: WPA2 PSK (TKIP, CCMP)
Type: nl80211 HW Mode(s): 802.11nac
Hardware: 14C3:7662 14C3:7662 [MediaTek MT76x2E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy1

wlan2 ESSID: "myssid2"
Access Point: BA:AA:AD:F0:00:0D
Mode: Client Channel: 9 (2.452 GHz)
Tx-Power: 20 dBm Link Quality: 56/70
Signal: -54 dBm Noise: unknown
Bit Rate: 150.0 MBit/s
Encryption: WPA2 PSK (TKIP, CCMP)
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy2

Notice that the same Hardware line is returned for wlan0 and wlan2 despite different MAC addresses and different PHY names.

The wlan2 hardware is the ALFA AWUS036NHA and `lsusb' identifies it as:

root@OpenWrt:~# lsusb -v | grep ID

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0cf3:9271 Qualcomm Atheros Communications AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

It is worth mentioning that the wlan2 interface is fully functional.

@openwrt-bot
Copy link
Author

Goerge255:

Also, the contents of the:
/etc/config/wireless file are:

root@OpenWrt:/etc/config# cat wireless

config wifi-device 'radio0'
option type 'mac80211'
option channel '9'
option hwmode '11g'
option path 'platform/10300000.wmac'
option htmode 'HT20'
option country 'US'

config wifi-device 'radio1'
option type 'mac80211'
option channel '44'
option hwmode '11a'
option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
option htmode 'VHT80'
option country 'US'

config wifi-iface 'wifinet0'
option ssid 'myssid0'
option device 'radio0'
option mode 'sta'
option key 'shh'
option encryption 'psk2'

config wifi-iface 'wifinet1'
option ssid 'myssid1'
option device 'radio1'
option mode 'sta'
option key 'shh'
option encryption 'psk2'

config wifi-device 'radio2'
option type 'mac80211'
option channel '1'
option hwmode '11g'
option path 'platform/101c0000.ehci/usb1/1-1/1-1:1.0'
option htmode 'HT20'
option country 'US'

config wifi-iface 'wifinet2'
option ssid 'myssid2'
option device 'radio2'
option mode 'sta'
option key 'shh'
option encryption 'psk2'

...and all of these radios operate in the Client Mode / STA ....not in the Master / Access Point mode.

@openwrt-bot
Copy link
Author

Goerge255:

Also, note that airmon-ng has no problems identifying the radio associated with the wlan2 interface:

root@OpenWrt:~# airmon-ng

PHY Interface Driver Chipset

phy0 wlan0 mt76_wmac Not pci, usb, or sdio
phy1 wlan1 mt76x2e MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter
phy2 wlan2 ath9k_htc Qualcomm Atheros Communications AR9271 802.11n

@openwrt-bot
Copy link
Author

jow-:

Please attach the output of strace iwinfo

@openwrt-bot
Copy link
Author

wulfy23:

seeing oddities also on master @ 2021-02-27ish ( running build date... no idea when introduced likely a week or two previous to this )

attach strace crashes flyspray

rpi4 note: the phantom 'wlan0' ...

[root@dca632 /usbstick 50°]# iwinfo wlan0 ESSID: unknown Access Point: DC:A6:32:56:31:78 Mode: Client Channel: 36 (5.180 GHz) Center Channel 1: 36 2: unknown Tx-Power: 0 dBm Link Quality: unknown/70 Signal: unknown Noise: -95 dBm Bit Rate: unknown Encryption: unknown Type: nl80211 HW Mode(s): 802.11bgnac Hardware: 02D0:A9A6 0000:0000 [Generic MAC80211] TX power offset: unknown Frequency offset: unknown Supports VAPs: no PHY name: phy1

wlan1 ESSID: "ap101"
Access Point: DC:A6:32:56:31:78
Mode: Master Channel: 36 (5.180 GHz)
Center Channel 1: 36 2: unknown
Tx-Power: 31 dBm Link Quality: unknown/70
Signal: unknown Noise: -95 dBm
Bit Rate: unknown
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11bgnac
Hardware: 02D0:A9A6 0000:0000 [Generic MAC80211]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: phy1

[root@dca632 /usbstick 51°]# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'mac80211'
#option channel '36'
option hwmode '11a'
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
#option disabled '0'
option disabled '0'
#option disabled '1'
option country 'AU'
option htmode 'VHT20'
#option cell_density '0'
#option noscan '1'

config wifi-iface 'default_radio0'
option device 'radio0'
#option network 'lan'
option network 'guest'
option mode 'ap'
option key 'somerandomhardtoguesspassword'
option ssid 'ap101'
option encryption 'psk2+ccmp'

@openwrt-bot
Copy link
Author

jow-:

I need the strace, as well as the ubus call network.wireless status output. iwinfo output and wireless uci configs are not helpful to isolate the problem.

@openwrt-bot
Copy link
Author

Goerge255:

root@OpenWrt:~# strace iwconfig

execve("/usr/sbin/iwconfig", ["iwconfig"], 0x7fe6cd60 /* 12 vars */) = 0
set_thread_area(0x77f34efc) = 0
set_tid_address(0x77f2c008) = 2546
open("/etc/ld-musl-mipsel-sf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=78079, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\320'\0\0004\0\0\0"..., 936) = 936
mmap2(NULL, 147456, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x77e5f000
mmap2(0x77e81000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12000) = 0x77e81000
close(3) = 0
mprotect(0x77e81000, 4096, PROT_READ) = 0
mprotect(0x418000, 4096, PROT_READ) = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
open("/proc/net/dev", O_RDONLY|O_LARGEFILE) = 4
read(4, "Inter-| Receive "..., 1024) = 1024
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = 0
ioctl(3, SIOCGIWNWID, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWFREQ, 0x7fdf359c) = -1 EINVAL (Invalid argument)
ioctl(3, SIOCGIWENCODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWESSID, 0x7fdf359c) = 0
ioctl(3, SIOCGIWMODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWRANGE, 0x7fdf3104) = 0
ioctl(3, SIOCGIWAP, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRATE, 0x7fdf3610) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWPOWER, 0x7fdf3610) = 0
ioctl(3, SIOCGIWSTATS, 0x7fdf34bc) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWTXPOW, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRTS, 0x7fdf3610) = 0
ioctl(3, SIOCGIWFRAG, 0x7fdf3610) = 0
ioctl(1, TIOCGWINSZ, 0x7fdf3128) = 0
writev(1, [{iov_base="wlan0 IEEE 802.11 ESSID:off"..., iov_len=38}, {iov_base="\n", iov_len=1}], 2wlan0 IEEE 802.11 ESSID:off/any
) = 39
writev(1, [{iov_base=" Mode:Managed Access P"..., iov_len=73}, {iov_base="\n", iov_len=1}], 2 Mode:Managed Access Point: Not-Associated Tx-Power=23 dBm
) = 74
writev(1, [{iov_base=" RTS thr:off Fragment"..., iov_len=40}, {iov_base="\n", iov_len=1}], 2 RTS thr:off Fragment thr:off
) = 41
writev(1, [{iov_base=" Encryption key:off", iov_len=28}, {iov_base="\n", iov_len=1}], 2 Encryption key:off
) = 29
writev(1, [{iov_base=" Power Management:off", iov_len=30}, {iov_base="\n", iov_len=1}], 2 Power Management:off
) = 31
writev(1, [{iov_base=" ", iov_len=10}, {iov_base="\n", iov_len=1}], 2
) = 11
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = 0
ioctl(3, SIOCGIWNWID, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWFREQ, 0x7fdf359c) = -1 EINVAL (Invalid argument)
ioctl(3, SIOCGIWENCODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWESSID, 0x7fdf359c) = 0
ioctl(3, SIOCGIWMODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWRANGE, 0x7fdf3104) = 0
ioctl(3, SIOCGIWAP, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRATE, 0x7fdf3610) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWPOWER, 0x7fdf3610) = 0
ioctl(3, SIOCGIWSTATS, 0x7fdf34bc) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWTXPOW, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRTS, 0x7fdf3610) = 0
ioctl(3, SIOCGIWFRAG, 0x7fdf3610) = 0
writev(1, [{iov_base="wlan1 IEEE 802.11 ESSID:off"..., iov_len=38}, {iov_base="\n", iov_len=1}], 2wlan1 IEEE 802.11 ESSID:off/any
) = 39
writev(1, [{iov_base=" Mode:Managed Access P"..., iov_len=72}, {iov_base="\n", iov_len=1}], 2 Mode:Managed Access Point: Not-Associated Tx-Power=3 dBm
) = 73
writev(1, [{iov_base=" RTS thr:off Fragment"..., iov_len=40}, {iov_base="\n", iov_len=1}], 2 RTS thr:off Fragment thr:off
) = 41
writev(1, [{iov_base=" Encryption key:off", iov_len=28}, {iov_base="\n", iov_len=1}], 2 Encryption key:off
) = 29
writev(1, [{iov_base=" Power Management:off", iov_len=30}, {iov_base="\n", iov_len=1}], 2 Power Management:off
) = 31
writev(1, [{iov_base=" ", iov_len=10}, {iov_base="\n", iov_len=1}], 2
) = 11
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIFFLAGS, {ifr_name="br-lan", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0
writev(2, [{iov_base="br-lan no wireless extensions"..., iov_len=35}, {iov_base=NULL, iov_len=0}], 2br-lan no wireless extensions.

) = 35
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIFFLAGS, {ifr_name="eth0", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0
writev(2, [{iov_base="eth0 no wireless extensions"..., iov_len=35}, {iov_base=NULL, iov_len=0}], 2eth0 no wireless extensions.

) = 35
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIFFLAGS, {ifr_name="lo", ifr_flags=IFF_UP|IFF_LOOPBACK|IFF_RUNNING}) = 0
writev(2, [{iov_base="lo no wireless extensions"..., iov_len=35}, {iov_base=NULL, iov_len=0}], 2lo no wireless extensions.

) = 35
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = 0
ioctl(3, SIOCGIWNWID, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWFREQ, 0x7fdf359c) = -1 EINVAL (Invalid argument)
ioctl(3, SIOCGIWENCODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWESSID, 0x7fdf359c) = 0
ioctl(3, SIOCGIWMODE, 0x7fdf359c) = 0
ioctl(3, SIOCGIWRANGE, 0x7fdf3104) = 0
ioctl(3, SIOCGIWAP, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRATE, 0x7fdf3610) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWPOWER, 0x7fdf3610) = 0
ioctl(3, SIOCGIWSTATS, 0x7fdf34bc) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIWTXPOW, 0x7fdf3610) = 0
ioctl(3, SIOCGIWRTS, 0x7fdf3610) = 0
ioctl(3, SIOCGIWFRAG, 0x7fdf3610) = 0
writev(1, [{iov_base="wlan2 IEEE 802.11 ESSID:off"..., iov_len=38}, {iov_base="\n", iov_len=1}], 2wlan2 IEEE 802.11 ESSID:off/any
) = 39
writev(1, [{iov_base=" Mode:Managed Access P"..., iov_len=73}, {iov_base="\n", iov_len=1}], 2 Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
) = 74
writev(1, [{iov_base=" RTS thr:off Fragment"..., iov_len=40}, {iov_base="\n", iov_len=1}], 2 RTS thr:off Fragment thr:off
) = 41
writev(1, [{iov_base=" Encryption key:off", iov_len=28}, {iov_base="\n", iov_len=1}], 2 Encryption key:off
) = 29
writev(1, [{iov_base=" Power Management:off", iov_len=30}, {iov_base="\n", iov_len=1}], 2 Power Management:off
) = 31
writev(1, [{iov_base=" ", iov_len=10}, {iov_base="\n", iov_len=1}], 2
) = 11
read(4, "0 0 0 0 0 "..., 1024) = 37
ioctl(3, SIOCGIWNAME, 0x7fdf359c) = -1 EOPNOTSUPP (Not supported)
ioctl(3, SIOCGIFFLAGS, {ifr_name="eth0.1", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0
writev(2, [{iov_base="eth0.1 no wireless extensions"..., iov_len=35}, {iov_base=NULL, iov_len=0}], 2eth0.1 no wireless extensions.

) = 35
read(4, "", 1024) = 0
close(4) = 0
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++

root@OpenWrt:~# iwinfo

wlan0 ESSID: unknown
Access Point: 08:02:8E:E2:7C:77
Mode: Client Channel: unknown (unknown)
Tx-Power: 23 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0

wlan1 ESSID: unknown
Access Point: 08:02:8E:E2:7C:79
Mode: Client Channel: unknown (unknown)
Tx-Power: 3 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11nac
Hardware: 14C3:7662 14C3:7662 [MediaTek MT76x2E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy1

wlan2 ESSID: unknown
Access Point: 00:C0:CA:98:6B:65
Mode: Client Channel: unknown (unknown)
Tx-Power: 20 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy2

root@OpenWrt:~#

@openwrt-bot
Copy link
Author

Goerge255:

root@OpenWrt:~# ubus call network.wireless status

{
"radio0": {
"up": true,
"pending": false,
"autostart": true,
"disabled": false,
"retry_setup_failed": false,
"config": {
"channel": "11",
"hwmode": "11g",
"path": "platform/101c0000.ehci/usb1/1-1/1-1:1.0",
"htmode": "HT20"
},
"interfaces": [
{
"section": "wifinet4",
"ifname": "wlan2",
"config": {
"ssid": "OpenWrt",
"encryption": "none",
"mode": "sta",
"mode": "sta",
"network": [
"wwan0"
]
}
}
]
},
"radio1": {
"up": false,
"pending": false,
"autostart": true,
"disabled": true,
"retry_setup_failed": false,
"config": {
"channel": "11",
"hwmode": "11g",
"path": "platform/10300000.wmac",
"htmode": "HT20",
"disabled": true
},
"interfaces": [
{
"section": "default_radio1",
"config": {
"ssid": "OpenWrt",
"encryption": "none",
"mode": "sta",
"network": [
"lan"
],
"mode": "sta"
}
}
]
},
"radio2": {
"up": false,
"pending": false,
"autostart": true,
"disabled": true,
"retry_setup_failed": false,
"config": {
"channel": "36",
"hwmode": "11a",
"path": "pci0000:00/0000:00:00.0/0000:01:00.0",
"htmode": "VHT80",
"disabled": true
},
"interfaces": [
{
"section": "default_radio2",
"config": {
"ssid": "OpenWrt",
"encryption": "none",
"mode": "sta",
"network": [
"lan"
],
"mode": "sta"
}
}
]
}
}

I can see that the device "path" for the radio0 is for an USB-attached device and the "path" for the radio2 is for a PCI-attached device ...but they should be the opposite.

@openwrt-bot
Copy link
Author

Goerge255:

So this apparently is a bug. Is anyone going to help correct it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant