#include <linux/hrtimer.h>
#include <net/cfg802154.h>
#include <net/mac802154.h>
+#include <net/nl802154.h>
#include <net/ieee802154_netdev.h>
#include "llsec.h"
void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata);
struct net_device *
ieee802154_if_add(struct ieee802154_local *local, const char *name,
- struct wpan_dev **new_wpan_dev, int type);
+ struct wpan_dev **new_wpan_dev, enum nl802154_iftype type);
void ieee802154_remove_interfaces(struct ieee802154_local *local);
#endif /* __IEEE802154_I_H */
#include <linux/if_arp.h>
#include <linux/ieee802154.h>
-#include <net/rtnetlink.h>
-#include <linux/nl802154.h>
+#include <net/nl802154.h>
#include <net/mac802154.h>
#include <net/ieee802154_netdev.h>
#include <net/cfg802154.h>
ASSERT_RTNL();
- if (sdata->vif.type == IEEE802154_DEV_WPAN) {
+ if (sdata->vif.type == NL802154_IFTYPE_NODE) {
mutex_lock(&sdata->local->iflist_mtx);
list_for_each_entry(subif, &sdata->local->interfaces, list) {
if (subif != sdata &&
}
static int
-ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type)
+ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
+ enum nl802154_iftype type)
{
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
wpan_dev->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
switch (type) {
- case IEEE802154_DEV_WPAN:
+ case NL802154_IFTYPE_NODE:
ieee802154_be64_to_le64(&wpan_dev->extended_addr,
sdata->dev->dev_addr);
mac802154_llsec_init(&sdata->sec);
break;
- case IEEE802154_DEV_MONITOR:
+ case NL802154_IFTYPE_MONITOR:
sdata->dev->destructor = free_netdev;
sdata->dev->netdev_ops = &mac802154_monitor_ops;
wpan_dev->promiscuous_mode = true;
struct net_device *
ieee802154_if_add(struct ieee802154_local *local, const char *name,
- struct wpan_dev **new_wpan_dev, int type)
+ struct wpan_dev **new_wpan_dev, enum nl802154_iftype type)
{
struct net_device *ndev = NULL;
struct ieee802154_sub_if_data *sdata = NULL;
goto err;
switch (type) {
- case IEEE802154_DEV_WPAN:
+ case NL802154_IFTYPE_NODE:
ndev->type = ARPHRD_IEEE802154;
break;
- case IEEE802154_DEV_MONITOR:
+ case NL802154_IFTYPE_MONITOR:
ndev->type = ARPHRD_IEEE802154_MONITOR;
break;
default:
#include <linux/netdevice.h>
#include <net/netlink.h>
-#include <linux/nl802154.h>
+#include <net/nl802154.h>
#include <net/mac802154.h>
#include <net/ieee802154_netdev.h>
#include <net/route.h>
rtnl_lock();
- dev = ieee802154_if_add(local, "wpan%d", NULL, IEEE802154_DEV_WPAN);
+ dev = ieee802154_if_add(local, "wpan%d", NULL, NL802154_IFTYPE_NODE);
if (IS_ERR(dev)) {
rtnl_unlock();
rc = PTR_ERR(dev);
#include <net/mac802154.h>
#include <net/ieee802154_netdev.h>
-#include <net/rtnetlink.h>
-#include <linux/nl802154.h>
+#include <net/nl802154.h>
#include "ieee802154_i.h"
}
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
- if (sdata->vif.type != IEEE802154_DEV_WPAN ||
+ if (sdata->vif.type != NL802154_IFTYPE_NODE ||
!netif_running(sdata->dev))
continue;
skb->protocol = htons(ETH_P_IEEE802154);
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
- if (sdata->vif.type != IEEE802154_DEV_MONITOR)
+ if (sdata->vif.type != NL802154_IFTYPE_MONITOR)
continue;
if (!ieee802154_sdata_running(sdata))