Linux wireless drivers development
 help / color / mirror / Atom feed
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
To: sergey.matyukevich.os@quantenna.com
Cc: linux-wireless@vger.kernel.org, avinashp@quantenna.com,
	johannes@sipsolutions.net
Subject: Re: [PATCH 02/27] qtnfmac: make "Channel change" event report full channel info
Date: Tue, 29 Aug 2017 18:45:36 -0700	[thread overview]
Message-ID: <6e393e69-3297-4300-c82a-fea0243d6bcc@quantenna.com> (raw)
In-Reply-To: <20170829143146.ersgkofruzdpta6y@bars>

On 08/29/2017 07:31 AM, Sergey Matyukevich wrote:
>>   static int
>>   qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif,
>> @@ -358,41 +359,36 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
>>   			      u16 len)
>>   {
>>   	struct wiphy *wiphy = priv_to_wiphy(mac);
>> -	struct cfg80211_chan_def chandef;
>> -	struct ieee80211_channel *chan;
>> +	struct cfg80211_chan_def chdef;
>>   	struct qtnf_vif *vif;
>> -	int freq;
>>   	int i;
> 
> Original variable name 'chandef' was easier to spell on the phone :)

Will return)

> 
> ...
> 
>> +	qlink_chandef_q2cfg(wiphy, &data->chan, &chdef);
>> +
>> +	if (!cfg80211_chandef_valid(&chdef)) {
>> +		pr_err("MAC%u: bad channel freq1=%u bw=%u\n", mac->macid,
>> +		       chdef.center_freq1, chdef.width);
>>   		return -EINVAL;
>>   	}
> 
> Lets keep both freq1 and freq2 in error message.

Ok

> 
> ...
> 
>> +void qlink_chandef_q2cfg(struct wiphy *wiphy,
>> +			 const struct qlink_chandef *qch,
>> +			 struct cfg80211_chan_def *chdef)
>> +{
>> +	chdef->center_freq1 = le16_to_cpu(qch->center_freq1);
>> +	chdef->center_freq2 = le16_to_cpu(qch->center_freq2);
>> +	chdef->width = qlink_chanwidth_to_nl(qch->width);
>> +
>> +	switch (chdef->width) {
>> +	case NL80211_CHAN_WIDTH_20_NOHT:
>> +	case NL80211_CHAN_WIDTH_20:
>> +	case NL80211_CHAN_WIDTH_5:
>> +	case NL80211_CHAN_WIDTH_10:
>> +		chdef->chan = ieee80211_get_channel(wiphy, chdef->center_freq1);
>> +		break;
>> +	case NL80211_CHAN_WIDTH_40:
>> +	case NL80211_CHAN_WIDTH_80:
>> +	case NL80211_CHAN_WIDTH_80P80:
>> +	case NL80211_CHAN_WIDTH_160:
>> +		chdef->chan = ieee80211_get_channel(wiphy,
>> +						    chdef->center_freq1 - 10);
> 
> Do we have the same formula for 40MHz and 80MHz center frequency ?
> I thought we should be using the channel number for the left-most 20MHz band.

Here it should be no difference which channel number we're using as long 
as it falls within specified bandwidth. I mean, we can take (freq - 10), 
(freq + 10) for 40MHz, or (freq - 30) (freq + 30) for 80 MHz etc.

I don't see how we can identify which 20MHz channel is primary, with a 
chandef structure.

> 
>> +		break;
>> +	default:
>> +		chdef->chan = NULL;
>> +		break;
>> +	}
>> +}
> 
> Regards,
> Sergey
> 

  reply	other threads:[~2017-08-30  1:45 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25  2:29 [PATCH 00/27] qtnfmac: allow to configure channel, BW, HT/VHT caps igor.mitsyanko.os
2017-08-25  2:29 ` [PATCH 01/27] qtnfmac: qlink: convert channel width from bitfiled to simple enum igor.mitsyanko.os
2017-08-25  2:29 ` [PATCH 02/27] qtnfmac: make "Channel change" event report full channel info igor.mitsyanko.os
2017-08-29 14:31   ` Sergey Matyukevich
2017-08-30  1:45     ` Igor Mitsyanko [this message]
2017-08-25  2:30 ` [PATCH 03/27] qtnfmac: retreive current channel info from EP igor.mitsyanko.os
2017-08-29 14:42   ` Sergey Matyukevich
2017-08-30  1:39     ` Igor Mitsyanko
2017-08-25  2:30 ` [PATCH 04/27] qtnfmac: do not cache AP settings in driver structures igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 05/27] qtnfmac: pass all AP settings to wireless card for processing igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 06/27] qtnfmac: pass full channel definition to device on start_ap command igor.mitsyanko.os
2017-08-30 14:02   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 07/27] qtnfmac: get rid of QTNF_STATE_AP_CONFIG igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 08/27] qtnfmac: get rid of QTNF_STATE_AP_START usage igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 09/27] qtnfmac: do not cache BSS state in per-VIF structure igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 10/27] qtnfmac: do not cache channel info from "connect" command igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 11/27] qtnfmac: make encryption info a part of " igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 12/27] qtnfmac: let wifi card handle channel switch request to the same chan igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 13/27] qtnfmac: pass VIF info to SendChannel command igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 14/27] qtnfmac: do not cache CSA chandef info igor.mitsyanko.os
2017-08-29 15:44   ` Sergey Matyukevich
2017-08-30  1:48     ` Igor Mitsyanko
2017-08-30  8:05       ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 15/27] qtnfmac: remove unused mac::status field igor.mitsyanko.os
2017-08-29 15:47   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 16/27] qtnfmac: stop using private driver info about current channel igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 17/27] qtnfmac: do not report channel changes until wiphy is registered igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 18/27] qtnfmac: use per-band HT/VHT info from wireless device igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 19/27] qtnfmac: initialize HT/VHT caps "can override" masks igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 20/27] qtnfmac: get rid of PHYMODE capabilities flags igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 21/27] qtnfmac: extend "IE set" TLV to include frame type info igor.mitsyanko.os
2017-08-30 12:07   ` Sergey Matyukevich
2017-08-30 12:20     ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 22/27] qtnfmac: SCAN results: retreive frame type information from "IE set" TLV igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 23/27] qtnfmac: convert "Append IEs" command to QTN_TLV_ID_IE_SET usage igor.mitsyanko.os
2017-08-30 12:35   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 24/27] qtnfmac: configure and start AP interface with a single command igor.mitsyanko.os
2017-08-30 13:07   ` Sergey Matyukevich
2017-08-25  2:30 ` [PATCH 25/27] nl80211: look for HT/VHT capabilities in beacon's tail igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 26/27] qtnfmac: include HTCAP and VHTCAP into config AP command igor.mitsyanko.os
2017-08-25  2:30 ` [PATCH 27/27] qtnfmac: pass all CONNECT cmd params to wireless card for processing igor.mitsyanko.os
2017-08-30 16:16 ` [PATCH 00/27] qtnfmac: allow to configure channel, BW, HT/VHT caps Kalle Valo
2017-08-30 16:22   ` Kalle Valo
2017-08-30 16:28     ` Kalle Valo
2017-08-30 18:22       ` Igor Mitsyanko
2017-08-30 18:20   ` Igor Mitsyanko

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=6e393e69-3297-4300-c82a-fea0243d6bcc@quantenna.com \
    --to=igor.mitsyanko.os@quantenna.com \
    --cc=avinashp@quantenna.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sergey.matyukevich.os@quantenna.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