linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Maxim Altshul <maxim.altshul@ti.com>, linux-kernel@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mac80211: mesh: Add support for HW RC implementation
Date: Thu, 23 Jun 2016 21:26:32 +0200	[thread overview]
Message-ID: <1466709992.11061.6.camel@sipsolutions.net> (raw)
In-Reply-To: <20160623135319.7653-1-maxim.altshul@ti.com>


> +void sta_get_expected_throughput(struct sta_info *sta, u32 *thr)
> +{
> +	struct ieee80211_sub_if_data *sdata = sta->sdata;
> +	struct ieee80211_local *local = sdata->local;
> +	struct rate_control_ref *ref = NULL;
> +
> +	if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
> +		ref = local->rate_ctrl;
> +
> +	/* check if the driver has a SW RC implementation */
> +	if (ref && ref->ops->get_expected_throughput)
> +		*thr = ref->ops->get_expected_throughput(sta-
> >rate_ctrl_priv);
> +	else
> +		*thr = drv_get_expected_throughput(local, &sta-
> >sta);
> +}

I don't really see a reason for the function to take a u32 *thr, rather
than return u32? Would be clearer, IMHO, to just return the value.

Then in the user, it seems that you shouldn't use "rate" as the
variable that gets this result?

johannes

  reply	other threads:[~2016-06-23 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 13:53 [PATCH v2] mac80211: mesh: Add support for HW RC implementation Maxim Altshul
2016-06-23 19:26 ` Johannes Berg [this message]
2016-06-30 15:30 Maxim Altshul
2016-07-06 12:35 ` Johannes Berg

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=1466709992.11061.6.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=maxim.altshul@ti.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;
as well as URLs for NNTP newsgroup(s).