summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 21:44:39 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 11:44:41 +0200
commit1a19cb680be0d4b06ce9a9d6516b8f45f544d3e8 (patch)
treeb61fa7ac0d60156c831c674ed0b0c3adf67e1be0
parent673692faf3fb42ec73ef7210238b5869d6e2873d (diff)
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: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--drivers/net/ieee802154/at86rf230.c2
-rw-r--r--include/net/cfg802154.h2
-rw-r--r--include/net/mac802154.h2
-rw-r--r--net/ieee802154/nl802154.c6
-rw-r--r--net/mac802154/driver-ops.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 67d00fbc2e0e..02b6bb72304d 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1194,7 +1194,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
}
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;
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
index 6ea16c84293b..47804cddb46f 100644
--- a/include/net/cfg802154.h
+++ b/include/net/cfg802154.h
@@ -85,7 +85,7 @@ struct wpan_phy {
u8 current_channel;
u8 current_page;
u32 channels_supported[IEEE802154_MAX_PAGE + 1];
- s8 transmit_power;
+ s32 transmit_power;
struct wpan_phy_cca cca;
__le64 perm_extended_addr;
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index 7df28a4c23f9..400e4e85c53f 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -213,7 +213,7 @@ struct ieee802154_ops {
int (*set_hw_addr_filt)(struct ieee802154_hw *hw,
struct ieee802154_hw_addr_filt *filt,
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_cca_mode)(struct ieee802154_hw *hw,
const struct wpan_phy_cca *cca);
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index d750d9778ba7..f3185c71af10 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -207,7 +207,7 @@ static const struct nla_policy nl802154_policy[NL802154_ATTR_MAX+1] = {
[NL802154_ATTR_PAGE] = { .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_OPT] = { .type = NLA_U32, },
@@ -301,8 +301,8 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
goto nla_put_failure;
}
- if (nla_put_s8(msg, NL802154_ATTR_TX_POWER,
- rdev->wpan_phy.transmit_power))
+ if (nla_put_s32(msg, NL802154_ATTR_TX_POWER,
+ rdev->wpan_phy.transmit_power))
goto nla_put_failure;
finish:
diff --git a/net/mac802154/driver-ops.h b/net/mac802154/driver-ops.h
index a0533357b9ea..57c1bdbfaa91 100644
--- a/net/mac802154/driver-ops.h
+++ b/net/mac802154/driver-ops.h
@@ -58,7 +58,7 @@ drv_set_channel(struct ieee802154_local *local, u8 page, u8 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();