alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007-2012 Siemens AG |
| 3 | * |
| 4 | * Written by: |
| 5 | * Alexander Smirnov <alex.bluesman.smirnov@gmail.com> |
| 6 | * |
| 7 | * Based on the code from 'linux-zigbee.sourceforge.net' project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 |
| 11 | * as published by the Free Software Foundation. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/module.h> |
| 21 | #include <linux/netdevice.h> |
| 22 | |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 23 | #include <net/netlink.h> |
| 24 | #include <linux/nl802154.h> |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 25 | #include <net/mac802154.h> |
Phoebe Buckheister | b70ab2e | 2014-03-14 21:23:59 +0100 | [diff] [blame] | 26 | #include <net/ieee802154_netdev.h> |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 27 | #include <net/route.h> |
Alexander Aring | 5ad60d3 | 2014-10-25 09:41:02 +0200 | [diff] [blame] | 28 | #include <net/cfg802154.h> |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 29 | |
Alexander Aring | 0f1556b | 2014-10-25 09:41:00 +0200 | [diff] [blame] | 30 | #include "ieee802154_i.h" |
Alexander Aring | 1201cd2 | 2014-11-02 04:18:36 +0100 | [diff] [blame] | 31 | #include "cfg.h" |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 32 | |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 33 | static int |
| 34 | mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) |
| 35 | { |
Alexander Aring | 59d19cd | 2014-10-25 17:16:40 +0200 | [diff] [blame] | 36 | struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 37 | struct ieee802154_local *local; |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 38 | int err; |
| 39 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 40 | local = wpan_phy_priv(phy); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 41 | |
Alexander Aring | 036562f | 2014-10-25 17:16:36 +0200 | [diff] [blame] | 42 | sdata->dev = dev; |
Alexander Aring | 04e850f | 2014-10-25 17:16:37 +0200 | [diff] [blame] | 43 | sdata->local = local; |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 44 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 45 | dev->needed_headroom = local->hw.extra_tx_headroom; |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 46 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 47 | SET_NETDEV_DEV(dev, &local->phy->dev); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 48 | |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 49 | err = register_netdev(dev); |
| 50 | if (err < 0) |
| 51 | return err; |
| 52 | |
| 53 | rtnl_lock(); |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 54 | mutex_lock(&local->iflist_mtx); |
| 55 | list_add_tail_rcu(&sdata->list, &local->interfaces); |
| 56 | mutex_unlock(&local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 57 | rtnl_unlock(); |
| 58 | |
| 59 | return 0; |
| 60 | } |
| 61 | |
Alexander Aring | 4a9a816 | 2014-11-02 04:18:38 +0100 | [diff] [blame^] | 62 | void mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev) |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 63 | { |
Alexander Aring | 59d19cd | 2014-10-25 17:16:40 +0200 | [diff] [blame] | 64 | struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); |
Varka Bhadram | 4710d80 | 2014-07-02 09:01:09 +0530 | [diff] [blame] | 65 | |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 66 | ASSERT_RTNL(); |
| 67 | |
Alexander Aring | 04e850f | 2014-10-25 17:16:37 +0200 | [diff] [blame] | 68 | BUG_ON(sdata->local->phy != phy); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 69 | |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 70 | mutex_lock(&sdata->local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 71 | list_del_rcu(&sdata->list); |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 72 | mutex_unlock(&sdata->local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 73 | |
| 74 | synchronize_rcu(); |
| 75 | unregister_netdevice(sdata->dev); |
| 76 | } |
| 77 | |
Alexander Aring | 4a9a816 | 2014-11-02 04:18:38 +0100 | [diff] [blame^] | 78 | struct net_device * |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 79 | mac802154_add_iface(struct wpan_phy *phy, const char *name, int type) |
| 80 | { |
| 81 | struct net_device *dev; |
| 82 | int err = -ENOMEM; |
| 83 | |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 84 | switch (type) { |
alex.bluesman.smirnov@gmail.com | 0606069 | 2012-05-15 20:50:29 +0000 | [diff] [blame] | 85 | case IEEE802154_DEV_MONITOR: |
Alexander Aring | 036562f | 2014-10-25 17:16:36 +0200 | [diff] [blame] | 86 | dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data), |
Tom Gundersen | c835a67 | 2014-07-14 16:37:24 +0200 | [diff] [blame] | 87 | name, NET_NAME_UNKNOWN, |
| 88 | mac802154_monitor_setup); |
alex.bluesman.smirnov@gmail.com | 0606069 | 2012-05-15 20:50:29 +0000 | [diff] [blame] | 89 | break; |
alex.bluesman.smirnov@gmail.com | 32bad7e | 2012-06-25 23:24:48 +0000 | [diff] [blame] | 90 | case IEEE802154_DEV_WPAN: |
Alexander Aring | 036562f | 2014-10-25 17:16:36 +0200 | [diff] [blame] | 91 | dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data), |
Tom Gundersen | c835a67 | 2014-07-14 16:37:24 +0200 | [diff] [blame] | 92 | name, NET_NAME_UNKNOWN, |
| 93 | mac802154_wpan_setup); |
alex.bluesman.smirnov@gmail.com | 32bad7e | 2012-06-25 23:24:48 +0000 | [diff] [blame] | 94 | break; |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 95 | default: |
| 96 | dev = NULL; |
| 97 | err = -EINVAL; |
| 98 | break; |
| 99 | } |
| 100 | if (!dev) |
| 101 | goto err; |
| 102 | |
| 103 | err = mac802154_netdev_register(phy, dev); |
| 104 | if (err) |
| 105 | goto err_free; |
| 106 | |
| 107 | dev_hold(dev); /* we return an incremented device refcount */ |
| 108 | return dev; |
| 109 | |
| 110 | err_free: |
| 111 | free_netdev(dev); |
| 112 | err: |
| 113 | return ERR_PTR(err); |
| 114 | } |
| 115 | |
Alexander Aring | c5c47e6 | 2014-10-27 17:13:30 +0100 | [diff] [blame] | 116 | static void ieee802154_tasklet_handler(unsigned long data) |
| 117 | { |
| 118 | struct ieee802154_local *local = (struct ieee802154_local *)data; |
| 119 | struct sk_buff *skb; |
| 120 | |
| 121 | while ((skb = skb_dequeue(&local->skb_queue))) { |
| 122 | switch (skb->pkt_type) { |
| 123 | case IEEE802154_RX_MSG: |
| 124 | /* Clear skb->pkt_type in order to not confuse kernel |
| 125 | * netstack. |
| 126 | */ |
| 127 | skb->pkt_type = 0; |
| 128 | ieee802154_rx(&local->hw, skb); |
| 129 | break; |
| 130 | default: |
| 131 | WARN(1, "mac802154: Packet is of unknown type %d\n", |
| 132 | skb->pkt_type); |
| 133 | kfree_skb(skb); |
| 134 | break; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 139 | struct ieee802154_hw * |
Alexander Aring | 1630186 | 2014-10-28 18:21:18 +0100 | [diff] [blame] | 140 | ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 141 | { |
| 142 | struct wpan_phy *phy; |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 143 | struct ieee802154_local *local; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 144 | size_t priv_size; |
| 145 | |
Alexander Aring | ed0a5dc | 2014-10-26 09:37:08 +0100 | [diff] [blame] | 146 | if (!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed || |
| 147 | !ops->start || !ops->stop || !ops->set_channel) { |
Chen Weilong | 83a1a7c | 2013-10-30 15:28:07 +0800 | [diff] [blame] | 148 | pr_err("undefined IEEE802.15.4 device operations\n"); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 149 | return NULL; |
| 150 | } |
| 151 | |
| 152 | /* Ensure 32-byte alignment of our private data and hw private data. |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 153 | * We use the wpan_phy priv data for both our ieee802154_local and for |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 154 | * the driver's private data |
| 155 | * |
| 156 | * in memory it'll be like this: |
| 157 | * |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 158 | * +-------------------------+ |
| 159 | * | struct wpan_phy | |
| 160 | * +-------------------------+ |
| 161 | * | struct ieee802154_local | |
| 162 | * +-------------------------+ |
| 163 | * | driver's private data | |
| 164 | * +-------------------------+ |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 165 | * |
| 166 | * Due to ieee802154 layer isn't aware of driver and MAC structures, |
Alexander Aring | 139f14a | 2014-10-25 05:25:08 +0200 | [diff] [blame] | 167 | * so lets align them here. |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 168 | */ |
| 169 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 170 | priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 171 | |
Alexander Aring | 1201cd2 | 2014-11-02 04:18:36 +0100 | [diff] [blame] | 172 | phy = wpan_phy_alloc(&mac802154_config_ops, priv_size); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 173 | if (!phy) { |
Chen Weilong | 83a1a7c | 2013-10-30 15:28:07 +0800 | [diff] [blame] | 174 | pr_err("failure to allocate master IEEE802.15.4 device\n"); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 175 | return NULL; |
| 176 | } |
| 177 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 178 | local = wpan_phy_priv(phy); |
| 179 | local->phy = phy; |
| 180 | local->hw.phy = local->phy; |
| 181 | local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); |
| 182 | local->ops = ops; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 183 | |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 184 | INIT_LIST_HEAD(&local->interfaces); |
| 185 | mutex_init(&local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 186 | |
Alexander Aring | c5c47e6 | 2014-10-27 17:13:30 +0100 | [diff] [blame] | 187 | tasklet_init(&local->tasklet, |
| 188 | ieee802154_tasklet_handler, |
| 189 | (unsigned long)local); |
| 190 | |
| 191 | skb_queue_head_init(&local->skb_queue); |
| 192 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 193 | return &local->hw; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 194 | } |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 195 | EXPORT_SYMBOL(ieee802154_alloc_hw); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 196 | |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 197 | void ieee802154_free_hw(struct ieee802154_hw *hw) |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 198 | { |
Alexander Aring | 6074136 | 2014-10-25 17:16:39 +0200 | [diff] [blame] | 199 | struct ieee802154_local *local = hw_to_local(hw); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 200 | |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 201 | BUG_ON(!list_empty(&local->interfaces)); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 202 | |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 203 | mutex_destroy(&local->iflist_mtx); |
Konstantin Khlebnikov | 1e9f954 | 2012-12-14 01:03:03 +0000 | [diff] [blame] | 204 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 205 | wpan_phy_free(local->phy); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 206 | } |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 207 | EXPORT_SYMBOL(ieee802154_free_hw); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 208 | |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 209 | int ieee802154_register_hw(struct ieee802154_hw *hw) |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 210 | { |
Alexander Aring | 6074136 | 2014-10-25 17:16:39 +0200 | [diff] [blame] | 211 | struct ieee802154_local *local = hw_to_local(hw); |
Alexander Aring | 640985e | 2014-07-03 00:20:43 +0200 | [diff] [blame] | 212 | int rc = -ENOSYS; |
| 213 | |
Alexander Aring | f773054 | 2014-10-25 17:16:41 +0200 | [diff] [blame] | 214 | local->workqueue = |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 215 | create_singlethread_workqueue(wpan_phy_name(local->phy)); |
Alexander Aring | f773054 | 2014-10-25 17:16:41 +0200 | [diff] [blame] | 216 | if (!local->workqueue) { |
Alexander Aring | 640985e | 2014-07-03 00:20:43 +0200 | [diff] [blame] | 217 | rc = -ENOMEM; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 218 | goto out; |
Alexander Aring | 640985e | 2014-07-03 00:20:43 +0200 | [diff] [blame] | 219 | } |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 220 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 221 | wpan_phy_set_dev(local->phy, local->hw.parent); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 222 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 223 | rc = wpan_phy_register(local->phy); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 224 | if (rc < 0) |
| 225 | goto out_wq; |
| 226 | |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 227 | return 0; |
| 228 | |
| 229 | out_wq: |
Alexander Aring | f773054 | 2014-10-25 17:16:41 +0200 | [diff] [blame] | 230 | destroy_workqueue(local->workqueue); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 231 | out: |
| 232 | return rc; |
| 233 | } |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 234 | EXPORT_SYMBOL(ieee802154_register_hw); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 235 | |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 236 | void ieee802154_unregister_hw(struct ieee802154_hw *hw) |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 237 | { |
Alexander Aring | 6074136 | 2014-10-25 17:16:39 +0200 | [diff] [blame] | 238 | struct ieee802154_local *local = hw_to_local(hw); |
Alexander Aring | 036562f | 2014-10-25 17:16:36 +0200 | [diff] [blame] | 239 | struct ieee802154_sub_if_data *sdata, *next; |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 240 | |
Alexander Aring | c5c47e6 | 2014-10-27 17:13:30 +0100 | [diff] [blame] | 241 | tasklet_kill(&local->tasklet); |
Alexander Aring | f773054 | 2014-10-25 17:16:41 +0200 | [diff] [blame] | 242 | flush_workqueue(local->workqueue); |
| 243 | destroy_workqueue(local->workqueue); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 244 | |
| 245 | rtnl_lock(); |
| 246 | |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 247 | list_for_each_entry_safe(sdata, next, &local->interfaces, list) { |
| 248 | mutex_lock(&sdata->local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 249 | list_del(&sdata->list); |
Alexander Aring | d98be45 | 2014-10-25 17:16:38 +0200 | [diff] [blame] | 250 | mutex_unlock(&sdata->local->iflist_mtx); |
alex.bluesman.smirnov@gmail.com | 62610ad | 2012-05-15 20:50:28 +0000 | [diff] [blame] | 251 | |
| 252 | unregister_netdevice(sdata->dev); |
| 253 | } |
| 254 | |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 255 | rtnl_unlock(); |
| 256 | |
Alexander Aring | a5e1ec5 | 2014-10-25 17:16:35 +0200 | [diff] [blame] | 257 | wpan_phy_unregister(local->phy); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 258 | } |
Alexander Aring | 5a50439 | 2014-10-25 17:16:34 +0200 | [diff] [blame] | 259 | EXPORT_SYMBOL(ieee802154_unregister_hw); |
alex.bluesman.smirnov@gmail.com | 1010f54 | 2012-05-15 20:50:20 +0000 | [diff] [blame] | 260 | |
| 261 | MODULE_DESCRIPTION("IEEE 802.15.4 implementation"); |
| 262 | MODULE_LICENSE("GPL v2"); |