#if !defined(_AVM_NET_F24S_H_) #define _AVM_NET_F24S_H_ struct f24s_context { avmnet_module_t *this_module; struct semaphore mdio_lock; // mutex used for protecting local MDIO access }; #define F24S_SMDIO_ADDR 0x1F #define F24S_SMDIO_TARGET 0x0 #define F24S_TARGET_REG_OFF 0xF400 #define F24S_MMDIO_CTRL (0x08 + F24S_TARGET_REG_OFF) #define MMDIO_CTRL_BSY (0x1 << 12) #define MMDIO_CTRL_OP_SFT 10 #define MMDIO_CTRL_OP_MSK (0x3 << MMDIO_CTRL_OP_SFT) #define MMDIO_CTRL_OP_WR (0x1 << MMDIO_CTRL_OP_SFT) #define MMDIO_CTRL_OP_RD (0x2 << MMDIO_CTRL_OP_SFT) #define MMDIO_CTRL_PHYAD_SFT 5 #define MMDIO_CTRL_PHYAD_MSK (0x1F << MMDIO_CTRL_PHYAD_SFT) #define MMDIO_CTRL_REGAD_SFT 0 #define MMDIO_CTRL_REGAD_MSK (0x1F << MMDIO_CTRL_REGAD_SFT) #define F24S_MMDIO_READ (0x09 + F24S_TARGET_REG_OFF) #define F24S_MMDIO_WRITE (0x0A + F24S_TARGET_REG_OFF) /*------------------------------------------------------------------------------------------*\ \*------------------------------------------------------------------------------------------*/ int avmnet_f24s_lock(avmnet_module_t *this); void avmnet_f24s_unlock(avmnet_module_t *this); int avmnet_f24s_trylock(avmnet_module_t *this); int avmnet_f24s_status_poll(avmnet_module_t *this); int avmnet_f24s_setup_interrupt(avmnet_module_t *this, uint32_t on_off); int avmnet_f24s_setup(avmnet_module_t *this); int avmnet_f24s_init(avmnet_module_t *this); int avmnet_f24s_exit(avmnet_module_t *this); int avmnet_f24s_powerup(avmnet_module_t *this); int avmnet_f24s_powerdown(avmnet_module_t *this); int avmnet_f24s_suspend(avmnet_module_t *this, avmnet_module_t *caller); int avmnet_f24s_resume(avmnet_module_t *this, avmnet_module_t *caller); unsigned int avmnet_f24s_reg_read(avmnet_module_t *this, unsigned int phy_addr, unsigned int reg_addr); int avmnet_f24s_reg_write(avmnet_module_t *this, unsigned int phy_addr, unsigned int reg_addr, unsigned int write_data); int avmnet_f24s_set_status(avmnet_module_t *this, avmnet_device_t *id, avmnet_linkstatus_t status); void avmnet_f24s_status_changed(avmnet_module_t *this, avmnet_module_t *caller); int avmnet_f24s_vlan_setup(avmnet_module_t *this); #endif