net/mac802154/cfg.c
Source file repositories/reference/linux-study-clean/net/mac802154/cfg.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac802154/cfg.c- Extension
.c- Size
- 17851 bytes
- Lines
- 721
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/rtnetlink.hnet/cfg802154.hieee802154_i.hdriver-ops.hcfg.h
Detected Declarations
function ieee802154_add_iface_deprecatedfunction ieee802154_del_iface_deprecatedfunction ieee802154_suspendfunction ieee802154_resumefunction ieee802154_add_ifacefunction ieee802154_del_ifacefunction ieee802154_set_channelfunction ieee802154_set_cca_modefunction ieee802154_set_cca_ed_levelfunction ieee802154_set_tx_powerfunction ieee802154_set_pan_idfunction ieee802154_set_backoff_exponentfunction ieee802154_set_short_addrfunction ieee802154_set_max_csma_backoffsfunction ieee802154_set_max_frame_retriesfunction ieee802154_set_lbt_modefunction ieee802154_set_ackreq_defaultfunction mac802154_trigger_scanfunction mac802154_abort_scanfunction mac802154_send_beaconsfunction mac802154_stop_beaconsfunction mac802154_associatefunction mac802154_disassociate_from_parentfunction mac802154_disassociate_childfunction mac802154_disassociatefunction ieee802154_get_llsec_tablefunction ieee802154_lock_llsec_tablefunction ieee802154_unlock_llsec_tablefunction ieee802154_set_llsec_paramsfunction ieee802154_get_llsec_paramsfunction ieee802154_add_llsec_keyfunction ieee802154_del_llsec_keyfunction ieee802154_add_seclevelfunction ieee802154_del_seclevelfunction ieee802154_add_devicefunction ieee802154_del_devicefunction ieee802154_add_devkeyfunction ieee802154_del_devkey
Annotated Snippet
if (ret) {
eaddr = swab64((__force u64)child->extended_addr);
dev_err(&sdata->dev->dev,
"Disassociation with %8phC may have failed (%d)\n",
&eaddr, ret);
}
list_del(&child->node);
}
ret = mac802154_send_disassociation_notif(sdata, wpan_dev->parent,
IEEE802154_DEVICE_WISHES_TO_LEAVE);
if (ret) {
eaddr = swab64((__force u64)wpan_dev->parent->extended_addr);
dev_err(&sdata->dev->dev,
"Disassociation from %8phC may have failed (%d)\n",
&eaddr, ret);
}
ret = 0;
kfree(wpan_dev->parent);
wpan_dev->parent = NULL;
wpan_dev->pan_id = cpu_to_le16(IEEE802154_PAN_ID_BROADCAST);
wpan_dev->short_addr = cpu_to_le16(IEEE802154_ADDR_SHORT_BROADCAST);
if (local->hw.flags & IEEE802154_HW_AFILT) {
ret = drv_set_pan_id(local, wpan_dev->pan_id);
if (ret < 0)
goto reset_mac_assoc;
ret = drv_set_short_addr(local, wpan_dev->short_addr);
if (ret < 0)
goto reset_mac_assoc;
}
reset_mac_assoc:
cfg802154_set_max_associations(wpan_dev, max_assoc);
return ret;
}
static int mac802154_disassociate_child(struct wpan_phy *wpan_phy,
struct wpan_dev *wpan_dev,
struct ieee802154_pan_device *child)
{
struct ieee802154_sub_if_data *sdata;
int ret;
sdata = IEEE802154_WPAN_DEV_TO_SUB_IF(wpan_dev);
ret = mac802154_send_disassociation_notif(sdata, child,
IEEE802154_COORD_WISHES_DEVICE_TO_LEAVE);
if (ret)
return ret;
list_del(&child->node);
wpan_dev->nchildren--;
kfree(child);
return 0;
}
static int mac802154_disassociate(struct wpan_phy *wpan_phy,
struct wpan_dev *wpan_dev,
struct ieee802154_addr *target)
{
u64 teaddr = swab64((__force u64)target->extended_addr);
struct ieee802154_pan_device *pan_device;
ASSERT_RTNL();
if (cfg802154_device_is_parent(wpan_dev, target))
return mac802154_disassociate_from_parent(wpan_phy, wpan_dev);
pan_device = cfg802154_device_is_child(wpan_dev, target);
if (pan_device)
return mac802154_disassociate_child(wpan_phy, wpan_dev,
pan_device);
dev_err(&wpan_dev->netdev->dev,
"Device %8phC is not associated with us\n", &teaddr);
return -EINVAL;
}
#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
static void
ieee802154_get_llsec_table(struct wpan_phy *wpan_phy,
struct wpan_dev *wpan_dev,
Annotation
- Immediate include surface: `net/rtnetlink.h`, `net/cfg802154.h`, `ieee802154_i.h`, `driver-ops.h`, `cfg.h`.
- Detected declarations: `function ieee802154_add_iface_deprecated`, `function ieee802154_del_iface_deprecated`, `function ieee802154_suspend`, `function ieee802154_resume`, `function ieee802154_add_iface`, `function ieee802154_del_iface`, `function ieee802154_set_channel`, `function ieee802154_set_cca_mode`, `function ieee802154_set_cca_ed_level`, `function ieee802154_set_tx_power`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.