mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Maxim Altshul <maxim.altshul@ti.com>, linux-kernel@vger.kernel.org
Cc: Kalle Valo <kvalo@codeaurora.org>,
	Eliad Peller <eliad@wizery.com>, Arik Nemtsov <arik@wizery.com>,
	Yaniv Machani <yanivma@ti.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] wlcore: Add support for get_expected_throughput opcode
Date: Thu, 30 Jun 2016 17:03:45 +0200	[thread overview]
Message-ID: <1467299025.14836.0.camel@sipsolutions.net> (raw)
In-Reply-To: <20160630145534.26052-1-maxim.altshul@ti.com> (sfid-20160630_165356_857494_C1EF09DF)

On Thu, 2016-06-30 at 17:49 +0300, Maxim Altshul wrote:
> Adding this opcode, allows the TI wireless driver,
> to report throughput directly from FW to mac80211.
> 
> This is used mainly for mesh metric calculation.
> 
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
> ---
> Changed the units of returned value.
> drv_get_expected_throughput returns units of Kbps 
> by definition, and thus we must comply as well.
> Mbps * 1000 = Kbps.
> 
>  drivers/net/wireless/ti/wlcore/main.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/net/wireless/ti/wlcore/main.c
> b/drivers/net/wireless/ti/wlcore/main.c
> index 39dec7d..cb1103b 100644
> --- a/drivers/net/wireless/ti/wlcore/main.c
> +++ b/drivers/net/wireless/ti/wlcore/main.c
> @@ -5851,6 +5851,20 @@ out:
>  	mutex_unlock(&wl->mutex);
>  }
>  
> +static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta
> *sta)
> +{
> +	struct wl1271_station *wl_sta = (struct wl1271_station
> *)sta->drv_priv;
> +	struct wl1271 *wl = wl_sta->wl;
> +	u8 hlid = wl_sta->hlid;
> +	u32 ret = 0;
> +
> +	/* return in units of Kbps */
> +	if (wl)
> +		ret = (wl->links[hlid].fw_rate_mbps * 1000);
> +
I don't see how wl can ever be NULL?

Also, you can certainly remove the 'ret' variable.

johannes

      reply	other threads:[~2016-06-30 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 14:49 Maxim Altshul
2016-06-30 15:03 ` Johannes Berg [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=1467299025.14836.0.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arik@wizery.com \
    --cc=eliad@wizery.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=maxim.altshul@ti.com \
    --cc=yanivma@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

all inboxes | Powered by JetHome®