Search Linux Wireless

Re: [ath9k-devel] How to enable Monitor mode?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting hwang <yyhymmh@xxxxxxxxx>:

I am first time use ath9k driver. I like to change the card to Monitor mode. Can anyone tell which command does it?

I tried to use iwconfig, but failed.

Moving discussion from ath9k-devel@xxxxxxxxxxxxxxx to linux-wireless@xxxxxxxxxxxxxxx, as it's a common problem for all mac80211 based drivers.

Following code in net/mac80211/iface.c, ieee80211_if_change_type() prevents setting monitor mode:

        /* Setting ad-hoc mode on non-IBSS channel is not supported. */
        if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
                return -EOPNOTSUPP;

The effect of the code exceeds the effect described by the comment, so something must be wrong. I'm not running crda, so I guess I'm in the "world" domain that doesn't prermit IBSS. But it should not disable monitor mode.

A simple fix would be:

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 5abbc3f..b907482 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
 		return 0;

 	/* Setting ad-hoc mode on non-IBSS channel is not supported. */
-	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+	if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS &&
+	    type == NL80211_IFTYPE_ADHOC)
 		return -EOPNOTSUPP;

 	/*

I've tested it, and it actually enables monitor mode. I remember Luis mentioning that IEEE80211_CHAN_NO_IBSS means no beacons, so maybe other modes need to be disabled (AP, maybe mesh), but there are no beacons sent in the monitor mode.

--
Regards,
Pavel Roskin
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux