All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel.
@ 2011-06-23 20:49 Nicholas Hockey
  2011-06-25 13:38 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Hockey @ 2011-06-23 20:49 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

(sorry if this is not right, its been nearly 10 years since i
submitted a kernel patch)

Fixes: When monitoring a fixed channel, chan.c does not report what
channel it is on.

Signed-off-by: Nicholas Hockey <nhockey@gmail.com>
---
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 17cd0c0..261ee32 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -82,10 +82,12 @@ int cfg80211_set_freq(struct
cfg80211_registered_device *rdev,
 {
        struct ieee80211_channel *chan;
        int result;
+    struct wireless_dev *mon_dev = NULL;

-       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
+       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
+        mon_dev = wdev;
                wdev = NULL;
-
+    }
        if (wdev) {
                ASSERT_WDEV_LOCK(wdev);

@@ -131,5 +133,8 @@ int cfg80211_set_freq(struct
cfg80211_registered_device *rdev,
        if (wdev)
                wdev->channel = chan;

+    if (mon_dev)
+        mon_dev->channel = chan;
+
        return 0;
 }

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

* Re: [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel.
  2011-06-23 20:49 [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel Nicholas Hockey
@ 2011-06-25 13:38 ` Johannes Berg
  2011-06-28 16:12   ` Nicholas Hockey
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-06-25 13:38 UTC (permalink / raw)
  To: Nicholas Hockey; +Cc: linville, linux-wireless

On Thu, 2011-06-23 at 16:49 -0400, Nicholas Hockey wrote:
> (sorry if this is not right, its been nearly 10 years since i
> submitted a kernel patch)

Listing cfg80211 isntead of "chan.c" would have been useful :-)

> Fixes: When monitoring a fixed channel, chan.c does not report what
> channel it is on.
> 
> Signed-off-by: Nicholas Hockey <nhockey@gmail.com>
> ---
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index 17cd0c0..261ee32 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -82,10 +82,12 @@ int cfg80211_set_freq(struct
> cfg80211_registered_device *rdev,
>  {
>         struct ieee80211_channel *chan;
>         int result;
> +    struct wireless_dev *mon_dev = NULL;
> 
> -       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
> +       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
> +        mon_dev = wdev;
>                 wdev = NULL;
> -
> +    }
>         if (wdev) {
>                 ASSERT_WDEV_LOCK(wdev);
> 
> @@ -131,5 +133,8 @@ int cfg80211_set_freq(struct
> cfg80211_registered_device *rdev,
>         if (wdev)
>                 wdev->channel = chan;
> 
> +    if (mon_dev)
> +        mon_dev->channel = chan;
> +

This has been discussed numerous times, this change still isn't right
because monitors are slaved to others.

johannes


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

* Re: [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel.
  2011-06-25 13:38 ` Johannes Berg
@ 2011-06-28 16:12   ` Nicholas Hockey
  2011-06-29  2:53     ` Adrian Chadd
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Hockey @ 2011-06-28 16:12 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

If this has been discussed before, could you please point me to a
resource? if this solution is not correct, then id like to read why
its not correct, and formulate another solution for the problem. i am
an amateur radio tech and i have to apply this patch every single
build in order to use some custom software i have developed over the
years.

On Sat, Jun 25, 2011 at 9:38 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2011-06-23 at 16:49 -0400, Nicholas Hockey wrote:
>> (sorry if this is not right, its been nearly 10 years since i
>> submitted a kernel patch)
>
> Listing cfg80211 isntead of "chan.c" would have been useful :-)
>
>> Fixes: When monitoring a fixed channel, chan.c does not report what
>> channel it is on.
>>
>> Signed-off-by: Nicholas Hockey <nhockey@gmail.com>
>> ---
>> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
>> index 17cd0c0..261ee32 100644
>> --- a/net/wireless/chan.c
>> +++ b/net/wireless/chan.c
>> @@ -82,10 +82,12 @@ int cfg80211_set_freq(struct
>> cfg80211_registered_device *rdev,
>>  {
>>         struct ieee80211_channel *chan;
>>         int result;
>> +    struct wireless_dev *mon_dev = NULL;
>>
>> -       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
>> +       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
>> +        mon_dev = wdev;
>>                 wdev = NULL;
>> -
>> +    }
>>         if (wdev) {
>>                 ASSERT_WDEV_LOCK(wdev);
>>
>> @@ -131,5 +133,8 @@ int cfg80211_set_freq(struct
>> cfg80211_registered_device *rdev,
>>         if (wdev)
>>                 wdev->channel = chan;
>>
>> +    if (mon_dev)
>> +        mon_dev->channel = chan;
>> +
>
> This has been discussed numerous times, this change still isn't right
> because monitors are slaved to others.
>
> johannes
>
>



-- 
Nicholas (Tilt) Hockey

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

* Re: [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel.
  2011-06-28 16:12   ` Nicholas Hockey
@ 2011-06-29  2:53     ` Adrian Chadd
  2011-06-29  3:37       ` Nicholas Hockey
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Chadd @ 2011-06-29  2:53 UTC (permalink / raw)
  To: Nicholas Hockey; +Cc: Johannes Berg, linville, linux-wireless

Take a look at how monitor mode is used by other bits of software, eg
I think hostapd in Linux uses a monitor mode interface.

If I understand the Linux wifi stack use of monitor mode correctly,
it's not designed like the "classic" monitor mode from days gone by
(eg madwifi) (And this is what BSD still does..); it's a slave device
to a currently configured, non-monitor interface. The normal interface
gets the 'normal' traffic; the slave monitor mode interface sees the
management traffic so hostapd can do MLME, etc.

So you likely need to look at what hostapd does and create/use a
monitor mode interface in the same way. Ie, as a slave to a normal
interface, rather than a stand-alone interface.

Adrian

On 29 June 2011 00:12, Nicholas Hockey <nhockey@gmail.com> wrote:
> If this has been discussed before, could you please point me to a
> resource? if this solution is not correct, then id like to read why
> its not correct, and formulate another solution for the problem. i am
> an amateur radio tech and i have to apply this patch every single
> build in order to use some custom software i have developed over the
> years.
>
> On Sat, Jun 25, 2011 at 9:38 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
>> On Thu, 2011-06-23 at 16:49 -0400, Nicholas Hockey wrote:
>>> (sorry if this is not right, its been nearly 10 years since i
>>> submitted a kernel patch)
>>
>> Listing cfg80211 isntead of "chan.c" would have been useful :-)
>>
>>> Fixes: When monitoring a fixed channel, chan.c does not report what
>>> channel it is on.
>>>
>>> Signed-off-by: Nicholas Hockey <nhockey@gmail.com>
>>> ---
>>> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
>>> index 17cd0c0..261ee32 100644
>>> --- a/net/wireless/chan.c
>>> +++ b/net/wireless/chan.c
>>> @@ -82,10 +82,12 @@ int cfg80211_set_freq(struct
>>> cfg80211_registered_device *rdev,
>>>  {
>>>         struct ieee80211_channel *chan;
>>>         int result;
>>> +    struct wireless_dev *mon_dev = NULL;
>>>
>>> -       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
>>> +       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
>>> +        mon_dev = wdev;
>>>                 wdev = NULL;
>>> -
>>> +    }
>>>         if (wdev) {
>>>                 ASSERT_WDEV_LOCK(wdev);
>>>
>>> @@ -131,5 +133,8 @@ int cfg80211_set_freq(struct
>>> cfg80211_registered_device *rdev,
>>>         if (wdev)
>>>                 wdev->channel = chan;
>>>
>>> +    if (mon_dev)
>>> +        mon_dev->channel = chan;
>>> +
>>
>> This has been discussed numerous times, this change still isn't right
>> because monitors are slaved to others.
>>
>> johannes
>>
>>
>
>
>
> --
> Nicholas (Tilt) Hockey
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel.
  2011-06-29  2:53     ` Adrian Chadd
@ 2011-06-29  3:37       ` Nicholas Hockey
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Hockey @ 2011-06-29  3:37 UTC (permalink / raw)
  To: Adrian Chadd; +Cc: Johannes Berg, linville, linux-wireless

thank you very much, that is very helpful information. im sure it will
be a resource for not only me, but a host of others frustrated by the
current state. in order that they will/should be able to research and
modify their software accordingly. i originally wrote my software in
the madwifi days, and didnt pay enough attention to the changes, all i
knew was that the patch i posted solved my problem. i still dont see
whats wrong with my method, but im hoping the direction you have
pointed me in will help answer that,

On Tue, Jun 28, 2011 at 10:53 PM, Adrian Chadd <adrian@freebsd.org> wrote:
> Take a look at how monitor mode is used by other bits of software, eg
> I think hostapd in Linux uses a monitor mode interface.
>
> If I understand the Linux wifi stack use of monitor mode correctly,
> it's not designed like the "classic" monitor mode from days gone by
> (eg madwifi) (And this is what BSD still does..); it's a slave device
> to a currently configured, non-monitor interface. The normal interface
> gets the 'normal' traffic; the slave monitor mode interface sees the
> management traffic so hostapd can do MLME, etc.
>
> So you likely need to look at what hostapd does and create/use a
> monitor mode interface in the same way. Ie, as a slave to a normal
> interface, rather than a stand-alone interface.
>
> Adrian
>
> On 29 June 2011 00:12, Nicholas Hockey <nhockey@gmail.com> wrote:
>> If this has been discussed before, could you please point me to a
>> resource? if this solution is not correct, then id like to read why
>> its not correct, and formulate another solution for the problem. i am
>> an amateur radio tech and i have to apply this patch every single
>> build in order to use some custom software i have developed over the
>> years.
>>
>> On Sat, Jun 25, 2011 at 9:38 AM, Johannes Berg
>> <johannes@sipsolutions.net> wrote:
>>> On Thu, 2011-06-23 at 16:49 -0400, Nicholas Hockey wrote:
>>>> (sorry if this is not right, its been nearly 10 years since i
>>>> submitted a kernel patch)
>>>
>>> Listing cfg80211 isntead of "chan.c" would have been useful :-)
>>>
>>>> Fixes: When monitoring a fixed channel, chan.c does not report what
>>>> channel it is on.
>>>>
>>>> Signed-off-by: Nicholas Hockey <nhockey@gmail.com>
>>>> ---
>>>> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
>>>> index 17cd0c0..261ee32 100644
>>>> --- a/net/wireless/chan.c
>>>> +++ b/net/wireless/chan.c
>>>> @@ -82,10 +82,12 @@ int cfg80211_set_freq(struct
>>>> cfg80211_registered_device *rdev,
>>>>  {
>>>>         struct ieee80211_channel *chan;
>>>>         int result;
>>>> +    struct wireless_dev *mon_dev = NULL;
>>>>
>>>> -       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
>>>> +       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
>>>> +        mon_dev = wdev;
>>>>                 wdev = NULL;
>>>> -
>>>> +    }
>>>>         if (wdev) {
>>>>                 ASSERT_WDEV_LOCK(wdev);
>>>>
>>>> @@ -131,5 +133,8 @@ int cfg80211_set_freq(struct
>>>> cfg80211_registered_device *rdev,
>>>>         if (wdev)
>>>>                 wdev->channel = chan;
>>>>
>>>> +    if (mon_dev)
>>>> +        mon_dev->channel = chan;
>>>> +
>>>
>>> This has been discussed numerous times, this change still isn't right
>>> because monitors are slaved to others.
>>>
>>> johannes
>>>
>>>
>>
>>
>>
>> --
>> Nicholas (Tilt) Hockey
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>



-- 
Nicholas (Tilt) Hockey

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

end of thread, other threads:[~2011-06-29  3:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23 20:49 [PATCH] chan.c: fix chan.c to return channel number when in monitor mode and on a fixed channel Nicholas Hockey
2011-06-25 13:38 ` Johannes Berg
2011-06-28 16:12   ` Nicholas Hockey
2011-06-29  2:53     ` Adrian Chadd
2011-06-29  3:37       ` Nicholas Hockey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.