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)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Authors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Alexander Aring <aar@pengutronix.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Based on: net/mac80211/cfg.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <net/rtnetlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <net/cfg802154.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include "ieee802154_i.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "driver-ops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include "cfg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) static struct net_device *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) ieee802154_add_iface_deprecated(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 				const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 				unsigned char name_assign_type, int type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	rtnl_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	dev = ieee802154_if_add(local, name, name_assign_type, type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 				cpu_to_le64(0x0000000000000000ULL));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	rtnl_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	return dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static void ieee802154_del_iface_deprecated(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 					    struct net_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	ieee802154_if_remove(sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #ifdef CONFIG_PM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static int ieee802154_suspend(struct wpan_phy *wpan_phy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	if (!local->open_count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		goto suspend;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	ieee802154_stop_queue(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	synchronize_net();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	/* stop hardware - this must stop RX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	ieee802154_stop_device(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) suspend:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	local->suspended = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) static int ieee802154_resume(struct wpan_phy *wpan_phy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	/* nothing to do if HW shouldn't run */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (!local->open_count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		goto wake_up;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/* restart hardware */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	ret = drv_start(local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) wake_up:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	ieee802154_wake_queue(&local->hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	local->suspended = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) #define ieee802154_suspend NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define ieee802154_resume NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) ieee802154_add_iface(struct wpan_phy *phy, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		     unsigned char name_assign_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		     enum nl802154_iftype type, __le64 extended_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	struct ieee802154_local *local = wpan_phy_priv(phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	struct net_device *err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	err = ieee802154_if_add(local, name, name_assign_type, type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 				extended_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return PTR_ERR_OR_ZERO(err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) ieee802154_del_iface(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	ieee802154_if_remove(IEEE802154_WPAN_DEV_TO_SUB_IF(wpan_dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	if (wpan_phy->current_page == page &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	    wpan_phy->current_channel == channel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	ret = drv_set_channel(local, page, channel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	if (!ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		wpan_phy->current_page = page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		wpan_phy->current_channel = channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) ieee802154_set_cca_mode(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 			const struct wpan_phy_cca *cca)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	if (wpan_phy_cca_cmp(&wpan_phy->cca, cca))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	ret = drv_set_cca_mode(local, cca);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	if (!ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		wpan_phy->cca = *cca;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) ieee802154_set_cca_ed_level(struct wpan_phy *wpan_phy, s32 ed_level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	if (wpan_phy->cca_ed_level == ed_level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	ret = drv_set_cca_ed_level(local, ed_level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	if (!ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		wpan_phy->cca_ed_level = ed_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) ieee802154_set_tx_power(struct wpan_phy *wpan_phy, s32 power)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	if (wpan_phy->transmit_power == power)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	ret = drv_set_tx_power(local, power);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	if (!ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		wpan_phy->transmit_power = power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		      __le16 pan_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	if (wpan_dev->pan_id == pan_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	ret = mac802154_wpan_update_llsec(wpan_dev->netdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	if (!ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		wpan_dev->pan_id = pan_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) ieee802154_set_backoff_exponent(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 				struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 				u8 min_be, u8 max_be)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	wpan_dev->min_be = min_be;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	wpan_dev->max_be = max_be;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 			  __le16 short_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	wpan_dev->short_addr = short_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) ieee802154_set_max_csma_backoffs(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 				 struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 				 u8 max_csma_backoffs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	wpan_dev->csma_retries = max_csma_backoffs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) ieee802154_set_max_frame_retries(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 				 struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 				 s8 max_frame_retries)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	wpan_dev->frame_retries = max_frame_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 			bool mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	wpan_dev->lbt = mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) ieee802154_set_ackreq_default(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 			      struct wpan_dev *wpan_dev, bool ackreq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	ASSERT_RTNL();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	wpan_dev->ackreq = ackreq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) ieee802154_get_llsec_table(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 			   struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 			   struct ieee802154_llsec_table **table)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	*table = &sdata->sec.table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) ieee802154_lock_llsec_table(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 			    struct wpan_dev *wpan_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) ieee802154_unlock_llsec_table(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 			      struct wpan_dev *wpan_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) ieee802154_set_llsec_params(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 			    struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 			    const struct ieee802154_llsec_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 			    int changed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	res = mac802154_llsec_set_params(&sdata->sec, params, changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ieee802154_get_llsec_params(struct wpan_phy *wpan_phy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 			    struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 			    struct ieee802154_llsec_params *params)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	res = mac802154_llsec_get_params(&sdata->sec, params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) ieee802154_add_llsec_key(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 			 const struct ieee802154_llsec_key_id *id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 			 const struct ieee802154_llsec_key *key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	res = mac802154_llsec_key_add(&sdata->sec, id, key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) ieee802154_del_llsec_key(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 			 const struct ieee802154_llsec_key_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	res = mac802154_llsec_key_del(&sdata->sec, id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) ieee802154_add_seclevel(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 			const struct ieee802154_llsec_seclevel *sl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	res = mac802154_llsec_seclevel_add(&sdata->sec, sl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) ieee802154_del_seclevel(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 			const struct ieee802154_llsec_seclevel *sl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	res = mac802154_llsec_seclevel_del(&sdata->sec, sl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) ieee802154_add_device(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		      const struct ieee802154_llsec_device *dev_desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	res = mac802154_llsec_dev_add(&sdata->sec, dev_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) ieee802154_del_device(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 		      __le64 extended_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	res = mac802154_llsec_dev_del(&sdata->sec, extended_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) ieee802154_add_devkey(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		      __le64 extended_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 		      const struct ieee802154_llsec_device_key *key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	res = mac802154_llsec_devkey_add(&sdata->sec, extended_addr, key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) ieee802154_del_devkey(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 		      __le64 extended_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 		      const struct ieee802154_llsec_device_key *key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	struct net_device *dev = wpan_dev->netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	int res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	mutex_lock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	res = mac802154_llsec_devkey_del(&sdata->sec, extended_addr, key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	mutex_unlock(&sdata->sec_mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) const struct cfg802154_ops mac802154_config_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	.add_virtual_intf_deprecated = ieee802154_add_iface_deprecated,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	.del_virtual_intf_deprecated = ieee802154_del_iface_deprecated,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	.suspend = ieee802154_suspend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 	.resume = ieee802154_resume,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	.add_virtual_intf = ieee802154_add_iface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 	.del_virtual_intf = ieee802154_del_iface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	.set_channel = ieee802154_set_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	.set_cca_mode = ieee802154_set_cca_mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	.set_cca_ed_level = ieee802154_set_cca_ed_level,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	.set_tx_power = ieee802154_set_tx_power,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	.set_pan_id = ieee802154_set_pan_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	.set_short_addr = ieee802154_set_short_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	.set_backoff_exponent = ieee802154_set_backoff_exponent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 	.set_max_csma_backoffs = ieee802154_set_max_csma_backoffs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	.set_max_frame_retries = ieee802154_set_max_frame_retries,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	.set_lbt_mode = ieee802154_set_lbt_mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	.set_ackreq_default = ieee802154_set_ackreq_default,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	.get_llsec_table = ieee802154_get_llsec_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	.lock_llsec_table = ieee802154_lock_llsec_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 	.unlock_llsec_table = ieee802154_unlock_llsec_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 	/* TODO above */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	.set_llsec_params = ieee802154_set_llsec_params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 	.get_llsec_params = ieee802154_get_llsec_params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	.add_llsec_key = ieee802154_add_llsec_key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	.del_llsec_key = ieee802154_del_llsec_key,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	.add_seclevel = ieee802154_add_seclevel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	.del_seclevel = ieee802154_del_seclevel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	.add_device = ieee802154_add_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 	.del_device = ieee802154_del_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	.add_devkey = ieee802154_add_devkey,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 	.del_devkey = ieee802154_del_devkey,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) };