public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Sebastian Gottschall
	<s.gottschall-9LViYcISHtuk6R/r8kmGfQ@public.gmane.org>
Cc: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Chih-Min Chen
	<chih-min.Chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	YF Luo <yf.luo-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Yiwei Chung <yiwei.chung-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Roy Luo <royluo-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Lorenzo Bianconi
	<lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Felix Fietkau <nbd-Vt+b4OUoWG0@public.gmane.org>
Subject: Re: [PATCH] mt76: mt7615: add support for per-chain signal strength reporting
Date: Mon, 10 Jun 2019 12:22:21 +0800	[thread overview]
Message-ID: <1560140541.5606.12.camel@mtkswgap22> (raw)
In-Reply-To: <1560132590.28258.5.camel@mtkswgap22>

On Mon, 2019-06-10 at 10:09 +0800, Ryder Lee wrote:
> On Sun, 2019-06-09 at 16:44 +0200, Sebastian Gottschall wrote:
> > according to my findings
> > 
> > MT_RXV4_RCPI1 is part of rx descriptor 4 and not 3
> > so it must be rxdg4 = rxd[4] etc.
> 
> RXV start from 1 in the code.
> 
> That is: RXV1 <-> rxdg0, RXV2 <-> rxdg1 ...so RXV4 <-> rxdg3
> 
> > however rxdg3 contains MT_RXV3_IB_RSSIRX which can be used for signal calculation.
> > i already wrote a similar code for this driver which i sended to felix a long time ago.
> > my variant looks like
> >                  status->signal = (FIELD_GET(MT_RXV3_IB_RSSIRX, rxdg3) - 220) / 2;
> >                  status->chain_signal[0] = (FIELD_GET(MT_RXV4_RCPI0, rxdg4) - 220) / 2;
> >                  status->chain_signal[1] = (FIELD_GET(MT_RXV4_RCPI1, rxdg4) - 220) / 2;
> >                  status->chain_signal[2] = (FIELD_GET(MT_RXV4_RCPI2, rxdg4) - 220) / 2;
> >                  status->chain_signal[3] = (FIELD_GET(MT_RXV4_RCPI3, rxdg4) - 220) / 2;

mt7615 actually doesn't use in-band RSSI for signal calculation, but it
occurs to me that i should modify the code to compare per-chain's
signal. Something like this:

		status->chain_signal[0] = to_rssi(MT_RXV4_RCPI0, rxdg3);
		status->chain_signal[1] = to_rssi(MT_RXV4_RCPI1, rxdg3);
		status->chain_signal[2] = to_rssi(MT_RXV4_RCPI2, rxdg3);
		status->chain_signal[3] = to_rssi(MT_RXV4_RCPI3, rxdg3);
		status->signal = status->chain_signal[0];

		switch (status->chains) {
		case 0xf:
			status->signal = max(status->signal,
					     status->chain_signal[3]);
		case 0x7:
			status->signal = max(status->signal,
					     status->chain_signal[2]);
		case 0x3:
			status->signal = max(status->signal,
					     status->chain_signal[1]);
			break;
		default:
			break;
		}


I could send a v2 or you can take care of that.

Ryder

  reply	other threads:[~2019-06-10  4:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-09  9:09 [PATCH] mt76: mt7615: add support for per-chain signal strength reporting Ryder Lee
     [not found] ` <3912a2863e858f3623ced61737836e42c7b19149.1560071167.git.ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-06-09 14:44   ` Sebastian Gottschall
     [not found]     ` <d6cfd2e9-4b2b-36ac-6cae-a34f74204801-9LViYcISHtuk6R/r8kmGfQ@public.gmane.org>
2019-06-10  2:09       ` Ryder Lee
2019-06-10  4:22         ` Ryder Lee [this message]
2019-06-10  4:47           ` Sebastian Gottschall
2019-06-10  7:12             ` Ryder Lee

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=1560140541.5606.12.camel@mtkswgap22 \
    --to=ryder.lee-nus5lvnupcjwk0htik3j/w@public.gmane.org \
    --cc=chih-min.Chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=nbd-Vt+b4OUoWG0@public.gmane.org \
    --cc=royluo-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=s.gottschall-9LViYcISHtuk6R/r8kmGfQ@public.gmane.org \
    --cc=sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=yf.luo-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=yiwei.chung-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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