drivers/net/wireless/marvell/mwifiex/ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/ethtool.c- Extension
.c- Size
- 1599 bytes
- Lines
- 59
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
main.h
Detected Declarations
function mwifiex_ethtool_get_wolfunction mwifiex_ethtool_set_wol
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* NXP Wireless LAN device driver: ethtool
*
* Copyright 2011-2020 NXP
*/
#include "main.h"
static void mwifiex_ethtool_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
u32 conditions = le32_to_cpu(priv->adapter->hs_cfg.conditions);
wol->supported = WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY;
if (conditions == HS_CFG_COND_DEF)
return;
if (conditions & HS_CFG_COND_UNICAST_DATA)
wol->wolopts |= WAKE_UCAST;
if (conditions & HS_CFG_COND_MULTICAST_DATA)
wol->wolopts |= WAKE_MCAST;
if (conditions & HS_CFG_COND_BROADCAST_DATA)
wol->wolopts |= WAKE_BCAST;
if (conditions & HS_CFG_COND_MAC_EVENT)
wol->wolopts |= WAKE_PHY;
}
static int mwifiex_ethtool_set_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
u32 conditions = 0;
if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
return -EOPNOTSUPP;
if (wol->wolopts & WAKE_UCAST)
conditions |= HS_CFG_COND_UNICAST_DATA;
if (wol->wolopts & WAKE_MCAST)
conditions |= HS_CFG_COND_MULTICAST_DATA;
if (wol->wolopts & WAKE_BCAST)
conditions |= HS_CFG_COND_BROADCAST_DATA;
if (wol->wolopts & WAKE_PHY)
conditions |= HS_CFG_COND_MAC_EVENT;
if (wol->wolopts == 0)
conditions |= HS_CFG_COND_DEF;
priv->adapter->hs_cfg.conditions = cpu_to_le32(conditions);
return 0;
}
const struct ethtool_ops mwifiex_ethtool_ops = {
.get_wol = mwifiex_ethtool_get_wol,
.set_wol = mwifiex_ethtool_set_wol,
};
Annotation
- Immediate include surface: `main.h`.
- Detected declarations: `function mwifiex_ethtool_get_wol`, `function mwifiex_ethtool_set_wol`.
- Atlas domain: Driver Families / drivers/net.
- 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.