diff options
author | alex.bluesman.smirnov@gmail.com <alex.bluesman.smirnov@gmail.com> | 2012-07-10 23:22:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-12 16:54:45 +0200 |
commit | e885a47a474fe53ed7d952af4b6e9a5cf86d9a07 (patch) | |
tree | dab8586ed69a4418c7325351f28494ea5242a132 /net/mac802154/mib.c | |
parent | drivers/ieee802154/at86rf230: rework irq handler (diff) | |
download | linux-e885a47a474fe53ed7d952af4b6e9a5cf86d9a07.tar.xz linux-e885a47a474fe53ed7d952af4b6e9a5cf86d9a07.zip |
mac802154: add get short address method
Add method to get the device short 802.15.4 address. This call
needed by ieee802154 layer to satisfy 'iz list' request from
the user space.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154/mib.c')
-rw-r--r-- | net/mac802154/mib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c index 380829d84600..5c66b8f73f02 100644 --- a/net/mac802154/mib.c +++ b/net/mac802154/mib.c @@ -100,6 +100,20 @@ void mac802154_dev_set_short_addr(struct net_device *dev, u16 val) } } +u16 mac802154_dev_get_short_addr(const struct net_device *dev) +{ + struct mac802154_sub_if_data *priv = netdev_priv(dev); + u16 ret; + + BUG_ON(dev->type != ARPHRD_IEEE802154); + + spin_lock_bh(&priv->mib_lock); + ret = priv->short_addr; + spin_unlock_bh(&priv->mib_lock); + + return ret; +} + void mac802154_dev_set_ieee_addr(struct net_device *dev) { struct mac802154_sub_if_data *priv = netdev_priv(dev); |