MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / designware_eth_enable

Function designware_eth_enable

bsp/cvitek/drivers/libraries/eth/dw_eth_mac.c:275–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275static 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}
297static int32_t designware_eth_disable(eth_mac_handle_t handle, int32_t arg)
298{
299 gmac_dev_t *mac_dev = (gmac_dev_t *)handle;

Callers 1

cvi_eth_mac_controlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected