Skip to contentSkip to conversation

ath5k: monitor mode needs channel change

DISCUSSION Joerg Albert 2 participants 5 messages Jul 30, 2009 – Aug 1, 2009

lore
Share & tools
lore
#0 lore raw

I currently need an extra trigger by changing the channel after "ifconfig up" to see any output in monitor mode from ath5k, e.g.

ifconfig wlan0 down
iwconfig wlan0 mode monitor channel 1
ifconfig wlan0 up

# no output by tcpdump -n -i wlan0  in another xterm
iwconfig wlan0 channel 2
# tcpdump output starts

The second "iwconfig" call must specify a channel different to the first one.

The above sequence without the second "iwconfig" works fine with a RTL8187 device.

I'm running
compat-wireless-2.6: master-2009-07-26-11-g83c091c
wireless-testing: v2.6.31-rc4-29204-g6b3a8c9 on top of a 2.6.30 kernel.

The WLAN NIC is a:

02:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01),
PCI id: 168c:001c (rev 01)

ath5k identifies it as:

ath5k phy0: Atheros AR2425 chip found (MAC: 0xe2, PHY: 0x70)

It's not a big issue, but a bit annoying sometimes.

#1 lore raw
Quoted 2 lines · Joerg Albert

I currently need an extra trigger by changing the channel after "ifconfig up" to see any output in monitor mode from ath5k, e.g.

Does this (accidentally) fix it by chance?

http://patchwork.kernel.org/patch/38165/

It reloads the filters at ifup time.

Signature · 1 line
Bob Copeland %% www.bobcopeland.com
#2 lore raw
Quoted 9 lines · Bob Copeland
Quoted 2 lines · Joerg Albert

I currently need an extra trigger by changing the channel after "ifconfig up" to see any output in monitor mode from ath5k, e.g.

Does this (accidentally) fix it by chance?

http://patchwork.kernel.org/patch/38165/

It reloads the filters at ifup time.

No, unfortunately this patch was already part of my ath5k. I'll try to add some printk.

#3 lore raw
Quoted 4 lines · Joerg Albert
Quoted 1 line

It reloads the filters at ifup time.

No, unfortunately this patch was already part of my ath5k. I'll try to add some printk.

Ah, I was just basing that on your compat-wireless version, but yeah w-t should have had it.

Hmm, well, probably a ath5k_reset() in add_interface would do the trick. Maybe there's some wrong assumption about when configure_filter() is called.

Signature · 1 line
Bob Copeland %% www.bobcopeland.com
#4 lore raw
Quoted 3 lines · Bob Copeland

Hmm, well, probably a ath5k_reset() in add_interface would do the trick. Maybe there's some wrong assumption about when configure_filter() is called.

Adding ath5k_reset() to the end of ath5k_add_interface didn't help.

Seems like in the case of

ifconfig wlan0 down
iwconfig wlan0 mode monitor channel 1
ifconfig wlan0 up

ath5k_chan_set() is called by ath5k_config() with sc->curchan == chan and it doesn't call ath5k_reset() - which I guess is needed to activate the new hw rx_filter.
ath5k_config() gets parameter changed == 0xffffffff,
i.e. CONF_CHANGE_CHANNEL is flagged.

With the following

iwconfig wlan0 channel 2

ath_chan_set() gets called with
sc->curchan->center_freq != chan->center_freq and
ath5k_reset() is invoked.

Patch follows.

Regards,
Joerg.