summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-09-19 19:18:26 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-10-07 15:46:02 +0200
commitba6ea0bfe07544e7f5df887a2d45700e3c582478 (patch)
tree41797ba008e16d2f77af75e76abe29d6730957b4
parent9d32854621bddfd990a3ad6991ce4c5dfa9b3675 (diff)
devices/wpan: set channel on activation
-rw-r--r--src/devices/nm-device-wpan.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/nm-device-wpan.c b/src/devices/nm-device-wpan.c
index 0fc48f030..35352df12 100644
--- a/src/devices/nm-device-wpan.c
+++ b/src/devices/nm-device-wpan.c
@@ -123,6 +123,7 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
NMPlatform *platform;
guint16 pan_id;
guint16 short_address;
+ gint16 page, channel;
int ifindex;
const guint8 *hwaddr;
gsize hwaddr_len = 0;
@@ -182,6 +183,15 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
}
}
+ channel = nm_setting_wpan_get_channel (s_wpan);
+ if (channel != NM_SETTING_WPAN_CHANNEL_DEFAULT) {
+ page = nm_setting_wpan_get_page (s_wpan);
+ if (!nm_platform_wpan_set_channel (platform, ifindex, page, channel)) {
+ _LOGW (LOGD_DEVICE, "unable to set the channel");
+ goto out;
+ }
+ }
+
ret = NM_ACT_STAGE_RETURN_SUCCESS;
out:
nm_device_bring_up (device, TRUE, NULL);