linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iw ignores channel switch
@ 2015-12-03 11:01 Reiner Karlsberg
  2015-12-03 12:45 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Reiner Karlsberg @ 2015-12-03 11:01 UTC (permalink / raw)
  To: linux-wireless

I am using openwrt on the following system:
root@OpenWrt:/tmp# iw --version
iw version 3.17
ieee80211 phy0: Atheros AR9340 Rev:2 mem=0xb8100000, irq=47

I want to switch between managed (station) mode and monitor mode.

So I have the follwoing scenarion:

root@OpenWrt:/tmp# iw dev
phy#1
         Interface wlan1
                 ifindex 5
                 wdev 0x100000001
                 addr 00:90:a9:ab:f8:ed
                 type managed
phy#0
         Interface wlan0
                 ifindex 21                         #steadily increasing, not re-used ?
                 wdev 0x10
                 addr 00:90:a9:ab:f8:eb
                 type managed
root@OpenWrt:/tmp# ifconfig wlan0 up
root@OpenWrt:/tmp# iw dev wlan0 connect SSID
root@OpenWrt:/tmp# udhcpc -i wlan0 --quit
udhcpc (v1.23.2) started
Sending discover...
Sending select for 192.168.20.144...
Lease of 192.168.20.144 obtained, lease time 28800
udhcpc: ifconfig wlan0 192.168.20.144 netmask 255.255.255.0 broadcast 192.168.20.255
udhcpc: setting default routers: 192.168.20.1
root@OpenWrt:/tmp# wget http://somewhere.com/something.html
Connecting to somewhere.com (xx.xx.xx.xx:80)
wget: server returned error: HTTP/1.1 500 Internal Server Error
root@OpenWrt:/tmp# iw phy phy0 interface add wmon0 type monitor
root@OpenWrt:/tmp# iw dev
phy#1
         Interface wlan1
                 ifindex 5
                 wdev 0x100000001
                 addr 00:90:a9:ab:f8:ed
                 type managed
phy#0
         Interface wmon0
                 ifindex 22
                 wdev 0x11
                 addr 00:90:a9:ab:f8:eb
                 type monitor
         Interface wlan0
                 ifindex 21
                 wdev 0x10
                 addr 00:90:a9:ab:f8:eb
                 ssid SSID
                 type managed
                 channel 7 (2442 MHz), width: 40 MHz, center1: 2452 MHz
root@OpenWrt:/tmp# ifconfig wmon0 up
root@OpenWrt:/tmp# iw dev
phy#1
         Interface wlan1
                 ifindex 5
                 wdev 0x100000001
                 addr 00:90:a9:ab:f8:ed
                 type managed
phy#0
         Interface wmon0
                 ifindex 22
                 wdev 0x11
                 addr 00:90:a9:ab:f8:eb
                 type monitor
         Interface wlan0
                 ifindex 21
                 wdev 0x10
                 addr 00:90:a9:ab:f8:eb
                 ssid SSID
                 type managed
                 channel 7 (2442 MHz), width: 40 MHz, center1: 2452 MHz
root@OpenWrt:/tmp# iw dev wlan0 del
root@OpenWrt:/tmp# iw dev
phy#1
         Interface wlan1
                 ifindex 5
                 wdev 0x100000001
                 addr 00:90:a9:ab:f8:ed
                 type managed
phy#0
         Interface wmon0
                 ifindex 22
                 wdev 0x11
                 addr 00:90:a9:ab:f8:eb
                 type monitor
                 channel 7 (2442 MHz), width: 20 MHz (no HT), center1: 2442 MHz
root@OpenWrt:/tmp# iw dev wmon0 set channel 1
root@OpenWrt:/tmp# iw dev
phy#1
         Interface wlan1
                 ifindex 5
                 wdev 0x100000001
                 addr 00:90:a9:ab:f8:ed
                 type managed
phy#0
         Interface wmon0
                 ifindex 22
                 wdev 0x11
                 addr 00:90:a9:ab:f8:eb
                 type monitor
                 channel 7 (2442 MHz), width: 20 MHz (no HT), center1: 2442 MHz

As to be seen, the modification of the channel does not generate an error, but is simply ignored.
What did I do wrong ?


Second question: The "ifindex" is always increasing, during several tests,
when unsuccessfully trying similar scenarios (different sequence of ifconfig ... up/down, iw dev ... del etc.)
Will this "ifindex" "overflow" some time,
even in case of repeated "iw phy phy0 interface add wmon0 type monitor" "iw dev wmon0 del" ?
I would have expected some kind of "reuse".

Regards
-- 
Reiner Karlsberg


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4842 / Virus Database: 4447/10982 - Release Date: 11/11/15
Internal Virus Database is out of date.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: iw ignores channel switch
  2015-12-03 11:01 iw ignores channel switch Reiner Karlsberg
@ 2015-12-03 12:45 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-12-03 12:45 UTC (permalink / raw)
  To: Reiner Karlsberg, linux-wireless

On Thu, 2015-12-03 at 12:01 +0100, Reiner Karlsberg wrote:
> 
>          Interface wlan0
>                  ifindex 21                         #steadily
> increasing, not re-used ?

Correct. You'll eventually roll over after 2^32-1 ... this has nothing
to do with wifi btw - look at ethernet devices :)

[snip irrelevant use of the station interface]

> root@OpenWrt:/tmp# iw dev wmon0 set channel 1

Is 'wmon0' still up at that point? It should work then, not sure why it
wouldn't, but it's certainly not an iw problem but more likely a kernel
problem. Since openwrt also has a fair number of patches I'd ask you to
please retest on a regular kernel first, or report the bug to them.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-03 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-03 11:01 iw ignores channel switch Reiner Karlsberg
2015-12-03 12:45 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).