14 #ifndef SATCAT5_MDIO_BUFFSIZE
15 #define SATCAT5_MDIO_BUFFSIZE 8
24 virtual void mdio_done(u16 regaddr, u16 regval) = 0;
31 void mdio_done(u16 regaddr, u16 regval)
override;
48 {
return m_addr_rdcount < SATCAT5_MDIO_BUFFSIZE;}
52 bool direct_write(
unsigned phy,
unsigned reg,
unsigned data);
58 bool direct_read(
unsigned phy,
unsigned reg,
unsigned ref,
67 bool hw_wr_command(u32 cmd);
73 unsigned m_addr_rdcount;
74 unsigned m_addr_rdidx;
75 u16 m_addr_buff[SATCAT5_MDIO_BUFFSIZE];
87 : m_mdio(mdio), m_phy(phyaddr) {}
91 virtual bool write(
unsigned reg,
unsigned data) = 0;
101 const unsigned m_phy;
108 bool write(
unsigned reg,
unsigned data)
override;
116 bool write(
unsigned reg,
unsigned data)
override;
ConfigBus core definitions.
const unsigned REGADDR_ANY
Shortcut for don't-care register address.
Prototype for the cfg::Mdio callback interface.
MMD standard (e.g., Atheros AR8031, Texas Instruments DP83867).
bool write(unsigned reg, unsigned data) override
Read and write methods allow indirect access.
bool read(unsigned reg, satcat5::cfg::MdioEventListener *callback) override
Read and write methods allow indirect access.
Interface object for a "cfgbus_mdio" block (direct registers only).
bool can_read() const
Is there space in the callback queue? (Note: Reads may still fail if hardware queue is full....
bool direct_write(unsigned phy, unsigned reg, unsigned data)
Direct write to designated MDIO register.
Mdio(satcat5::cfg::ConfigBus *cfg, unsigned devaddr, unsigned regaddr=satcat5::cfg::REGADDR_ANY)
Constructor ties this driver to a ConfigBus address.
bool direct_read(unsigned phy, unsigned reg, unsigned ref, satcat5::cfg::MdioEventListener *callback)
Direct read from designated MDIO register.
void poll_always()
Child class MUST override this method.
Example MdioEventListener that writes to the system log.
Marvell Alaska 88E1111 or 88E151x.
bool write(unsigned reg, unsigned data) override
Read and write methods allow indirect access.
bool read(unsigned reg, satcat5::cfg::MdioEventListener *callback) override
Read and write methods allow indirect access.
Helper class for indirect access register access.
virtual bool read(unsigned reg, satcat5::cfg::MdioEventListener *callback)=0
Read and write methods allow indirect access.
MdioWrapper(satcat5::cfg::Mdio *mdio, unsigned phyaddr)
Public constructor so we can inherit cleanly.
virtual bool write(unsigned reg, unsigned data)=0
Read and write methods allow indirect access.
Pointer-like wrapper for one or more ConfigBus registers.
An "Always" object is polled whenever service() is called.
Core event-processing loop for SatCat5 software.
Basic type aliases and prototypes used throughout SatCat5.