summaryrefslogtreecommitdiff
path: root/net/mac802154/mac_cmd.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-09 08:36:46 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-11-09 19:50:28 +0100
commit5fb3f026ae15827fe32e34adafce0d0f63ad0366 (patch)
tree35b5e05e5ff8c2dd6fc72568645c66641aa8daa9 /net/mac802154/mac_cmd.c
parent863e88f255dac0657e57d5f1a1f95ee8733f8c13 (diff)
mac802154: remove mac_params in sdata
This patch removes the mac_params from subif data struct. Instead we manipulate the wpan attributes directly. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/mac_cmd.c')
-rw-r--r--net/mac802154/mac_cmd.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index 00b2b214770e..b8bd95263aab 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -72,10 +72,21 @@ static int mac802154_set_mac_params(struct net_device *dev,
{
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_local *local = sdata->local;
+ struct wpan_dev *wpan_dev = &sdata->wpan_dev;
int ret;
mutex_lock(&sdata->local->iflist_mtx);
- sdata->mac_params = *params;
+ /* PHY */
+ wpan_dev->wpan_phy->transmit_power = params->transmit_power;
+ wpan_dev->wpan_phy->cca_mode = params->cca_mode;
+ wpan_dev->wpan_phy->cca_ed_level = params->cca_ed_level;
+
+ /* MAC */
+ wpan_dev->min_be = params->min_be;
+ wpan_dev->max_be = params->max_be;
+ wpan_dev->csma_retries = params->csma_retries;
+ wpan_dev->frame_retries = params->frame_retries;
+ wpan_dev->lbt = params->lbt;
mutex_unlock(&sdata->local->iflist_mtx);
if (local->hw.flags & IEEE802154_HW_TXPOWER) {
@@ -103,9 +114,20 @@ static void mac802154_get_mac_params(struct net_device *dev,
struct ieee802154_mac_params *params)
{
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
+ struct wpan_dev *wpan_dev = &sdata->wpan_dev;
mutex_lock(&sdata->local->iflist_mtx);
- *params = sdata->mac_params;
+ /* PHY */
+ params->transmit_power = wpan_dev->wpan_phy->transmit_power;
+ params->cca_mode = wpan_dev->wpan_phy->cca_mode;
+ params->cca_ed_level = wpan_dev->wpan_phy->cca_ed_level;
+
+ /* MAC */
+ params->min_be = wpan_dev->min_be;
+ params->max_be = wpan_dev->max_be;
+ params->csma_retries = wpan_dev->csma_retries;
+ params->frame_retries = wpan_dev->frame_retries;
+ params->lbt = wpan_dev->lbt;
mutex_unlock(&sdata->local->iflist_mtx);
}