| 273 | } |
| 274 | |
| 275 | static int32_t designware_eth_enable(eth_mac_handle_t handle, int32_t control) |
| 276 | { |
| 277 | gmac_dev_t *mac_dev = (gmac_dev_t *)handle; |
| 278 | struct dw_gmac_mac_regs *mac_reg = mac_dev->priv->mac_regs_p; |
| 279 | eth_link_state_t link_state = mac_dev->phy_dev->link_state; |
| 280 | |
| 281 | // if (link_state == ETH_LINK_DOWN) |
| 282 | // return -1; |
| 283 | |
| 284 | switch (control) { |
| 285 | case CSI_ETH_MAC_CONTROL_TX: |
| 286 | mac_reg->conf |= CVI_TXENABLE; |
| 287 | break; |
| 288 | case CSI_ETH_MAC_CONTROL_RX: |
| 289 | mac_reg->conf |= CVI_RXENABLE; |
| 290 | break; |
| 291 | default: |
| 292 | break; |
| 293 | } |
| 294 | |
| 295 | return 0; |
| 296 | } |
| 297 | static int32_t designware_eth_disable(eth_mac_handle_t handle, int32_t arg) |
| 298 | { |
| 299 | gmac_dev_t *mac_dev = (gmac_dev_t *)handle; |
no outgoing calls
no test coverage detected