linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
@ 2023-06-26  7:58 JUN-KYU SHIN
  2023-07-05 21:12 ` Jakub Kicinski
  0 siblings, 1 reply; 6+ messages in thread
From: JUN-KYU SHIN @ 2023-06-26  7:58 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, JUN-KYU SHIN

On the S1G band, even if freq_offset exists in the
__ieee80211_channel_switch function, it is not treated as an error.

Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
---
 net/mac80211/cfg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f2d08dbccfb7..f251945cf6fd 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3909,8 +3909,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
-	if (params->chandef.chan->freq_offset) {
-		/* this may work, but is untested */
+	if (params->chandef.chan->freq_offset &&
+	    params->chandef.chan->band != NL80211_BAND_S1GHZ) {
+		/* Currently, offset is supported only on the S1G band. */
 		err = -EOPNOTSUPP;
 		goto out;
 	}
-- 
2.25.1


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

* Re: [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
  2023-06-26  7:58 [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band JUN-KYU SHIN
@ 2023-07-05 21:12 ` Jakub Kicinski
  2023-07-11  8:09   ` JUN-KYU SHIN
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-07-05 21:12 UTC (permalink / raw)
  To: JUN-KYU SHIN; +Cc: johannes, linux-wireless

On Mon, 26 Jun 2023 16:58:18 +0900 JUN-KYU SHIN wrote:
> On the S1G band, even if freq_offset exists in the
> __ieee80211_channel_switch function, it is not treated as an error.

Sounds like e bug fix to me.

Could you describe the user visible impact in simpler terms,
and add a Fixes tag?

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

* [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
  2023-07-05 21:12 ` Jakub Kicinski
@ 2023-07-11  8:09   ` JUN-KYU SHIN
  2023-07-13  0:37     ` Jakub Kicinski
  0 siblings, 1 reply; 6+ messages in thread
From: JUN-KYU SHIN @ 2023-07-11  8:09 UTC (permalink / raw)
  To: kuba; +Cc: jk.shin, johannes, linux-wireless

When channel_switch is performed to a channel with a freq_offset,
such as 909.5 MHz, channel_switch fails with the "-EOPNOTSUPP" error.
Since freq_offset is used in the S1G band, it should not be treated
as an error only with the freq_offset condition.

Fixes: b6011960f392 ("mac80211: handle channel frequency offset")
Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
---
 net/mac80211/cfg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f2d08dbccfb7..f251945cf6fd 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3909,8 +3909,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
-	if (params->chandef.chan->freq_offset) {
-		/* this may work, but is untested */
+	if (params->chandef.chan->freq_offset &&
+	    params->chandef.chan->band != NL80211_BAND_S1GHZ) {
+		/* Currently, offset is supported only on the S1G band. */
 		err = -EOPNOTSUPP;
 		goto out;
 	}
-- 
2.25.1


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

* Re: [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
  2023-07-11  8:09   ` JUN-KYU SHIN
@ 2023-07-13  0:37     ` Jakub Kicinski
  2023-07-13  6:52       ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-07-13  0:37 UTC (permalink / raw)
  To: johannes; +Cc: JUN-KYU SHIN, linux-wireless

On Tue, 11 Jul 2023 17:09:18 +0900 JUN-KYU SHIN wrote:
> When channel_switch is performed to a channel with a freq_offset,
> such as 909.5 MHz, channel_switch fails with the "-EOPNOTSUPP" error.
> Since freq_offset is used in the S1G band, it should not be treated
> as an error only with the freq_offset condition.
> 
> Fixes: b6011960f392 ("mac80211: handle channel frequency offset")
> Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>

Johannes, since you seem to be around - yes/no/can wait? :)

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

* Re: [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
  2023-07-13  0:37     ` Jakub Kicinski
@ 2023-07-13  6:52       ` Johannes Berg
  2023-07-21  6:19         ` JUN-KYU SHIN
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2023-07-13  6:52 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: JUN-KYU SHIN, linux-wireless

Hi,

Yeah I'm home for this week, so really just a few more days.

I think it can wait, I'm not even sure there's a driver that fully supports S1G band upstream yet? Other than hwsim, but that doesn't _really_ matter. Well, arguably it's a whole new feature for S1G, so doesn't matter much anyway. 

Also, I'd be a bit worried that the comment there means we didn't push the frequency offset through all the APIs, so it would still not work with the patch? Jun-Kyu, did you actually try this? If so, how? 

But I haven't been able to take a closer look.

johannes 

On 13 July 2023 02:37:24 CEST, Jakub Kicinski <kuba@kernel.org> wrote:
>On Tue, 11 Jul 2023 17:09:18 +0900 JUN-KYU SHIN wrote:
>> When channel_switch is performed to a channel with a freq_offset,
>> such as 909.5 MHz, channel_switch fails with the "-EOPNOTSUPP" error.
>> Since freq_offset is used in the S1G band, it should not be treated
>> as an error only with the freq_offset condition.
>> 
>> Fixes: b6011960f392 ("mac80211: handle channel frequency offset")
>> Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
>
>Johannes, since you seem to be around - yes/no/can wait? :)
>

-- 
Sent from my phone.

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

* Re: [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band
  2023-07-13  6:52       ` Johannes Berg
@ 2023-07-21  6:19         ` JUN-KYU SHIN
  0 siblings, 0 replies; 6+ messages in thread
From: JUN-KYU SHIN @ 2023-07-21  6:19 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Jakub Kicinski, linux-wireless

As mentioned below, frequency offset is not used in the current kernel.
I would like to contribute to the kernel so that the use of the S1G band
can operate completely, but I cannot afford it.
Therefore, I am using the S1G band by modifying some parts of the kernel
and hostap on my own.
A more detailed explanation of the kernel modifications is as follows:
1.Function to convert frequency and channel index according to the country.
2. Skip the regulation check on the S1G band.
3. Bandwidth setting for the S1G band and other changes.

However, as you know, in order to apply a patch with these modifications,
there are parts that must be preceded.
So, I have uploaded a patch that can be easily checked in terms of logic
to see if it needs fixing.

We will gradually upload patches to fully support the S1G band.


On Thu, Jul 13, 2023 at 08:52:16AM +0200, Johannes Berg wrote:
> Hi,
> 
> Yeah I'm home for this week, so really just a few more days.
> 
> I think it can wait, I'm not even sure there's a driver that fully supports S1G band upstream yet? Other than hwsim, but that doesn't _really_ matter. Well, arguably it's a whole new feature for S1G, so doesn't matter much anyway. 
> 
> Also, I'd be a bit worried that the comment there means we didn't push the frequency offset through all the APIs, so it would still not work with the patch? Jun-Kyu, did you actually try this? If so, how? 
> 
> But I haven't been able to take a closer look.
> 
> johannes 
> 
> On 13 July 2023 02:37:24 CEST, Jakub Kicinski <kuba@kernel.org> wrote:
> >On Tue, 11 Jul 2023 17:09:18 +0900 JUN-KYU SHIN wrote:
> >> When channel_switch is performed to a channel with a freq_offset,
> >> such as 909.5 MHz, channel_switch fails with the "-EOPNOTSUPP" error.
> >> Since freq_offset is used in the S1G band, it should not be treated
> >> as an error only with the freq_offset condition.
> >> 
> >> Fixes: b6011960f392 ("mac80211: handle channel frequency offset")
> >> Signed-off-by: JUN-KYU SHIN <jk.shin@newratek.com>
> >
> >Johannes, since you seem to be around - yes/no/can wait? :)
> >
> 
> -- 
> Sent from my phone.

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

end of thread, other threads:[~2023-07-21  6:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-26  7:58 [PATCH] wifi: mac80211: fix error handling when channel_switch on S1G band JUN-KYU SHIN
2023-07-05 21:12 ` Jakub Kicinski
2023-07-11  8:09   ` JUN-KYU SHIN
2023-07-13  0:37     ` Jakub Kicinski
2023-07-13  6:52       ` Johannes Berg
2023-07-21  6:19         ` JUN-KYU SHIN

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).