Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Cc: linux-wpan@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [RFC bluetooth-next 09/15] ieee802154: add support for get tx powers
Date: Wed, 29 Apr 2015 11:07:21 +0200	[thread overview]
Message-ID: <20150429090717.GA1170@omega> (raw)
In-Reply-To: <20150427134932.64e5325a@zoidberg>

Hi Phoebe,

On Mon, Apr 27, 2015 at 01:49:32PM +0200, Phoebe Buckheister wrote:
> On Thu, 23 Apr 2015 18:47:48 +0200
> Alexander Aring <alex.aring@gmail.com> wrote:
> 
...
> > +	int		(*get_tx_powers)(struct ieee802154_hw
> > *hw, s8 *dbm,
> > +					 u32 idx);
> 
> I suggest you use mBm instead of dBm here, while you're at it anyway.
> Especially since one of your later patches will add incorrect values
> because dBm isn't accurate enough for what the transceiver support
> (rf230, TX power +3.4dBm). This would also make the value-2 return you
> have right now unnecessary.
> 

The 802.15.4 standard describes in the phy pib for tx power:

attr: phyTXPower
type: signed integer
range: -
describtion: The transmit power of the device in dBm.

I mentioned in my previous mail that this doesn't repsonse the reality
because there are transceivers outside which supports tx power in dbm
which are not signed integer, like +3.4 dbm.

Nevertheless I would say forget that what the PIB says, we do what the
reality does now. (In my previous mail I was another opinion because the
current type is s8). I think we should not do that now, because we get
trouble later, this is what you mentioned now and I agree.


Plan to implement the mbm:

1. change current tx power to S32 instead s8.
   I gave it a try phy dump with iwpan still works, (not ends in a
   critical error), so I will change it.

2. the kernelside use mbm everywhere the userspace side kann convert the
   dbm values to mbm then with a calculation "dbm = mbm / 100" and
   "mbm = dbm * 100".

   Some helper marcos like:
   #define DBM_TO_MBM(gain) ((int)(((float)gain) * 100))
   #define MBM_TO_DBM(gain) ((float)(gain) / 100)

Examples
   MBM    | DBM
   +230   | +2.3
   -280   | -2.8
   ...    | ....

Thanks, for the review.

- Alex

  reply	other threads:[~2015-04-29  9:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 16:47 [RFC bluetooth-next 00/15] ieee802154: add support for phy capabilities Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 01/15] nl802154: cleanup invalid argument handling Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 02/15] at86rf230: remove tabs after define Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 03/15] ieee802154: move validation check out of softmac Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 04/15] mac802154: check for really changes Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 05/15] mac802154: remove check if operation is supported Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 06/15] ieee802154: introduce wpan_phy_supported Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 07/15] ieee802154: add several phy supported handling Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 08/15] ieee802154: add iftypes capability Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 09/15] ieee802154: add support for get tx powers Alexander Aring
2015-04-27 11:49   ` Phoebe Buckheister
2015-04-29  9:07     ` Alexander Aring [this message]
2015-04-23 16:47 ` [RFC bluetooth-next 10/15] ieee802154: add support for get cca ed levels Alexander Aring
2015-04-27 11:50   ` Phoebe Buckheister
2015-04-23 16:47 ` [RFC bluetooth-next 11/15] at86rf230: set cca_modes supported flags Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 12/15] at86rf230: add reset states of tx power level Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 13/15] at86rf230: rework tx power support Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 14/15] at86rf230: rework tx cca energy detection level Alexander Aring
2015-04-23 16:47 ` [RFC bluetooth-next 15/15] nl802154: add support for dump phy capabilities Alexander Aring
2015-04-24  4:43   ` Varka Bhadram
2015-04-25  6:47     ` Alexander Aring
2015-04-24  3:38 ` [RFC bluetooth-next 00/15] ieee802154: add support for " Varka Bhadram
2015-04-24  5:11   ` Varka Bhadram
2015-04-25 10:06     ` Alexander Aring
2015-04-27  6:51       ` Varka Bhadram
2015-04-25  6:48   ` Alexander Aring

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=20150429090717.GA1170@omega \
    --to=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    --cc=phoebe.buckheister@itwm.fraunhofer.de \
    /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