drivers/net/phy/uPD60620.c

Source file repositories/reference/linux-study-clean/drivers/net/phy/uPD60620.c

File Facts

System
Linux kernel
Corpus path
drivers/net/phy/uPD60620.c
Extension
.c
Size
2490 bytes
Lines
99
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (phy_state & (PHY_PHYSCR_10MB | PHY_PHYSCR_100MB)) {
			phydev->link = 1;
			phydev->speed = SPEED_10;
			phydev->duplex = DUPLEX_HALF;

			if (phy_state & PHY_PHYSCR_100MB)
				phydev->speed = SPEED_100;
			if (phy_state & PHY_PHYSCR_DUPLEX)
				phydev->duplex = DUPLEX_FULL;

			phy_state = phy_read(phydev, MII_LPA);
			if (phy_state < 0)
				return phy_state;

			mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising,
						  phy_state);

			phy_resolve_aneg_pause(phydev);
		}
	}
	return 0;
}

MODULE_DESCRIPTION("Renesas uPD60620 PHY driver");
MODULE_AUTHOR("Bernd Edlinger <bernd.edlinger@hotmail.de>");
MODULE_LICENSE("GPL");

static struct phy_driver upd60620_driver[1] = { {
	.phy_id         = UPD60620_PHY_ID,
	.phy_id_mask    = 0xfffffffe,
	.name           = "Renesas uPD60620",
	/* PHY_BASIC_FEATURES */
	.flags          = 0,
	.config_init    = upd60620_config_init,
	.read_status    = upd60620_read_status,
} };

module_phy_driver(upd60620_driver);

static const struct mdio_device_id __maybe_unused upd60620_tbl[] = {
	{ UPD60620_PHY_ID, 0xfffffffe },
	{ }
};

MODULE_DEVICE_TABLE(mdio, upd60620_tbl);

Annotation

Implementation Notes