On 28/01/14 20:06, Phoebe Buckheister wrote:
> The transmit_power field in struct wpan_phy is a field with two parts,
> the lower six bits containing the signed TX power and the upper two bits
> containing a tolerance indicator. This field is already used in some
> places and carries the correct semantics, reuse that field and set the
> tolerance indicator to +-1dB (which is 00b).
> 
> This patch only adds support for this in the at86rf230 driver and the
> RF212 chip. Configuration calculation for RF212 is also somewhat basic,
> but does the job - the RF212 datasheet gives a large table with
> suggested values for combinations of TX power and page/channel, if this
> does not work well, we might have to copy the whole table.

The more I look on this code, the more I fear that once in the future
wpan code will require some central registry (like Linux wifi has -
crda) of all options, max powers, allows, denies, etc. Hope nobody will
really require this in the forthcoming feature.

Regarding the patch. Let's forget about all the craziness of tx power.
802.15.4-2011 defines phyTxPower as simple as signed integer represnting
power in dBm. Let's follow that pattern and use just 's8' and signed
int. Then the driver can convert passed value to internal
representation. I think that would simplify this patch a bit.

The rest of the patch looks good.

> Signed-off-by: Phoebe Buckheister <phoebe.buckheis...@itwm.fraunhofer.de>
> ---
>  drivers/net/ieee802154/at86rf230.c |   25 ++++++++++++++++
>  include/linux/nl802154.h           |    4 +++
>  include/net/mac802154.h            |    5 ++++
>  include/net/wpan-phy.h             |    2 ++
>  net/ieee802154/ieee802154.h        |    1 +
>  net/ieee802154/netlink.c           |    1 +
>  net/ieee802154/nl-phy.c            |   55 
> +++++++++++++++++++++++++++++++++++-
>  net/ieee802154/nl_policy.c         |    2 ++
>  net/mac802154/ieee802154_dev.c     |   11 ++++++++

-- 
With best wishes
Dmitry

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to