Commit 1a19cb68 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

ieee802154: change transmit power to s32

This patch change the transmit power from s8 to s32. This prepares to store a
mbm value instead dbm inside the transmit power variable. The old
interface keep the a s8 dbm value, which should be backward compatibility
when assign s8 to s32.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 673692fa
...@@ -1194,7 +1194,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw, ...@@ -1194,7 +1194,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
} }
static int static int
at86rf230_set_txpower(struct ieee802154_hw *hw, s8 db) at86rf230_set_txpower(struct ieee802154_hw *hw, s32 db)
{ {
struct at86rf230_local *lp = hw->priv; struct at86rf230_local *lp = hw->priv;
......
...@@ -85,7 +85,7 @@ struct wpan_phy { ...@@ -85,7 +85,7 @@ struct wpan_phy {
u8 current_channel; u8 current_channel;
u8 current_page; u8 current_page;
u32 channels_supported[IEEE802154_MAX_PAGE + 1]; u32 channels_supported[IEEE802154_MAX_PAGE + 1];
s8 transmit_power; s32 transmit_power;
struct wpan_phy_cca cca; struct wpan_phy_cca cca;
__le64 perm_extended_addr; __le64 perm_extended_addr;
......
...@@ -213,7 +213,7 @@ struct ieee802154_ops { ...@@ -213,7 +213,7 @@ struct ieee802154_ops {
int (*set_hw_addr_filt)(struct ieee802154_hw *hw, int (*set_hw_addr_filt)(struct ieee802154_hw *hw,
struct ieee802154_hw_addr_filt *filt, struct ieee802154_hw_addr_filt *filt,
unsigned long changed); unsigned long changed);
int (*set_txpower)(struct ieee802154_hw *hw, s8 dbm); int (*set_txpower)(struct ieee802154_hw *hw, s32 dbm);
int (*set_lbt)(struct ieee802154_hw *hw, bool on); int (*set_lbt)(struct ieee802154_hw *hw, bool on);
int (*set_cca_mode)(struct ieee802154_hw *hw, int (*set_cca_mode)(struct ieee802154_hw *hw,
const struct wpan_phy_cca *cca); const struct wpan_phy_cca *cca);
......
...@@ -207,7 +207,7 @@ static const struct nla_policy nl802154_policy[NL802154_ATTR_MAX+1] = { ...@@ -207,7 +207,7 @@ static const struct nla_policy nl802154_policy[NL802154_ATTR_MAX+1] = {
[NL802154_ATTR_PAGE] = { .type = NLA_U8, }, [NL802154_ATTR_PAGE] = { .type = NLA_U8, },
[NL802154_ATTR_CHANNEL] = { .type = NLA_U8, }, [NL802154_ATTR_CHANNEL] = { .type = NLA_U8, },
[NL802154_ATTR_TX_POWER] = { .type = NLA_S8, }, [NL802154_ATTR_TX_POWER] = { .type = NLA_S32, },
[NL802154_ATTR_CCA_MODE] = { .type = NLA_U32, }, [NL802154_ATTR_CCA_MODE] = { .type = NLA_U32, },
[NL802154_ATTR_CCA_OPT] = { .type = NLA_U32, }, [NL802154_ATTR_CCA_OPT] = { .type = NLA_U32, },
...@@ -301,7 +301,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev, ...@@ -301,7 +301,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
goto nla_put_failure; goto nla_put_failure;
} }
if (nla_put_s8(msg, NL802154_ATTR_TX_POWER, if (nla_put_s32(msg, NL802154_ATTR_TX_POWER,
rdev->wpan_phy.transmit_power)) rdev->wpan_phy.transmit_power))
goto nla_put_failure; goto nla_put_failure;
......
...@@ -58,7 +58,7 @@ drv_set_channel(struct ieee802154_local *local, u8 page, u8 channel) ...@@ -58,7 +58,7 @@ drv_set_channel(struct ieee802154_local *local, u8 page, u8 channel)
return local->ops->set_channel(&local->hw, page, channel); return local->ops->set_channel(&local->hw, page, channel);
} }
static inline int drv_set_tx_power(struct ieee802154_local *local, s8 dbm) static inline int drv_set_tx_power(struct ieee802154_local *local, s32 dbm)
{ {
might_sleep(); might_sleep();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment