Lines Matching +full:self +full:- +full:power
1 // SPDX-License-Identifier: GPL-2.0
45 fn read(&self, dev: &mut Device) -> Result<u16>; in read() argument
48 fn write(&self, dev: &mut Device, val: u16) -> Result; in write() argument
51 fn read_status(dev: &mut Device) -> Result<u16>; in read_status()
60 pub const BMCR: Self = C22(0x00);
62 pub const BMSR: Self = C22(0x01);
64 pub const PHYSID1: Self = C22(0x02);
66 pub const PHYSID2: Self = C22(0x03);
67 /// Auto-negotiation advertisement.
68 pub const ADVERTISE: Self = C22(0x04);
69 /// Auto-negotiation link partner base page ability.
70 pub const LPA: Self = C22(0x05);
71 /// Auto-negotiation expansion.
72 pub const EXPANSION: Self = C22(0x06);
73 /// Auto-negotiation next page transmit.
74 pub const NEXT_PAGE_TRANSMIT: Self = C22(0x07);
75 /// Auto-negotiation link partner received next page.
76 pub const LP_RECEIVED_NEXT_PAGE: Self = C22(0x08);
77 /// Master-slave control.
78 pub const MASTER_SLAVE_CONTROL: Self = C22(0x09);
79 /// Master-slave status.
80 pub const MASTER_SLAVE_STATUS: Self = C22(0x0a);
82 pub const PSE_CONTROL: Self = C22(0x0b);
84 pub const PSE_STATUS: Self = C22(0x0c);
86 pub const MMD_CONTROL: Self = C22(0x0d);
88 pub const MMD_DATA: Self = C22(0x0e);
90 pub const EXTENDED_STATUS: Self = C22(0x0f);
93 pub const fn vendor_specific<const N: u8>() -> Self { in vendor_specific() argument
96 "Vendor-specific register address must be between 16 and 31" in vendor_specific()
105 fn read(&self, dev: &mut Device) -> Result<u16> { in read() argument
111 bindings::mdiobus_read((*phydev).mdio.bus, (*phydev).mdio.addr, self.0.into()) in read()
117 fn write(&self, dev: &mut Device, val: u16) -> Result { in write() argument
123 bindings::mdiobus_write((*phydev).mdio.bus, (*phydev).mdio.addr, self.0.into(), val) in write()
127 fn read_status(dev: &mut Device) -> Result<u16> { in read_status()
129 // SAFETY: `phydev` is pointing to a valid object by the type invariant of `Self`. in read_status()
143 pub const PMAPMD: Self = Mmd(uapi::MDIO_MMD_PMAPMD as u8);
145 pub const WIS: Self = Mmd(uapi::MDIO_MMD_WIS as u8);
147 pub const PCS: Self = Mmd(uapi::MDIO_MMD_PCS as u8);
149 pub const PHYXS: Self = Mmd(uapi::MDIO_MMD_PHYXS as u8);
151 pub const DTEXS: Self = Mmd(uapi::MDIO_MMD_DTEXS as u8);
153 pub const TC: Self = Mmd(uapi::MDIO_MMD_TC as u8);
155 pub const AN: Self = Mmd(uapi::MDIO_MMD_AN as u8);
157 pub const SEPARATED_PMA1: Self = Mmd(8);
159 pub const SEPARATED_PMA2: Self = Mmd(9);
161 pub const SEPARATED_PMA3: Self = Mmd(10);
163 pub const SEPARATED_PMA4: Self = Mmd(11);
165 pub const OFDM_PMAPMD: Self = Mmd(12);
166 /// Power unit.
167 pub const POWER_UNIT: Self = Mmd(13);
169 pub const C22_EXT: Self = Mmd(uapi::MDIO_MMD_C22EXT as u8);
171 pub const VEND1: Self = Mmd(uapi::MDIO_MMD_VEND1 as u8);
173 pub const VEND2: Self = Mmd(uapi::MDIO_MMD_VEND2 as u8);
178 /// Clause 45 uses a 5-bit device address to access a specific MMD within
179 /// a port, then a 16-bit register address to access a location within
189 pub fn new(devad: Mmd, regnum: u16) -> Self { in new() argument
190 Self { devad, regnum } in new()
197 fn read(&self, dev: &mut Device) -> Result<u16> { in read() argument
202 unsafe { bindings::phy_read_mmd(phydev, self.devad.0.into(), self.regnum.into()) }; in read()
207 fn write(&self, dev: &mut Device, val: u16) -> Result { in write() argument
212 bindings::phy_write_mmd(phydev, self.devad.0.into(), self.regnum.into(), val) in write()
216 fn read_status(dev: &mut Device) -> Result<u16> { in read_status()
218 // SAFETY: `phydev` is pointing to a valid object by the type invariant of `Self`. in read_status()