aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-01 23:18:39 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-11-01 23:51:07 -0400
commit8f499f991c275d5251a427c424360a9c60f549e4 (patch)
tree282c2ff59de8abac43ee226a3726736cc7f516ef /net/ieee802154
parent4a9a816a4f8c79260446811bdf80615b36539949 (diff)
ieee802154: don't allow to change addr while netif_running
This patch changes the actual behaviour for setting address attributes. We should not change addresses while netif_running is true. Furthermore when netif_running is running the address attributes becomes read only and we can remove locking mechanism in receive and transmit hothpaths of 802.15.4 subsystem. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl-mac.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index abd0f31bdc66..cc2919dbe5e0 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -477,7 +477,7 @@ int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info)
477 u8 channel, bcn_ord, sf_ord; 477 u8 channel, bcn_ord, sf_ord;
478 u8 page; 478 u8 page;
479 int pan_coord, blx, coord_realign; 479 int pan_coord, blx, coord_realign;
480 int ret = -EOPNOTSUPP; 480 int ret = -EBUSY;
481 481
482 if (!info->attrs[IEEE802154_ATTR_COORD_PAN_ID] || 482 if (!info->attrs[IEEE802154_ATTR_COORD_PAN_ID] ||
483 !info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR] || 483 !info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR] ||
@@ -493,9 +493,15 @@ int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info)
493 dev = ieee802154_nl_get_dev(info); 493 dev = ieee802154_nl_get_dev(info);
494 if (!dev) 494 if (!dev)
495 return -ENODEV; 495 return -ENODEV;
496 if (!ieee802154_mlme_ops(dev)->start_req) 496
497 if (netif_running(dev))
497 goto out; 498 goto out;
498 499
500 if (!ieee802154_mlme_ops(dev)->start_req) {
501 ret = -EOPNOTSUPP;
502 goto out;
503 }
504
499 addr.mode = IEEE802154_ADDR_SHORT; 505 addr.mode = IEEE802154_ADDR_SHORT;
500 addr.short_addr = nla_get_shortaddr( 506 addr.short_addr = nla_get_shortaddr(
501 info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR]); 507 info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR]);