From: Johannes Berg <johannes@sipsolutions.net>
To: Pavel Roskin <proski@gnu.org>
Cc: yyhymmh@yahoo.com, linux-wireless@vger.kernel.org
Subject: Re: [ath9k-devel] How to enable Monitor mode?
Date: Mon, 22 Dec 2008 18:18:28 +0100 [thread overview]
Message-ID: <1229966308.4406.4.camel@johannes> (raw)
In-Reply-To: <20081222121621.66jxpzr6lt8okk4o-cebfxv@webmail.spamcop.net> (sfid-20081222_181621_767424_496AEE78)
[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]
On Mon, 2008-12-22 at 12:16 -0500, Pavel Roskin wrote:
> Quoting hwang <yyhymmh@yahoo.com>:
>
> > 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@lists.ath9k.org to
> linux-wireless@vger.kernel.org, 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.
I haven't gotten around, but that patch is correct. That's how it was
before I moved that code, when I accidentally lost the check.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2008-12-22 17:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <690453.5943.qm@web80505.mail.mud.yahoo.com>
2008-12-22 17:16 ` [ath9k-devel] How to enable Monitor mode? Pavel Roskin
2008-12-22 17:18 ` Johannes Berg [this message]
2008-12-22 21:41 ` Pavel Roskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1229966308.4406.4.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=proski@gnu.org \
--cc=yyhymmh@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).