drivers/net/wireless/microchip/wilc1000/mon.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/microchip/wilc1000/mon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/microchip/wilc1000/mon.c- Extension
.c- Size
- 6051 bytes
- Lines
- 259
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
cfg80211.h
Detected Declarations
struct wilc_wfi_radiotap_hdrstruct wilc_wfi_radiotap_cb_hdrstruct tx_complete_mon_datafunction wilc_wfi_monitor_rxfunction mgmt_tx_completefunction mon_mgmt_txfunction wilc_wfi_mon_xmitfunction wilc_wfi_deinit_mon_interface
Annotated Snippet
static const struct net_device_ops wilc_wfi_netdev_ops = {
.ndo_start_xmit = wilc_wfi_mon_xmit,
};
struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
const char *name,
struct net_device *real_dev)
{
struct wilc_wfi_mon_priv *priv;
/* If monitor interface is already initialized, return it */
if (wl->monitor_dev)
return wl->monitor_dev;
wl->monitor_dev = alloc_etherdev(sizeof(struct wilc_wfi_mon_priv));
if (!wl->monitor_dev)
return NULL;
wl->monitor_dev->type = ARPHRD_IEEE80211_RADIOTAP;
strscpy(wl->monitor_dev->name, name, IFNAMSIZ);
wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops;
wl->monitor_dev->needs_free_netdev = true;
if (register_netdevice(wl->monitor_dev)) {
netdev_err(real_dev, "register_netdevice failed\n");
free_netdev(wl->monitor_dev);
return NULL;
}
priv = netdev_priv(wl->monitor_dev);
priv->real_ndev = real_dev;
return wl->monitor_dev;
}
void wilc_wfi_deinit_mon_interface(struct wilc *wl, bool rtnl_locked)
{
if (!wl->monitor_dev)
return;
if (rtnl_locked)
unregister_netdevice(wl->monitor_dev);
else
unregister_netdev(wl->monitor_dev);
wl->monitor_dev = NULL;
}
Annotation
- Immediate include surface: `cfg80211.h`.
- Detected declarations: `struct wilc_wfi_radiotap_hdr`, `struct wilc_wfi_radiotap_cb_hdr`, `struct tx_complete_mon_data`, `function wilc_wfi_monitor_rx`, `function mgmt_tx_complete`, `function mon_mgmt_tx`, `function wilc_wfi_mon_xmit`, `function wilc_wfi_deinit_mon_interface`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.