summaryrefslogtreecommitdiffstats
path: root/net/mac802154/ieee802154_dev.c
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-03-31 21:37:46 +0200
committerDavid S. Miller <davem@davemloft.net>2014-04-01 16:25:51 -0400
commite462ded699aa2cca04b68fbf203ea4675d4c44d4 (patch)
tree4c7b2f9d1e456acad01eb052f2dfa7d8533d92d8 /net/mac802154/ieee802154_dev.c
parent336908f6d73ca297bd46948eb5d04d2020a88606 (diff)
downloadblackbird-op-linux-e462ded699aa2cca04b68fbf203ea4675d4c44d4.tar.gz
blackbird-op-linux-e462ded699aa2cca04b68fbf203ea4675d4c44d4.zip
mac802154: make csma/cca parameters per-wpan
Commit 9b2777d6089bcd (ieee802154: add TX power control to wpan_phy) and following erroneously added CSMA and CCA parameters for 802.15.4 devices as PHY parameters, while they are actually MAC parameters and can differ for any two WPAN instances. Since it is now sensible to have multiple WPAN devices with differing CSMA/CCA parameters, make these parameters MAC parameters instead. Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154/ieee802154_dev.c')
-rw-r--r--net/mac802154/ieee802154_dev.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/net/mac802154/ieee802154_dev.c b/net/mac802154/ieee802154_dev.c
index e7aa76445fe1..2cf66d885e68 100644
--- a/net/mac802154/ieee802154_dev.c
+++ b/net/mac802154/ieee802154_dev.c
@@ -197,9 +197,6 @@ static int mac802154_set_txpower(struct wpan_phy *phy, int db)
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_txpower)
- return -ENOTSUPP;
-
return priv->ops->set_txpower(&priv->hw, db);
}
@@ -207,9 +204,6 @@ static int mac802154_set_lbt(struct wpan_phy *phy, bool on)
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_lbt)
- return -ENOTSUPP;
-
return priv->ops->set_lbt(&priv->hw, on);
}
@@ -217,9 +211,6 @@ static int mac802154_set_cca_mode(struct wpan_phy *phy, u8 mode)
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_cca_mode)
- return -ENOTSUPP;
-
return priv->ops->set_cca_mode(&priv->hw, mode);
}
@@ -227,9 +218,6 @@ static int mac802154_set_cca_ed_level(struct wpan_phy *phy, s32 level)
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_cca_ed_level)
- return -ENOTSUPP;
-
return priv->ops->set_cca_ed_level(&priv->hw, level);
}
@@ -238,9 +226,6 @@ static int mac802154_set_csma_params(struct wpan_phy *phy, u8 min_be,
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_csma_params)
- return -ENOTSUPP;
-
return priv->ops->set_csma_params(&priv->hw, min_be, max_be, retries);
}
@@ -248,9 +233,6 @@ static int mac802154_set_frame_retries(struct wpan_phy *phy, s8 retries)
{
struct mac802154_priv *priv = wpan_phy_priv(phy);
- if (!priv->ops->set_frame_retries)
- return -ENOTSUPP;
-
return priv->ops->set_frame_retries(&priv->hw, retries);
}
@@ -331,12 +313,18 @@ int ieee802154_register_device(struct ieee802154_dev *dev)
priv->phy->add_iface = mac802154_add_iface;
priv->phy->del_iface = mac802154_del_iface;
- priv->phy->set_txpower = mac802154_set_txpower;
- priv->phy->set_lbt = mac802154_set_lbt;
- priv->phy->set_cca_mode = mac802154_set_cca_mode;
- priv->phy->set_cca_ed_level = mac802154_set_cca_ed_level;
- priv->phy->set_csma_params = mac802154_set_csma_params;
- priv->phy->set_frame_retries = mac802154_set_frame_retries;
+ if (priv->ops->set_txpower)
+ priv->phy->set_txpower = mac802154_set_txpower;
+ if (priv->ops->set_lbt)
+ priv->phy->set_lbt = mac802154_set_lbt;
+ if (priv->ops->set_cca_mode)
+ priv->phy->set_cca_mode = mac802154_set_cca_mode;
+ if (priv->ops->set_cca_ed_level)
+ priv->phy->set_cca_ed_level = mac802154_set_cca_ed_level;
+ if (priv->ops->set_csma_params)
+ priv->phy->set_csma_params = mac802154_set_csma_params;
+ if (priv->ops->set_frame_retries)
+ priv->phy->set_frame_retries = mac802154_set_frame_retries;
rc = wpan_phy_register(priv->phy);
if (rc < 0)
OpenPOWER on IntegriCloud