Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) 2007-2012 Siemens AG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Written by:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <net/netlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <net/nl802154.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <net/mac802154.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <net/ieee802154_netdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <net/route.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <net/cfg802154.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include "ieee802154_i.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include "cfg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) static void ieee802154_tasklet_handler(unsigned long data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	struct ieee802154_local *local = (struct ieee802154_local *)data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	struct sk_buff *skb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	while ((skb = skb_dequeue(&local->skb_queue))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		switch (skb->pkt_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 		case IEEE802154_RX_MSG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 			/* Clear skb->pkt_type in order to not confuse kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 			 * netstack.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 			skb->pkt_type = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 			ieee802154_rx(local, skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 			WARN(1, "mac802154: Packet is of unknown type %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 			     skb->pkt_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 			kfree_skb(skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) struct ieee802154_hw *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	struct wpan_phy *phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	struct ieee802154_local *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	size_t priv_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	if (WARN_ON(!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		    !ops->start || !ops->stop || !ops->set_channel))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	/* Ensure 32-byte alignment of our private data and hw private data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	 * We use the wpan_phy priv data for both our ieee802154_local and for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	 * the driver's private data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	 * in memory it'll be like this:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	 * +-------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	 * | struct wpan_phy         |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	 * +-------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	 * | struct ieee802154_local |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	 * +-------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	 * | driver's private data   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	 * +-------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	 * Due to ieee802154 layer isn't aware of driver and MAC structures,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	 * so lets align them here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	priv_size = ALIGN(sizeof(*local), NETDEV_ALIGN) + priv_data_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	phy = wpan_phy_new(&mac802154_config_ops, priv_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	if (!phy) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		pr_err("failure to allocate master IEEE802.15.4 device\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	phy->privid = mac802154_wpan_phy_privid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	local = wpan_phy_priv(phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	local->phy = phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	local->hw.phy = local->phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	local->ops = ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	INIT_LIST_HEAD(&local->interfaces);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	mutex_init(&local->iflist_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	tasklet_init(&local->tasklet,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		     ieee802154_tasklet_handler,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		     (unsigned long)local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	skb_queue_head_init(&local->skb_queue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	INIT_WORK(&local->tx_work, ieee802154_xmit_worker);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	/* init supported flags with 802.15.4 default ranges */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	phy->supported.max_minbe = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	phy->supported.min_maxbe = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	phy->supported.max_maxbe = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	phy->supported.min_frame_retries = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	phy->supported.max_frame_retries = 7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	phy->supported.max_csma_backoffs = 5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	phy->supported.lbt = NL802154_SUPPORTED_BOOL_FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	/* always supported */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	phy->supported.iftypes = BIT(NL802154_IFTYPE_NODE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	return &local->hw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) EXPORT_SYMBOL(ieee802154_alloc_hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) void ieee802154_free_hw(struct ieee802154_hw *hw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	struct ieee802154_local *local = hw_to_local(hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	BUG_ON(!list_empty(&local->interfaces));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	mutex_destroy(&local->iflist_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	wpan_phy_free(local->phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) EXPORT_SYMBOL(ieee802154_free_hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static void ieee802154_setup_wpan_phy_pib(struct wpan_phy *wpan_phy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	/* TODO warn on empty symbol_duration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	 * Should be done when all drivers sets this value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	wpan_phy->lifs_period = IEEE802154_LIFS_PERIOD *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 				wpan_phy->symbol_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	wpan_phy->sifs_period = IEEE802154_SIFS_PERIOD *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 				wpan_phy->symbol_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) int ieee802154_register_hw(struct ieee802154_hw *hw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	struct ieee802154_local *local = hw_to_local(hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	int rc = -ENOSYS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	local->workqueue =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		create_singlethread_workqueue(wpan_phy_name(local->phy));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	if (!local->workqueue) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		rc = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	hrtimer_init(&local->ifs_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	local->ifs_timer.function = ieee802154_xmit_ifs_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	wpan_phy_set_dev(local->phy, local->hw.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	ieee802154_setup_wpan_phy_pib(local->phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	if (!(hw->flags & IEEE802154_HW_CSMA_PARAMS)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		local->phy->supported.min_csma_backoffs = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		local->phy->supported.max_csma_backoffs = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		local->phy->supported.min_maxbe = 5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		local->phy->supported.max_maxbe = 5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		local->phy->supported.min_minbe = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		local->phy->supported.max_minbe = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	if (!(hw->flags & IEEE802154_HW_FRAME_RETRIES)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		local->phy->supported.min_frame_retries = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		local->phy->supported.max_frame_retries = 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	if (hw->flags & IEEE802154_HW_PROMISCUOUS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		local->phy->supported.iftypes |= BIT(NL802154_IFTYPE_MONITOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	rc = wpan_phy_register(local->phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if (rc < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		goto out_wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	rtnl_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	dev = ieee802154_if_add(local, "wpan%d", NET_NAME_ENUM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 				NL802154_IFTYPE_NODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 				cpu_to_le64(0x0000000000000000ULL));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	if (IS_ERR(dev)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		rtnl_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		rc = PTR_ERR(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		goto out_phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	rtnl_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) out_phy:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	wpan_phy_unregister(local->phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) out_wq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	destroy_workqueue(local->workqueue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	return rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) EXPORT_SYMBOL(ieee802154_register_hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) void ieee802154_unregister_hw(struct ieee802154_hw *hw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	struct ieee802154_local *local = hw_to_local(hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	tasklet_kill(&local->tasklet);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	flush_workqueue(local->workqueue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	rtnl_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	ieee802154_remove_interfaces(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	rtnl_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	destroy_workqueue(local->workqueue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	wpan_phy_unregister(local->phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) EXPORT_SYMBOL(ieee802154_unregister_hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static int __init ieee802154_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	return ieee802154_iface_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) static void __exit ieee802154_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	ieee802154_iface_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	rcu_barrier();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) subsys_initcall(ieee802154_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) module_exit(ieee802154_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) MODULE_DESCRIPTION("IEEE 802.15.4 subsystem");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) MODULE_LICENSE("GPL v2");