Linux wireless drivers development
 help / color / mirror / Atom feed
From: Karthikeyan Kathirvel <kathirve@codeaurora.org>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCHv2] mac80211: choosing first channel from the list
Date: Tue, 17 Nov 2020 14:32:10 +0530	[thread overview]
Message-ID: <1d4bd5d785ff85819825d8b2a054f203@codeaurora.org> (raw)
In-Reply-To: <06b13326118d3fdeb3f665aa54af9c4e@codeaurora.org>

On 2020-11-17 14:28, kathirve@codeaurora.org wrote:
> On 2020-10-28 16:56, Karthikeyan Kathirvel wrote:
>> Though the first channel from sband channel list is invalid
>> or disabled still mac80211 is choosing this disabled channel
>> as a default channel for monitor interface. This will end-up
>> in choosing wrong channel.
>> 
>> Fixed by assigning the first available valid or enabled channel
>> to the respective radios.
>> 
>> Signed-off-by: Karthikeyan Kathirvel <kathirve@codeaurora.org>
>> ---
>> 
>> v2:
>> 	rebased
>> 
>>  net/mac80211/main.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>> 
>> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
>> index b4a2efe..a4aefd6 100644
>> --- a/net/mac80211/main.c
>> +++ b/net/mac80211/main.c
>> @@ -982,8 +982,15 @@ int ieee80211_register_hw(struct ieee80211_hw 
>> *hw)
>>  			continue;
>> 
>>  		if (!dflt_chandef.chan) {
>> +			/*
>> +			 * Assigning the first enabled channel to dflt_chandef from the
>> +			 * list of channels available specific to country
>> +			 */
>> +			for (i = 0; i < sband->n_channels; i++)
>> +				if (!(sband->channels[i].flags & IEEE80211_CHAN_DISABLED))
>> +					break;
>>  			cfg80211_chandef_create(&dflt_chandef,
>> -						&sband->channels[0],
>> +						&sband->channels[i == sband->n_channels ? 0 : i],
>>  						NL80211_CHAN_NO_HT);
>>  			/* init channel we're on */
>>  			if (!local->use_chanctx && !local->_oper_chandef.chan) {
> 
> Please ignore this.

Corrected my identity

      reply	other threads:[~2020-11-17  9:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1603884387-23757-1-git-send-email-kathirve@codeaurora.org>
2020-11-17  8:58 ` [PATCHv2] mac80211: choosing first channel from the list kathirve
2020-11-17  9:02   ` Karthikeyan Kathirvel [this message]

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=1d4bd5d785ff85819825d8b2a054f203@codeaurora.org \
    --to=kathirve@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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