aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-12-10 09:33:12 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-12-18 18:19:23 -0500
commit7fe9a3882bb37195c41ab125a0f2852398d2646a (patch)
tree2575090079228f59a93466eaf2d1b69524b97e8a /net/mac802154
parentb40d6376ff470572e2fafb20ca06a68f2d7940cb (diff)
ieee802154: rework cca setting
The current cca setting handle is a driver specific call. We need to introduce some 802.15.4 specific layer and mapping 802.15.4 cca modes to driver specific ones inside the 802.15.4 driver. This patch will add such 802.15.4 layer and mapping the cca settings to driver specific ones. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/driver-ops.h5
-rw-r--r--net/mac802154/mac_cmd.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/net/mac802154/driver-ops.h b/net/mac802154/driver-ops.h
index f21e864613d0..98180a9fff4a 100644
--- a/net/mac802154/driver-ops.h
+++ b/net/mac802154/driver-ops.h
@@ -70,7 +70,8 @@ static inline int drv_set_tx_power(struct ieee802154_local *local, s8 dbm)
70 return local->ops->set_txpower(&local->hw, dbm); 70 return local->ops->set_txpower(&local->hw, dbm);
71} 71}
72 72
73static inline int drv_set_cca_mode(struct ieee802154_local *local, u8 cca_mode) 73static inline int drv_set_cca_mode(struct ieee802154_local *local,
74 const struct wpan_phy_cca *cca)
74{ 75{
75 might_sleep(); 76 might_sleep();
76 77
@@ -79,7 +80,7 @@ static inline int drv_set_cca_mode(struct ieee802154_local *local, u8 cca_mode)
79 return -EOPNOTSUPP; 80 return -EOPNOTSUPP;
80 } 81 }
81 82
82 return local->ops->set_cca_mode(&local->hw, cca_mode); 83 return local->ops->set_cca_mode(&local->hw, cca);
83} 84}
84 85
85static inline int drv_set_lbt_mode(struct ieee802154_local *local, bool mode) 86static inline int drv_set_lbt_mode(struct ieee802154_local *local, bool mode)
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index 6aacb1816889..bdccb4ecd30f 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -81,7 +81,7 @@ static int mac802154_set_mac_params(struct net_device *dev,
81 81
82 /* PHY */ 82 /* PHY */
83 wpan_dev->wpan_phy->transmit_power = params->transmit_power; 83 wpan_dev->wpan_phy->transmit_power = params->transmit_power;
84 wpan_dev->wpan_phy->cca_mode = params->cca_mode; 84 wpan_dev->wpan_phy->cca = params->cca;
85 wpan_dev->wpan_phy->cca_ed_level = params->cca_ed_level; 85 wpan_dev->wpan_phy->cca_ed_level = params->cca_ed_level;
86 86
87 /* MAC */ 87 /* MAC */
@@ -98,7 +98,7 @@ static int mac802154_set_mac_params(struct net_device *dev,
98 } 98 }
99 99
100 if (local->hw.flags & IEEE802154_HW_CCA_MODE) { 100 if (local->hw.flags & IEEE802154_HW_CCA_MODE) {
101 ret = drv_set_cca_mode(local, params->cca_mode); 101 ret = drv_set_cca_mode(local, &params->cca);
102 if (ret < 0) 102 if (ret < 0)
103 return ret; 103 return ret;
104 } 104 }
@@ -122,7 +122,7 @@ static void mac802154_get_mac_params(struct net_device *dev,
122 122
123 /* PHY */ 123 /* PHY */
124 params->transmit_power = wpan_dev->wpan_phy->transmit_power; 124 params->transmit_power = wpan_dev->wpan_phy->transmit_power;
125 params->cca_mode = wpan_dev->wpan_phy->cca_mode; 125 params->cca = wpan_dev->wpan_phy->cca;
126 params->cca_ed_level = wpan_dev->wpan_phy->cca_ed_level; 126 params->cca_ed_level = wpan_dev->wpan_phy->cca_ed_level;
127 127
128 /* MAC */ 128 /* MAC */