diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-05 14:51:18 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-05 15:53:04 -0500 |
commit | bd28a11f25f2c2a563620e7be588dc4dd8a91396 (patch) | |
tree | 52d9a31150389f22e98774d3b26cec1fe7517608 /net/ieee802154 | |
parent | d5ae67bacd9654b0e26b9f248249e9ee1b6e338b (diff) |
ieee802154: remove mlme get_phy callback
This patch removes the get_phy callback from mlme ops structure. Instead
we doing a dereference via ieee802154_ptr dev pointer. For backwards
compatibility we need to run get_device after dereference wpan_phy via
ieee802154_ptr.
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/6lowpan_rtnl.c | 8 | ||||
-rw-r--r-- | net/ieee802154/nl-mac.c | 6 | ||||
-rw-r--r-- | net/ieee802154/nl-phy.c | 3 |
3 files changed, 6 insertions, 11 deletions
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index 659f7b25ea1a..a96b64c9a73d 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c | |||
@@ -407,13 +407,6 @@ static netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev) | |||
407 | } | 407 | } |
408 | } | 408 | } |
409 | 409 | ||
410 | static struct wpan_phy *lowpan_get_phy(const struct net_device *dev) | ||
411 | { | ||
412 | struct net_device *real_dev = lowpan_dev_info(dev)->real_dev; | ||
413 | |||
414 | return ieee802154_mlme_ops(real_dev)->get_phy(real_dev); | ||
415 | } | ||
416 | |||
417 | static __le16 lowpan_get_pan_id(const struct net_device *dev) | 410 | static __le16 lowpan_get_pan_id(const struct net_device *dev) |
418 | { | 411 | { |
419 | struct net_device *real_dev = lowpan_dev_info(dev)->real_dev; | 412 | struct net_device *real_dev = lowpan_dev_info(dev)->real_dev; |
@@ -465,7 +458,6 @@ static const struct net_device_ops lowpan_netdev_ops = { | |||
465 | 458 | ||
466 | static struct ieee802154_mlme_ops lowpan_mlme = { | 459 | static struct ieee802154_mlme_ops lowpan_mlme = { |
467 | .get_pan_id = lowpan_get_pan_id, | 460 | .get_pan_id = lowpan_get_pan_id, |
468 | .get_phy = lowpan_get_phy, | ||
469 | .get_short_addr = lowpan_get_short_addr, | 461 | .get_short_addr = lowpan_get_short_addr, |
470 | .get_dsn = lowpan_get_dsn, | 462 | .get_dsn = lowpan_get_dsn, |
471 | }; | 463 | }; |
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index 91a1855e521c..7127b9d1a684 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c | |||
@@ -94,8 +94,9 @@ static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 portid, | |||
94 | goto out; | 94 | goto out; |
95 | 95 | ||
96 | ops = ieee802154_mlme_ops(dev); | 96 | ops = ieee802154_mlme_ops(dev); |
97 | phy = ops->get_phy(dev); | 97 | phy = dev->ieee802154_ptr->wpan_phy; |
98 | BUG_ON(!phy); | 98 | BUG_ON(!phy); |
99 | get_device(&phy->dev); | ||
99 | 100 | ||
100 | short_addr = ops->get_short_addr(dev); | 101 | short_addr = ops->get_short_addr(dev); |
101 | pan_id = ops->get_pan_id(dev); | 102 | pan_id = ops->get_pan_id(dev); |
@@ -493,7 +494,8 @@ int ieee802154_set_macparams(struct sk_buff *skb, struct genl_info *info) | |||
493 | !info->attrs[IEEE802154_ATTR_FRAME_RETRIES]) | 494 | !info->attrs[IEEE802154_ATTR_FRAME_RETRIES]) |
494 | goto out; | 495 | goto out; |
495 | 496 | ||
496 | phy = ops->get_phy(dev); | 497 | phy = dev->ieee802154_ptr->wpan_phy; |
498 | get_device(&phy->dev); | ||
497 | 499 | ||
498 | ops->get_mac_params(dev, ¶ms); | 500 | ops->get_mac_params(dev, ¶ms); |
499 | 501 | ||
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index 397ca126d9a2..80a946dddd90 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c | |||
@@ -287,8 +287,9 @@ int ieee802154_del_iface(struct sk_buff *skb, struct genl_info *info) | |||
287 | if (!dev) | 287 | if (!dev) |
288 | return -ENODEV; | 288 | return -ENODEV; |
289 | 289 | ||
290 | phy = ieee802154_mlme_ops(dev)->get_phy(dev); | 290 | phy = dev->ieee802154_ptr->wpan_phy; |
291 | BUG_ON(!phy); | 291 | BUG_ON(!phy); |
292 | get_device(&phy->dev); | ||
292 | 293 | ||
293 | rc = -EINVAL; | 294 | rc = -EINVAL; |
294 | /* phy name is optional, but should be checked if it's given */ | 295 | /* phy name is optional, but should be checked if it's given */ |