drivers/net/dsa/microchip/ksz8863_smi.c
Source file repositories/reference/linux-study-clean/drivers/net/dsa/microchip/ksz8863_smi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/microchip/ksz8863_smi.c- Extension
.c- Size
- 4953 bytes
- Lines
- 227
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mod_devicetable.hlinux/property.hksz8.hksz_common.h
Detected Declarations
function Copyrightfunction ksz8863_mdio_writefunction ksz8863_smi_probefunction ksz8863_smi_removefunction ksz8863_smi_shutdown
Annotated Snippet
if (IS_ERR(dev->regmap[i])) {
return dev_err_probe(&mdiodev->dev,
PTR_ERR(dev->regmap[i]),
"Failed to initialize regmap%i\n",
ksz8863_regmap_config[i].val_bits);
}
}
if (mdiodev->dev.platform_data)
dev->pdata = mdiodev->dev.platform_data;
ret = ksz_switch_register(dev);
/* Main DSA driver may not be started yet. */
if (ret)
return ret;
dev_set_drvdata(&mdiodev->dev, dev);
return 0;
}
static void ksz8863_smi_remove(struct mdio_device *mdiodev)
{
struct ksz_device *dev = dev_get_drvdata(&mdiodev->dev);
if (dev)
ksz_switch_remove(dev);
}
static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
{
struct ksz_device *dev = dev_get_drvdata(&mdiodev->dev);
if (dev)
dsa_switch_shutdown(dev->ds);
dev_set_drvdata(&mdiodev->dev, NULL);
}
static const struct of_device_id ksz8863_dt_ids[] = {
{
.compatible = "microchip,ksz8863",
.data = &ksz_switch_chips[KSZ88X3]
},
{
.compatible = "microchip,ksz8873",
.data = &ksz_switch_chips[KSZ88X3]
},
{ },
};
MODULE_DEVICE_TABLE(of, ksz8863_dt_ids);
static struct mdio_driver ksz8863_driver = {
.probe = ksz8863_smi_probe,
.remove = ksz8863_smi_remove,
.shutdown = ksz8863_smi_shutdown,
.mdiodrv.driver = {
.name = "ksz8863-switch",
.of_match_table = ksz8863_dt_ids,
},
};
mdio_module_driver(ksz8863_driver);
MODULE_AUTHOR("Michael Grzeschik <m.grzeschik@pengutronix.de>");
MODULE_DESCRIPTION("Microchip KSZ8863 SMI Switch driver");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/mod_devicetable.h`, `linux/property.h`, `ksz8.h`, `ksz_common.h`.
- Detected declarations: `function Copyright`, `function ksz8863_mdio_write`, `function ksz8863_smi_probe`, `function ksz8863_smi_remove`, `function ksz8863_smi_shutdown`.
- Atlas domain: Driver Families / drivers/net.
- 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.