void fm_disable_port(enum fm_port port) { int i = fm_port_to_index(port); fm_info[i].enabled = 0; fman_disable_port(port); }
/* * Returns the PHY address for a given Fman port * * The port must be set via a prior call to fm_info_set_phy_address(). * A negative error code is returned if the port is invalid. */ int fm_info_get_phy_address(enum fm_port port) { int i = fm_port_to_index(port); if (i == -1) return -1; return fm_info[i].phy_addr; }
void fm_info_set_phy_address(enum fm_port port, int address) { int i = fm_port_to_index(port); if (i == -1) return; fm_info[i].phy_addr = address; }
void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus) { int i = fm_port_to_index(port); if (i == -1) return; fm_info[i].bus = bus; }
void fm_enable_port(enum fm_port port) { int i = fm_port_to_index(port); if (i == -1) return; fm_info[i].enabled = 1; fman_enable_port(port); }
/* * Returns the type of the data interface between the given MAC and its PHY. * This is typically determined by the RCW. */ phy_interface_t fm_info_get_enet_if(enum fm_port port) { int i = fm_port_to_index(port); if (i == -1) return PHY_INTERFACE_MODE_NONE; if (fm_info[i].enabled) return fm_info[i].enet_if; return PHY_INTERFACE_MODE_NONE; }