linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tamizh chelvam <tamizhr@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/3] mac80211: Implement API to configure station specific rssi threshold
Date: Sun, 11 Nov 2018 19:27:56 +0530	[thread overview]
Message-ID: <f3c8d129a8b7dea76febbb5a5adee113@codeaurora.org> (raw)
In-Reply-To: <f1c8ce7daf62c60197da9cc62d550fdc1cac6303.camel@sipsolutions.net>

On 2018-11-09 17:19, Johannes Berg wrote:
> On Mon, 2018-10-15 at 23:27 +0530, Tamizh chelvam wrote:
>> 
>> +		sta_mon_rssi_config_free(sta);
>> +		sta->rssi_hyst = rssi_hyst;
>> +		if (fixed_thold) {
>> +			if (n_rssi_tholds > 2) {
>> +				ret = -EINVAL;
>> +				goto out;
>> +			}
> 
> This might be slightly wrong, you free and then can still return an
> error.
> 
Sure. I'll move the free part after the validation check.

>> +			if (n_rssi_tholds == 1) {
>> +				sta->rssi_low = rssi_tholds[0];
>> +				sta->rssi_high = rssi_tholds[0];
>> +			} else {
>> +				sta->rssi_low = rssi_tholds[0];
>> +				sta->rssi_high = rssi_tholds[1];
>> +			}
>> +		} else {
>> +			const s32 *rssi_tholds;
>> +
>> +			rssi_tholds = kmemdup(rssi_tholds,
>> +					      n_rssi_tholds * sizeof(s32),
>> +					      GFP_KERNEL);
>> +			if (!rssi_tholds) {
>> +				ret = -ENOMEM;
>> +				goto out;
>> +			}
> 
> Similarly here, I guess you should do the allocation (and other error
> checking) before freeing.
> 
ditto, Sure. I'll move the free part after the validation check.

>> +			sta->rssi_tholds = rssi_tholds;
>> +			sta->n_rssi_tholds = n_rssi_tholds;
>> +			ieee80211_update_rssi_config(sta);
> 
> 
> 
>> +struct sta_mon_rssi_config {
>> +};
> 
> Huh?
> 
oops:( I have kept all configuring parameters in sta_info itself, 
mistakenly didn't remove this struct:(
> 
> The commit log also makes it sounds like mac80211 actually *supports*
> this, but clearly that's not the case. However you don't give any data
> to the driver either, did you lose a patch along the way? Previously 
> you
> had patch 5 ("mac80211: Implement functionality to monitor station's
> rssi cross event") and if I remember correctly I said you should squash
> some, but now that's not here?
> 

Thanks,
Tamizh.

  reply	other threads:[~2018-11-11 14:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 17:57 [PATCH 0/3] cfg80211/mac80211: Add support to configure and monitor station's rssi threshold Tamizh chelvam
2018-10-15 17:57 ` [PATCH 1/3] cfg80211: Add support to configure station specific RSSI threshold for AP mode Tamizh chelvam
2018-10-16 11:28   ` Sergey Matyukevich
2018-10-16 12:47     ` [EXTERNAL] " Tamizh Chelvam Raja
2018-11-09 11:44   ` Johannes Berg
2018-11-11 13:34     ` Tamizh chelvam
2018-10-15 17:57 ` [PATCH 2/3] mac80211: Implement API to configure station specific rssi threshold Tamizh chelvam
2018-11-09 11:49   ` Johannes Berg
2018-11-11 13:57     ` Tamizh chelvam [this message]
2018-10-15 17:57 ` [PATCH 3/3] mac80211: Implement functionality to monitor station's signal stregnth Tamizh chelvam
2018-10-16 11:49   ` Sergey Matyukevich
2018-11-09 11:55   ` Johannes Berg
2018-11-11 14:03     ` Tamizh chelvam

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=f3c8d129a8b7dea76febbb5a5adee113@codeaurora.org \
    --to=tamizhr@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;
as well as URLs for NNTP newsgroup(s).