2014-05-14 11:25:29

by Janusz Dziedzic

[permalink] [raw]
Subject: [PATCH] cfg80211: fix start_radar_detection issue

After patch:
cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()

start_radar_detection always fail with -EINVAL.

Signed-off-by: Janusz Dziedzic <[email protected]>
---
net/wireless/chan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 84d686e..7a679a6 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -340,6 +340,7 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_UNSPECIFIED:
width = cfg80211_chandef_get_width(chandef);
if (width < 0)
return -EINVAL;
@@ -370,7 +371,6 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_P2P_DEVICE:
- case NL80211_IFTYPE_UNSPECIFIED:
break;
case NUM_NL80211_IFTYPES:
WARN_ON(1);
--
1.7.9.5



2014-05-15 09:39:33

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix start_radar_detection issue

On Thu, 2014-05-15 at 12:28 +0300, Eliad Peller wrote:
> On Wed, May 14, 2014 at 5:42 PM, Johannes Berg
> <[email protected]> wrote:
> > On Wed, 2014-05-14 at 13:25 +0200, Janusz Dziedzic wrote:
> >> After patch:
> >> cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()
> >>
> >> start_radar_detection always fail with -EINVAL.
> >
> > Applied, thanks.
> >
> probably a bit late, but i don't really see why passing
> NL80211_IFTYPE_UNSPECIFIED at all, instead of the iftype?

I did briefly wonder about the same, but decided Luca probably knew
better :)

johannes


2014-05-14 12:43:57

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix start_radar_detection issue

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IG1hYzgwMjExLW5leHQgdHJlZSkuDQoNClNvcnJ5IGZvciB0aGUgdHJvdWJsZS4NCg0KLS0NCkx1
Y2EuDQo=

2014-05-14 14:42:55

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix start_radar_detection issue

On Wed, 2014-05-14 at 13:25 +0200, Janusz Dziedzic wrote:
> After patch:
> cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()
>
> start_radar_detection always fail with -EINVAL.

Applied, thanks.

johannes


2014-05-15 09:28:45

by Eliad Peller

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix start_radar_detection issue

On Wed, May 14, 2014 at 5:42 PM, Johannes Berg
<[email protected]> wrote:
> On Wed, 2014-05-14 at 13:25 +0200, Janusz Dziedzic wrote:
>> After patch:
>> cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()
>>
>> start_radar_detection always fail with -EINVAL.
>
> Applied, thanks.
>
probably a bit late, but i don't really see why passing
NL80211_IFTYPE_UNSPECIFIED at all, instead of the iftype?

Eliad.

2014-05-15 09:55:46

by Luca Coelho

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: fix start_radar_detection issue

On Thu, 2014-05-15 at 09:51 +0000, Coelho, Luciano wrote:
> On Thu, 2014-05-15 at 11:39 +0200, Johannes Berg wrote:
> > On Thu, 2014-05-15 at 12:28 +0300, Eliad Peller wrote:
> > > On Wed, May 14, 2014 at 5:42 PM, Johannes Berg
> > > <[email protected]> wrote:
> > > > On Wed, 2014-05-14 at 13:25 +0200, Janusz Dziedzic wrote:
> > > >> After patch:
> > > >> cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()
> > > >>
> > > >> start_radar_detection always fail with -EINVAL.
> > > >
> > > > Applied, thanks.
> > > >
> > > probably a bit late, but i don't really see why passing
> > > NL80211_IFTYPE_UNSPECIFIED at all, instead of the iftype?
> >
> > I did briefly wonder about the same, but decided Luca probably knew
> > better :)
>
> Actually I also thought the same thing, but had the impression that
> there were cases when we wouldn't have the iftype when calling this.
> But now I checked both cases where we use NL80211_IFTYPE_UNSPECIFIED and
> it seems that we really don't need it.
>
> I'll send a patch to fix this and revert Janusz's change (unless
> Johannes wants to rebase the mac80211-next tree).

Instead of just reverting Janusz's patch, I'll make
cfg80211_chandef_dfs_required() WARN if UNSPECIFIED is passed.

--
Luca.