diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-03-26 07:46:28 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-03-27 14:18:50 -0400 |
commit | 8bf9538a5de5f6496993fb294ef606e453232ea4 (patch) | |
tree | c361ba135c758728802369d9f147e004fbeaf441 | |
parent | fdf51784cd728e55daa0ca7b0ba16966afbfeae0 (diff) |
mac802154: cleanup concurrent check
This patch cleanups the checking of different mac phy depended values by
handling depended mac settings per hw support flag in one condition.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/mac802154/iface.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 6fb6bdf9868c..38b56f9d9386 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -174,24 +174,16 @@ ieee802154_check_mac_settings(struct ieee802154_local *local, | |||
174 | } | 174 | } |
175 | 175 | ||
176 | if (local->hw.flags & IEEE802154_HW_AFILT) { | 176 | if (local->hw.flags & IEEE802154_HW_AFILT) { |
177 | if (wpan_dev->pan_id != nwpan_dev->pan_id) | 177 | if (wpan_dev->pan_id != nwpan_dev->pan_id || |
178 | return -EBUSY; | 178 | wpan_dev->short_addr != nwpan_dev->short_addr || |
179 | 179 | wpan_dev->extended_addr != nwpan_dev->extended_addr) | |
180 | if (wpan_dev->short_addr != nwpan_dev->short_addr) | ||
181 | return -EBUSY; | ||
182 | |||
183 | if (wpan_dev->extended_addr != nwpan_dev->extended_addr) | ||
184 | return -EBUSY; | 180 | return -EBUSY; |
185 | } | 181 | } |
186 | 182 | ||
187 | if (local->hw.flags & IEEE802154_HW_CSMA_PARAMS) { | 183 | if (local->hw.flags & IEEE802154_HW_CSMA_PARAMS) { |
188 | if (wpan_dev->min_be != nwpan_dev->min_be) | 184 | if (wpan_dev->min_be != nwpan_dev->min_be || |
189 | return -EBUSY; | 185 | wpan_dev->max_be != nwpan_dev->max_be || |
190 | 186 | wpan_dev->csma_retries != nwpan_dev->csma_retries) | |
191 | if (wpan_dev->max_be != nwpan_dev->max_be) | ||
192 | return -EBUSY; | ||
193 | |||
194 | if (wpan_dev->csma_retries != nwpan_dev->csma_retries) | ||
195 | return -EBUSY; | 187 | return -EBUSY; |
196 | } | 188 | } |
197 | 189 | ||