diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-17 02:20:49 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-17 03:49:15 -0500 |
commit | 944742a36d784c2a36a141ac10ba5168b0313cec (patch) | |
tree | 7a3ef544cfccf772c3e9c24ee9c7d2f4d5f9bb97 /net/mac802154 | |
parent | cd11d935f2df86b6a619e8721553b1d41633f0fd (diff) |
mac802154: use new nl802154 iftype types
This patch replace the depracted IEEE802154_DEV to the new introduced
NL802154_IFTYPE_NODE types. There is a backwards compatibility to have
the identical types for both enum definitions. Also remove some inlcude
issue with "linux/nl802154.h", because the export nl_policy inside this
header it was always necessary to have an include of "net/rtnetlink.h"
before. The reason for this is more complicated. Nevertheless we removed
this now, because "linux/nl802154.h" is the depracted netlink interface.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/ieee802154_i.h | 3 | ||||
-rw-r--r-- | net/mac802154/iface.c | 18 | ||||
-rw-r--r-- | net/mac802154/main.c | 4 | ||||
-rw-r--r-- | net/mac802154/rx.c | 7 |
4 files changed, 16 insertions, 16 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index 593339ad590b..6ad5e8912a4c 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/hrtimer.h> | 23 | #include <linux/hrtimer.h> |
24 | #include <net/cfg802154.h> | 24 | #include <net/cfg802154.h> |
25 | #include <net/mac802154.h> | 25 | #include <net/mac802154.h> |
26 | #include <net/nl802154.h> | ||
26 | #include <net/ieee802154_netdev.h> | 27 | #include <net/ieee802154_netdev.h> |
27 | 28 | ||
28 | #include "llsec.h" | 29 | #include "llsec.h" |
@@ -175,7 +176,7 @@ void ieee802154_iface_exit(void); | |||
175 | void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata); | 176 | void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata); |
176 | struct net_device * | 177 | struct net_device * |
177 | ieee802154_if_add(struct ieee802154_local *local, const char *name, | 178 | ieee802154_if_add(struct ieee802154_local *local, const char *name, |
178 | struct wpan_dev **new_wpan_dev, int type); | 179 | struct wpan_dev **new_wpan_dev, enum nl802154_iftype type); |
179 | void ieee802154_remove_interfaces(struct ieee802154_local *local); | 180 | void ieee802154_remove_interfaces(struct ieee802154_local *local); |
180 | 181 | ||
181 | #endif /* __IEEE802154_I_H */ | 182 | #endif /* __IEEE802154_I_H */ |
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index feb064715d1f..cc992e8405d3 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -22,8 +22,7 @@ | |||
22 | #include <linux/if_arp.h> | 22 | #include <linux/if_arp.h> |
23 | #include <linux/ieee802154.h> | 23 | #include <linux/ieee802154.h> |
24 | 24 | ||
25 | #include <net/rtnetlink.h> | 25 | #include <net/nl802154.h> |
26 | #include <linux/nl802154.h> | ||
27 | #include <net/mac802154.h> | 26 | #include <net/mac802154.h> |
28 | #include <net/ieee802154_netdev.h> | 27 | #include <net/ieee802154_netdev.h> |
29 | #include <net/cfg802154.h> | 28 | #include <net/cfg802154.h> |
@@ -144,7 +143,7 @@ static int mac802154_slave_open(struct net_device *dev) | |||
144 | 143 | ||
145 | ASSERT_RTNL(); | 144 | ASSERT_RTNL(); |
146 | 145 | ||
147 | if (sdata->vif.type == IEEE802154_DEV_WPAN) { | 146 | if (sdata->vif.type == NL802154_IFTYPE_NODE) { |
148 | mutex_lock(&sdata->local->iflist_mtx); | 147 | mutex_lock(&sdata->local->iflist_mtx); |
149 | list_for_each_entry(subif, &sdata->local->interfaces, list) { | 148 | list_for_each_entry(subif, &sdata->local->interfaces, list) { |
150 | if (subif != sdata && | 149 | if (subif != sdata && |
@@ -407,7 +406,8 @@ static void ieee802154_if_setup(struct net_device *dev) | |||
407 | } | 406 | } |
408 | 407 | ||
409 | static int | 408 | static int |
410 | ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type) | 409 | ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, |
410 | enum nl802154_iftype type) | ||
411 | { | 411 | { |
412 | struct wpan_dev *wpan_dev = &sdata->wpan_dev; | 412 | struct wpan_dev *wpan_dev = &sdata->wpan_dev; |
413 | 413 | ||
@@ -429,7 +429,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type) | |||
429 | wpan_dev->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST); | 429 | wpan_dev->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST); |
430 | 430 | ||
431 | switch (type) { | 431 | switch (type) { |
432 | case IEEE802154_DEV_WPAN: | 432 | case NL802154_IFTYPE_NODE: |
433 | ieee802154_be64_to_le64(&wpan_dev->extended_addr, | 433 | ieee802154_be64_to_le64(&wpan_dev->extended_addr, |
434 | sdata->dev->dev_addr); | 434 | sdata->dev->dev_addr); |
435 | 435 | ||
@@ -444,7 +444,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type) | |||
444 | 444 | ||
445 | mac802154_llsec_init(&sdata->sec); | 445 | mac802154_llsec_init(&sdata->sec); |
446 | break; | 446 | break; |
447 | case IEEE802154_DEV_MONITOR: | 447 | case NL802154_IFTYPE_MONITOR: |
448 | sdata->dev->destructor = free_netdev; | 448 | sdata->dev->destructor = free_netdev; |
449 | sdata->dev->netdev_ops = &mac802154_monitor_ops; | 449 | sdata->dev->netdev_ops = &mac802154_monitor_ops; |
450 | wpan_dev->promiscuous_mode = true; | 450 | wpan_dev->promiscuous_mode = true; |
@@ -458,7 +458,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type) | |||
458 | 458 | ||
459 | struct net_device * | 459 | struct net_device * |
460 | ieee802154_if_add(struct ieee802154_local *local, const char *name, | 460 | ieee802154_if_add(struct ieee802154_local *local, const char *name, |
461 | struct wpan_dev **new_wpan_dev, int type) | 461 | struct wpan_dev **new_wpan_dev, enum nl802154_iftype type) |
462 | { | 462 | { |
463 | struct net_device *ndev = NULL; | 463 | struct net_device *ndev = NULL; |
464 | struct ieee802154_sub_if_data *sdata = NULL; | 464 | struct ieee802154_sub_if_data *sdata = NULL; |
@@ -478,10 +478,10 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name, | |||
478 | goto err; | 478 | goto err; |
479 | 479 | ||
480 | switch (type) { | 480 | switch (type) { |
481 | case IEEE802154_DEV_WPAN: | 481 | case NL802154_IFTYPE_NODE: |
482 | ndev->type = ARPHRD_IEEE802154; | 482 | ndev->type = ARPHRD_IEEE802154; |
483 | break; | 483 | break; |
484 | case IEEE802154_DEV_MONITOR: | 484 | case NL802154_IFTYPE_MONITOR: |
485 | ndev->type = ARPHRD_IEEE802154_MONITOR; | 485 | ndev->type = ARPHRD_IEEE802154_MONITOR; |
486 | break; | 486 | break; |
487 | default: | 487 | default: |
diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 5199f2115ee9..2e42fc2e430c 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
20 | 20 | ||
21 | #include <net/netlink.h> | 21 | #include <net/netlink.h> |
22 | #include <linux/nl802154.h> | 22 | #include <net/nl802154.h> |
23 | #include <net/mac802154.h> | 23 | #include <net/mac802154.h> |
24 | #include <net/ieee802154_netdev.h> | 24 | #include <net/ieee802154_netdev.h> |
25 | #include <net/route.h> | 25 | #include <net/route.h> |
@@ -161,7 +161,7 @@ int ieee802154_register_hw(struct ieee802154_hw *hw) | |||
161 | 161 | ||
162 | rtnl_lock(); | 162 | rtnl_lock(); |
163 | 163 | ||
164 | dev = ieee802154_if_add(local, "wpan%d", NULL, IEEE802154_DEV_WPAN); | 164 | dev = ieee802154_if_add(local, "wpan%d", NULL, NL802154_IFTYPE_NODE); |
165 | if (IS_ERR(dev)) { | 165 | if (IS_ERR(dev)) { |
166 | rtnl_unlock(); | 166 | rtnl_unlock(); |
167 | rc = PTR_ERR(dev); | 167 | rc = PTR_ERR(dev); |
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index b18e755c38ce..041dbd5958d4 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c | |||
@@ -25,8 +25,7 @@ | |||
25 | 25 | ||
26 | #include <net/mac802154.h> | 26 | #include <net/mac802154.h> |
27 | #include <net/ieee802154_netdev.h> | 27 | #include <net/ieee802154_netdev.h> |
28 | #include <net/rtnetlink.h> | 28 | #include <net/nl802154.h> |
29 | #include <linux/nl802154.h> | ||
30 | 29 | ||
31 | #include "ieee802154_i.h" | 30 | #include "ieee802154_i.h" |
32 | 31 | ||
@@ -209,7 +208,7 @@ __ieee802154_rx_handle_packet(struct ieee802154_local *local, | |||
209 | } | 208 | } |
210 | 209 | ||
211 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 210 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
212 | if (sdata->vif.type != IEEE802154_DEV_WPAN || | 211 | if (sdata->vif.type != NL802154_IFTYPE_NODE || |
213 | !netif_running(sdata->dev)) | 212 | !netif_running(sdata->dev)) |
214 | continue; | 213 | continue; |
215 | 214 | ||
@@ -234,7 +233,7 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
234 | skb->protocol = htons(ETH_P_IEEE802154); | 233 | skb->protocol = htons(ETH_P_IEEE802154); |
235 | 234 | ||
236 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 235 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
237 | if (sdata->vif.type != IEEE802154_DEV_MONITOR) | 236 | if (sdata->vif.type != NL802154_IFTYPE_MONITOR) |
238 | continue; | 237 | continue; |
239 | 238 | ||
240 | if (!ieee802154_sdata_running(sdata)) | 239 | if (!ieee802154_sdata_running(sdata)) |