aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/6lowpan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154/6lowpan.c')
-rw-r--r--net/ieee802154/6lowpan.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 368515885368..f6b169439b5b 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1044,6 +1044,24 @@ static void lowpan_dev_free(struct net_device *dev)
1044 free_netdev(dev); 1044 free_netdev(dev);
1045} 1045}
1046 1046
1047static struct wpan_phy *lowpan_get_phy(const struct net_device *dev)
1048{
1049 struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1050 return ieee802154_mlme_ops(real_dev)->get_phy(real_dev);
1051}
1052
1053static u16 lowpan_get_pan_id(const struct net_device *dev)
1054{
1055 struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1056 return ieee802154_mlme_ops(real_dev)->get_pan_id(real_dev);
1057}
1058
1059static u16 lowpan_get_short_addr(const struct net_device *dev)
1060{
1061 struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1062 return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
1063}
1064
1047static struct header_ops lowpan_header_ops = { 1065static struct header_ops lowpan_header_ops = {
1048 .create = lowpan_header_create, 1066 .create = lowpan_header_create,
1049}; 1067};
@@ -1053,6 +1071,12 @@ static const struct net_device_ops lowpan_netdev_ops = {
1053 .ndo_set_mac_address = eth_mac_addr, 1071 .ndo_set_mac_address = eth_mac_addr,
1054}; 1072};
1055 1073
1074static struct ieee802154_mlme_ops lowpan_mlme = {
1075 .get_pan_id = lowpan_get_pan_id,
1076 .get_phy = lowpan_get_phy,
1077 .get_short_addr = lowpan_get_short_addr,
1078};
1079
1056static void lowpan_setup(struct net_device *dev) 1080static void lowpan_setup(struct net_device *dev)
1057{ 1081{
1058 pr_debug("(%s)\n", __func__); 1082 pr_debug("(%s)\n", __func__);
@@ -1070,6 +1094,7 @@ static void lowpan_setup(struct net_device *dev)
1070 1094
1071 dev->netdev_ops = &lowpan_netdev_ops; 1095 dev->netdev_ops = &lowpan_netdev_ops;
1072 dev->header_ops = &lowpan_header_ops; 1096 dev->header_ops = &lowpan_header_ops;
1097 dev->ml_priv = &lowpan_mlme;
1073 dev->destructor = lowpan_dev_free; 1098 dev->destructor = lowpan_dev_free;
1074} 1099}
1075 1100