2 * Copyright 2007-2012 Siemens AG
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
15 * Sergey Lapin <slapin@ossfans.org>
16 * Maxim Gorbachyov <maxim.gorbachev@siemens.com>
17 * Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
20 #include <linux/netdevice.h>
21 #include <linux/module.h>
22 #include <linux/if_arp.h>
23 #include <linux/ieee802154.h>
25 #include <net/nl802154.h>
26 #include <net/mac802154.h>
27 #include <net/ieee802154_netdev.h>
28 #include <net/cfg802154.h>
30 #include "ieee802154_i.h"
31 #include "driver-ops.h"
33 int mac802154_wpan_update_llsec(struct net_device
*dev
)
35 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
36 struct ieee802154_mlme_ops
*ops
= ieee802154_mlme_ops(dev
);
37 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
41 struct ieee802154_llsec_params params
;
44 params
.pan_id
= wpan_dev
->pan_id
;
45 changed
|= IEEE802154_LLSEC_PARAM_PAN_ID
;
47 params
.hwaddr
= wpan_dev
->extended_addr
;
48 changed
|= IEEE802154_LLSEC_PARAM_HWADDR
;
50 rc
= ops
->llsec
->set_params(dev
, ¶ms
, changed
);
57 mac802154_wpan_ioctl(struct net_device
*dev
, struct ifreq
*ifr
, int cmd
)
59 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
60 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
61 struct sockaddr_ieee802154
*sa
=
62 (struct sockaddr_ieee802154
*)&ifr
->ifr_addr
;
63 int err
= -ENOIOCTLCMD
;
65 if (cmd
!= SIOCGIFADDR
&& cmd
!= SIOCSIFADDR
)
73 u16 pan_id
, short_addr
;
75 pan_id
= le16_to_cpu(wpan_dev
->pan_id
);
76 short_addr
= le16_to_cpu(wpan_dev
->short_addr
);
77 if (pan_id
== IEEE802154_PANID_BROADCAST
||
78 short_addr
== IEEE802154_ADDR_BROADCAST
) {
83 sa
->family
= AF_IEEE802154
;
84 sa
->addr
.addr_type
= IEEE802154_ADDR_SHORT
;
85 sa
->addr
.pan_id
= pan_id
;
86 sa
->addr
.short_addr
= short_addr
;
92 if (netif_running(dev
)) {
98 "Using DEBUGing ioctl SIOCSIFADDR isn't recommended!\n");
99 if (sa
->family
!= AF_IEEE802154
||
100 sa
->addr
.addr_type
!= IEEE802154_ADDR_SHORT
||
101 sa
->addr
.pan_id
== IEEE802154_PANID_BROADCAST
||
102 sa
->addr
.short_addr
== IEEE802154_ADDR_BROADCAST
||
103 sa
->addr
.short_addr
== IEEE802154_ADDR_UNDEF
) {
108 wpan_dev
->pan_id
= cpu_to_le16(sa
->addr
.pan_id
);
109 wpan_dev
->short_addr
= cpu_to_le16(sa
->addr
.short_addr
);
111 err
= mac802154_wpan_update_llsec(dev
);
119 static int mac802154_wpan_mac_addr(struct net_device
*dev
, void *p
)
121 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
122 struct sockaddr
*addr
= p
;
123 __le64 extended_addr
;
125 if (netif_running(dev
))
128 /* lowpan need to be down for update
129 * SLAAC address after ifup
131 if (sdata
->wpan_dev
.lowpan_dev
) {
132 if (netif_running(sdata
->wpan_dev
.lowpan_dev
))
136 ieee802154_be64_to_le64(&extended_addr
, addr
->sa_data
);
137 if (!ieee802154_is_valid_extended_unicast_addr(extended_addr
))
140 memcpy(dev
->dev_addr
, addr
->sa_data
, dev
->addr_len
);
141 sdata
->wpan_dev
.extended_addr
= extended_addr
;
143 /* update lowpan interface mac address when
144 * wpan mac has been changed
146 if (sdata
->wpan_dev
.lowpan_dev
)
147 memcpy(sdata
->wpan_dev
.lowpan_dev
->dev_addr
, dev
->dev_addr
,
150 return mac802154_wpan_update_llsec(dev
);
153 static int ieee802154_setup_hw(struct ieee802154_sub_if_data
*sdata
)
155 struct ieee802154_local
*local
= sdata
->local
;
156 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
159 if (local
->hw
.flags
& IEEE802154_HW_PROMISCUOUS
) {
160 ret
= drv_set_promiscuous_mode(local
,
161 wpan_dev
->promiscuous_mode
);
166 if (local
->hw
.flags
& IEEE802154_HW_AFILT
) {
167 ret
= drv_set_pan_id(local
, wpan_dev
->pan_id
);
171 ret
= drv_set_extended_addr(local
, wpan_dev
->extended_addr
);
175 ret
= drv_set_short_addr(local
, wpan_dev
->short_addr
);
180 if (local
->hw
.flags
& IEEE802154_HW_LBT
) {
181 ret
= drv_set_lbt_mode(local
, wpan_dev
->lbt
);
186 if (local
->hw
.flags
& IEEE802154_HW_CSMA_PARAMS
) {
187 ret
= drv_set_csma_params(local
, wpan_dev
->min_be
,
189 wpan_dev
->csma_retries
);
194 if (local
->hw
.flags
& IEEE802154_HW_FRAME_RETRIES
) {
195 ret
= drv_set_max_frame_retries(local
, wpan_dev
->frame_retries
);
203 static int mac802154_slave_open(struct net_device
*dev
)
205 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
206 struct ieee802154_local
*local
= sdata
->local
;
211 set_bit(SDATA_STATE_RUNNING
, &sdata
->state
);
213 if (!local
->open_count
) {
214 res
= ieee802154_setup_hw(sdata
);
218 res
= drv_start(local
);
224 netif_start_queue(dev
);
227 /* might already be clear but that doesn't matter */
228 clear_bit(SDATA_STATE_RUNNING
, &sdata
->state
);
234 ieee802154_check_mac_settings(struct ieee802154_local
*local
,
235 struct wpan_dev
*wpan_dev
,
236 struct wpan_dev
*nwpan_dev
)
240 if (local
->hw
.flags
& IEEE802154_HW_PROMISCUOUS
) {
241 if (wpan_dev
->promiscuous_mode
!= nwpan_dev
->promiscuous_mode
)
245 if (local
->hw
.flags
& IEEE802154_HW_AFILT
) {
246 if (wpan_dev
->pan_id
!= nwpan_dev
->pan_id
||
247 wpan_dev
->short_addr
!= nwpan_dev
->short_addr
||
248 wpan_dev
->extended_addr
!= nwpan_dev
->extended_addr
)
252 if (local
->hw
.flags
& IEEE802154_HW_CSMA_PARAMS
) {
253 if (wpan_dev
->min_be
!= nwpan_dev
->min_be
||
254 wpan_dev
->max_be
!= nwpan_dev
->max_be
||
255 wpan_dev
->csma_retries
!= nwpan_dev
->csma_retries
)
259 if (local
->hw
.flags
& IEEE802154_HW_FRAME_RETRIES
) {
260 if (wpan_dev
->frame_retries
!= nwpan_dev
->frame_retries
)
264 if (local
->hw
.flags
& IEEE802154_HW_LBT
) {
265 if (wpan_dev
->lbt
!= nwpan_dev
->lbt
)
273 ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data
*sdata
,
274 enum nl802154_iftype iftype
)
276 struct ieee802154_local
*local
= sdata
->local
;
277 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
278 struct ieee802154_sub_if_data
*nsdata
;
280 /* we hold the RTNL here so can safely walk the list */
281 list_for_each_entry(nsdata
, &local
->interfaces
, list
) {
282 if (nsdata
!= sdata
&& ieee802154_sdata_running(nsdata
)) {
285 /* TODO currently we don't support multiple node types
286 * we need to run skb_clone at rx path. Check if there
287 * exist really an use case if we need to support
288 * multiple node types at the same time.
290 if (wpan_dev
->iftype
== NL802154_IFTYPE_NODE
&&
291 nsdata
->wpan_dev
.iftype
== NL802154_IFTYPE_NODE
)
294 /* check all phy mac sublayer settings are the same.
295 * We have only one phy, different values makes trouble.
297 ret
= ieee802154_check_mac_settings(local
, wpan_dev
,
307 static int mac802154_wpan_open(struct net_device
*dev
)
310 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
311 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
313 rc
= ieee802154_check_concurrent_iface(sdata
, wpan_dev
->iftype
);
317 return mac802154_slave_open(dev
);
320 static int mac802154_slave_close(struct net_device
*dev
)
322 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
323 struct ieee802154_local
*local
= sdata
->local
;
327 netif_stop_queue(dev
);
330 clear_bit(SDATA_STATE_RUNNING
, &sdata
->state
);
332 if (!local
->open_count
)
333 ieee802154_stop_device(local
);
338 static int mac802154_set_header_security(struct ieee802154_sub_if_data
*sdata
,
339 struct ieee802154_hdr
*hdr
,
340 const struct ieee802154_mac_cb
*cb
)
342 struct ieee802154_llsec_params params
;
345 mac802154_llsec_get_params(&sdata
->sec
, ¶ms
);
347 if (!params
.enabled
&& cb
->secen_override
&& cb
->secen
)
349 if (!params
.enabled
||
350 (cb
->secen_override
&& !cb
->secen
) ||
353 if (cb
->seclevel_override
&& !cb
->seclevel
)
356 level
= cb
->seclevel_override
? cb
->seclevel
: params
.out_level
;
358 hdr
->fc
.security_enabled
= 1;
359 hdr
->sec
.level
= level
;
360 hdr
->sec
.key_id_mode
= params
.out_key
.mode
;
361 if (params
.out_key
.mode
== IEEE802154_SCF_KEY_SHORT_INDEX
)
362 hdr
->sec
.short_src
= params
.out_key
.short_source
;
363 else if (params
.out_key
.mode
== IEEE802154_SCF_KEY_HW_INDEX
)
364 hdr
->sec
.extended_src
= params
.out_key
.extended_source
;
365 hdr
->sec
.key_id
= params
.out_key
.id
;
370 static int ieee802154_header_create(struct sk_buff
*skb
,
371 struct net_device
*dev
,
372 const struct ieee802154_addr
*daddr
,
373 const struct ieee802154_addr
*saddr
,
376 struct ieee802154_hdr hdr
;
377 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
378 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
379 struct ieee802154_mac_cb
*cb
= mac_cb(skb
);
385 memset(&hdr
.fc
, 0, sizeof(hdr
.fc
));
386 hdr
.fc
.type
= cb
->type
;
387 hdr
.fc
.security_enabled
= cb
->secen
;
388 hdr
.fc
.ack_request
= cb
->ackreq
;
389 hdr
.seq
= atomic_inc_return(&dev
->ieee802154_ptr
->dsn
) & 0xFF;
391 if (mac802154_set_header_security(sdata
, &hdr
, cb
) < 0)
395 if (wpan_dev
->short_addr
== cpu_to_le16(IEEE802154_ADDR_BROADCAST
) ||
396 wpan_dev
->short_addr
== cpu_to_le16(IEEE802154_ADDR_UNDEF
) ||
397 wpan_dev
->pan_id
== cpu_to_le16(IEEE802154_PANID_BROADCAST
)) {
398 hdr
.source
.mode
= IEEE802154_ADDR_LONG
;
399 hdr
.source
.extended_addr
= wpan_dev
->extended_addr
;
401 hdr
.source
.mode
= IEEE802154_ADDR_SHORT
;
402 hdr
.source
.short_addr
= wpan_dev
->short_addr
;
405 hdr
.source
.pan_id
= wpan_dev
->pan_id
;
407 hdr
.source
= *(const struct ieee802154_addr
*)saddr
;
410 hdr
.dest
= *(const struct ieee802154_addr
*)daddr
;
412 hlen
= ieee802154_hdr_push(skb
, &hdr
);
416 skb_reset_mac_header(skb
);
419 if (len
> ieee802154_max_payload(&hdr
))
425 static const struct wpan_dev_header_ops ieee802154_header_ops
= {
426 .create
= ieee802154_header_create
,
429 /* This header create functionality assumes a 8 byte array for
430 * source and destination pointer at maximum. To adapt this for
431 * the 802.15.4 dataframe header we use extended address handling
432 * here only and intra pan connection. fc fields are mostly fallback
433 * handling. For provide dev_hard_header for dgram sockets.
435 static int mac802154_header_create(struct sk_buff
*skb
,
436 struct net_device
*dev
,
442 struct ieee802154_hdr hdr
;
443 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
444 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
445 struct ieee802154_mac_cb cb
= { };
451 memset(&hdr
.fc
, 0, sizeof(hdr
.fc
));
452 hdr
.fc
.type
= IEEE802154_FC_TYPE_DATA
;
453 hdr
.fc
.ack_request
= wpan_dev
->ackreq
;
454 hdr
.seq
= atomic_inc_return(&dev
->ieee802154_ptr
->dsn
) & 0xFF;
456 /* TODO currently a workaround to give zero cb block to set
457 * security parameters defaults according MIB.
459 if (mac802154_set_header_security(sdata
, &hdr
, &cb
) < 0)
462 hdr
.dest
.pan_id
= wpan_dev
->pan_id
;
463 hdr
.dest
.mode
= IEEE802154_ADDR_LONG
;
464 ieee802154_be64_to_le64(&hdr
.dest
.extended_addr
, daddr
);
466 hdr
.source
.pan_id
= hdr
.dest
.pan_id
;
467 hdr
.source
.mode
= IEEE802154_ADDR_LONG
;
470 hdr
.source
.extended_addr
= wpan_dev
->extended_addr
;
472 ieee802154_be64_to_le64(&hdr
.source
.extended_addr
, saddr
);
474 hlen
= ieee802154_hdr_push(skb
, &hdr
);
478 skb_reset_mac_header(skb
);
481 if (len
> ieee802154_max_payload(&hdr
))
488 mac802154_header_parse(const struct sk_buff
*skb
, unsigned char *haddr
)
490 struct ieee802154_hdr hdr
;
492 if (ieee802154_hdr_peek_addrs(skb
, &hdr
) < 0) {
493 pr_debug("malformed packet\n");
497 if (hdr
.source
.mode
== IEEE802154_ADDR_LONG
) {
498 ieee802154_le64_to_be64(haddr
, &hdr
.source
.extended_addr
);
499 return IEEE802154_EXTENDED_ADDR_LEN
;
505 static const struct header_ops mac802154_header_ops
= {
506 .create
= mac802154_header_create
,
507 .parse
= mac802154_header_parse
,
510 static const struct net_device_ops mac802154_wpan_ops
= {
511 .ndo_open
= mac802154_wpan_open
,
512 .ndo_stop
= mac802154_slave_close
,
513 .ndo_start_xmit
= ieee802154_subif_start_xmit
,
514 .ndo_do_ioctl
= mac802154_wpan_ioctl
,
515 .ndo_set_mac_address
= mac802154_wpan_mac_addr
,
518 static const struct net_device_ops mac802154_monitor_ops
= {
519 .ndo_open
= mac802154_wpan_open
,
520 .ndo_stop
= mac802154_slave_close
,
521 .ndo_start_xmit
= ieee802154_monitor_start_xmit
,
524 static void mac802154_wpan_free(struct net_device
*dev
)
526 struct ieee802154_sub_if_data
*sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
528 mac802154_llsec_destroy(&sdata
->sec
);
533 static void ieee802154_if_setup(struct net_device
*dev
)
535 dev
->addr_len
= IEEE802154_EXTENDED_ADDR_LEN
;
536 memset(dev
->broadcast
, 0xff, IEEE802154_EXTENDED_ADDR_LEN
);
538 /* Let hard_header_len set to IEEE802154_MIN_HEADER_LEN. AF_PACKET
539 * will not send frames without any payload, but ack frames
540 * has no payload, so substract one that we can send a 3 bytes
541 * frame. The xmit callback assumes at least a hard header where two
542 * bytes fc and sequence field are set.
544 dev
->hard_header_len
= IEEE802154_MIN_HEADER_LEN
- 1;
545 /* The auth_tag header is for security and places in private payload
546 * room of mac frame which stucks between payload and FCS field.
548 dev
->needed_tailroom
= IEEE802154_MAX_AUTH_TAG_LEN
+
550 /* The mtu size is the payload without mac header in this case.
551 * We have a dynamic length header with a minimum header length
552 * which is hard_header_len. In this case we let mtu to the size
553 * of maximum payload which is IEEE802154_MTU - IEEE802154_FCS_LEN -
554 * hard_header_len. The FCS which is set by hardware or ndo_start_xmit
555 * and the minimum mac header which can be evaluated inside driver
556 * layer. The rest of mac header will be part of payload if greater
557 * than hard_header_len.
559 dev
->mtu
= IEEE802154_MTU
- IEEE802154_FCS_LEN
-
560 dev
->hard_header_len
;
561 dev
->tx_queue_len
= 300;
562 dev
->flags
= IFF_NOARP
| IFF_BROADCAST
;
566 ieee802154_setup_sdata(struct ieee802154_sub_if_data
*sdata
,
567 enum nl802154_iftype type
)
569 struct wpan_dev
*wpan_dev
= &sdata
->wpan_dev
;
573 /* set some type-dependent values */
574 sdata
->wpan_dev
.iftype
= type
;
576 get_random_bytes(&tmp
, sizeof(tmp
));
577 atomic_set(&wpan_dev
->bsn
, tmp
);
578 get_random_bytes(&tmp
, sizeof(tmp
));
579 atomic_set(&wpan_dev
->dsn
, tmp
);
581 /* defaults per 802.15.4-2011 */
582 wpan_dev
->min_be
= 3;
583 wpan_dev
->max_be
= 5;
584 wpan_dev
->csma_retries
= 4;
585 wpan_dev
->frame_retries
= 3;
587 wpan_dev
->pan_id
= cpu_to_le16(IEEE802154_PANID_BROADCAST
);
588 wpan_dev
->short_addr
= cpu_to_le16(IEEE802154_ADDR_BROADCAST
);
591 case NL802154_IFTYPE_NODE
:
592 ieee802154_be64_to_le64(&wpan_dev
->extended_addr
,
593 sdata
->dev
->dev_addr
);
595 sdata
->dev
->header_ops
= &mac802154_header_ops
;
596 sdata
->dev
->destructor
= mac802154_wpan_free
;
597 sdata
->dev
->netdev_ops
= &mac802154_wpan_ops
;
598 sdata
->dev
->ml_priv
= &mac802154_mlme_wpan
;
599 wpan_dev
->promiscuous_mode
= false;
600 wpan_dev
->header_ops
= &ieee802154_header_ops
;
602 mutex_init(&sdata
->sec_mtx
);
604 mac802154_llsec_init(&sdata
->sec
);
605 ret
= mac802154_wpan_update_llsec(sdata
->dev
);
610 case NL802154_IFTYPE_MONITOR
:
611 sdata
->dev
->destructor
= free_netdev
;
612 sdata
->dev
->netdev_ops
= &mac802154_monitor_ops
;
613 wpan_dev
->promiscuous_mode
= true;
623 ieee802154_if_add(struct ieee802154_local
*local
, const char *name
,
624 unsigned char name_assign_type
, enum nl802154_iftype type
,
625 __le64 extended_addr
)
627 struct net_device
*ndev
= NULL
;
628 struct ieee802154_sub_if_data
*sdata
= NULL
;
633 ndev
= alloc_netdev(sizeof(*sdata
), name
,
634 name_assign_type
, ieee802154_if_setup
);
636 return ERR_PTR(-ENOMEM
);
638 ndev
->needed_headroom
= local
->hw
.extra_tx_headroom
+
639 IEEE802154_MAX_HEADER_LEN
;
641 ret
= dev_alloc_name(ndev
, ndev
->name
);
645 ieee802154_le64_to_be64(ndev
->perm_addr
,
646 &local
->hw
.phy
->perm_extended_addr
);
648 case NL802154_IFTYPE_NODE
:
649 ndev
->type
= ARPHRD_IEEE802154
;
650 if (ieee802154_is_valid_extended_unicast_addr(extended_addr
))
651 ieee802154_le64_to_be64(ndev
->dev_addr
, &extended_addr
);
653 memcpy(ndev
->dev_addr
, ndev
->perm_addr
,
654 IEEE802154_EXTENDED_ADDR_LEN
);
656 case NL802154_IFTYPE_MONITOR
:
657 ndev
->type
= ARPHRD_IEEE802154_MONITOR
;
664 /* TODO check this */
665 SET_NETDEV_DEV(ndev
, &local
->phy
->dev
);
666 sdata
= netdev_priv(ndev
);
667 ndev
->ieee802154_ptr
= &sdata
->wpan_dev
;
668 memcpy(sdata
->name
, ndev
->name
, IFNAMSIZ
);
670 sdata
->wpan_dev
.wpan_phy
= local
->hw
.phy
;
671 sdata
->local
= local
;
673 /* setup type-dependent data */
674 ret
= ieee802154_setup_sdata(sdata
, type
);
678 ret
= register_netdevice(ndev
);
682 mutex_lock(&local
->iflist_mtx
);
683 list_add_tail_rcu(&sdata
->list
, &local
->interfaces
);
684 mutex_unlock(&local
->iflist_mtx
);
693 void ieee802154_if_remove(struct ieee802154_sub_if_data
*sdata
)
697 mutex_lock(&sdata
->local
->iflist_mtx
);
698 list_del_rcu(&sdata
->list
);
699 mutex_unlock(&sdata
->local
->iflist_mtx
);
702 unregister_netdevice(sdata
->dev
);
705 void ieee802154_remove_interfaces(struct ieee802154_local
*local
)
707 struct ieee802154_sub_if_data
*sdata
, *tmp
;
709 mutex_lock(&local
->iflist_mtx
);
710 list_for_each_entry_safe(sdata
, tmp
, &local
->interfaces
, list
) {
711 list_del(&sdata
->list
);
713 unregister_netdevice(sdata
->dev
);
715 mutex_unlock(&local
->iflist_mtx
);
718 static int netdev_notify(struct notifier_block
*nb
,
719 unsigned long state
, void *ptr
)
721 struct net_device
*dev
= netdev_notifier_info_to_dev(ptr
);
722 struct ieee802154_sub_if_data
*sdata
;
724 if (state
!= NETDEV_CHANGENAME
)
727 if (!dev
->ieee802154_ptr
|| !dev
->ieee802154_ptr
->wpan_phy
)
730 if (dev
->ieee802154_ptr
->wpan_phy
->privid
!= mac802154_wpan_phy_privid
)
733 sdata
= IEEE802154_DEV_TO_SUB_IF(dev
);
734 memcpy(sdata
->name
, dev
->name
, IFNAMSIZ
);
739 static struct notifier_block mac802154_netdev_notifier
= {
740 .notifier_call
= netdev_notify
,
743 int ieee802154_iface_init(void)
745 return register_netdevice_notifier(&mac802154_netdev_notifier
);
748 void ieee802154_iface_exit(void)
750 unregister_netdevice_notifier(&mac802154_netdev_notifier
);