net/mac802154/driver-ops.h
Source file repositories/reference/linux-study-clean/net/mac802154/driver-ops.h
File Facts
- System
- Linux kernel
- Corpus path
net/mac802154/driver-ops.h- Extension
.h- Size
- 8038 bytes
- Lines
- 355
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/rtnetlink.hnet/mac802154.hieee802154_i.htrace.h
Detected Declarations
function drv_xmit_asyncfunction drv_xmit_syncfunction drv_set_pan_idfunction drv_set_extended_addrfunction drv_set_short_addrfunction drv_set_pan_coordfunction drv_set_promiscuous_modefunction drv_startfunction drv_stopfunction drv_set_channelfunction drv_set_tx_powerfunction drv_set_cca_modefunction drv_set_lbt_modefunction drv_set_cca_ed_levelfunction drv_set_csma_paramsfunction drv_set_max_frame_retries
Annotated Snippet
if (local->hw.flags & IEEE802154_HW_PROMISCUOUS) {
ret = drv_set_promiscuous_mode(local, true);
if (ret < 0)
return ret;
} else {
return -EOPNOTSUPP;
}
/* In practice other filtering levels can be requested, but as
* for now most hardware/drivers only support
* IEEE802154_FILTERING_NONE, we fallback to this actual
* filtering level in hardware and make our own additional
* filtering in mac802154 receive path.
*
* TODO: Move this logic to the device drivers as hardware may
* support more higher level filters. Hardware may also require
* a different order how register are set, which could currently
* be buggy, so all received parameters need to be moved to the
* start() callback and let the driver go into the mode before
* it will turn on receive handling.
*/
local->phy->filtering = IEEE802154_FILTERING_NONE;
break;
case IEEE802154_FILTERING_4_FRAME_FIELDS:
/* Do not error out if IEEE802154_HW_PROMISCUOUS because we
* expect the hardware to operate at the level
* IEEE802154_FILTERING_4_FRAME_FIELDS anyway.
*/
if (local->hw.flags & IEEE802154_HW_PROMISCUOUS) {
ret = drv_set_promiscuous_mode(local, false);
if (ret < 0)
return ret;
}
local->phy->filtering = IEEE802154_FILTERING_4_FRAME_FIELDS;
break;
default:
WARN_ON(1);
return -EINVAL;
}
trace_802154_drv_start(local);
local->started = true;
smp_mb();
ret = local->ops->start(&local->hw);
trace_802154_drv_return_int(local, ret);
return ret;
}
static inline void drv_stop(struct ieee802154_local *local)
{
might_sleep();
trace_802154_drv_stop(local);
local->ops->stop(&local->hw);
trace_802154_drv_return_void(local);
/* sync away all work on the tasklet before clearing started */
tasklet_disable(&local->tasklet);
tasklet_enable(&local->tasklet);
barrier();
local->started = false;
}
static inline int
drv_set_channel(struct ieee802154_local *local, u8 page, u8 channel)
{
int ret;
might_sleep();
trace_802154_drv_set_channel(local, page, channel);
ret = local->ops->set_channel(&local->hw, page, channel);
trace_802154_drv_return_int(local, ret);
return ret;
}
static inline int drv_set_tx_power(struct ieee802154_local *local, s32 mbm)
{
int ret;
might_sleep();
if (!local->ops->set_txpower) {
WARN_ON(1);
return -EOPNOTSUPP;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/rtnetlink.h`, `net/mac802154.h`, `ieee802154_i.h`, `trace.h`.
- Detected declarations: `function drv_xmit_async`, `function drv_xmit_sync`, `function drv_set_pan_id`, `function drv_set_extended_addr`, `function drv_set_short_addr`, `function drv_set_pan_coord`, `function drv_set_promiscuous_mode`, `function drv_start`, `function drv_stop`, `function drv_set_channel`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
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.