(某些网络操作(ping / tftp / whatever...))eth_init() ops->start()eth_send() ops->send()eth_rx() ops->recv() (处理包) 如果 (ops->free_pkt) ops->free_pkt()eth_halt() ops->stop() CONFIG_PHYLIB / CONFIG_CMD_MII 如果你的设备支持在 MII 总线上使用任意值(几乎所有设备都支持),...
#define CONFIG_YYY_ETH_SPI_BUS 0 #define CONFIG_YYY_ETH_SPI_CS 0 代码流程 Uboot下PHYCHIP的驱动代码由一些函数构成,这些函数包含在文件PHYCHIP.c中,位于drivers/net/目录下,具体包含的函数以及含义如下: eth_init() eth_send() //链路层数据包发送 eth_rx() //链路层数据包接收 eth_halt() encRec...
void eth_halt(void) { struct udevice *current; struct eth_device_priv *priv; current = eth_get_dev(); if (!current || !eth_is_active(current)) return; eth_get_ops(current)->stop(current); priv = current->uclass_priv; if (priv) priv->state = ETH_STATE_PASSIVE; } 1. 2. 3....
注释掉下面2行 修正一直无法收到数据的错误,不要每次调用halt的时候都对PHY进行复位操作,否则会引起无法接受到数据的情况 [cpp]view plaincopyprint? void eth_halt(void) { DM9000_DBG("eth_halt\n"); /* RESET devie */ //phy_write(0, 0x8000); /* PHY RESET */ //DM9000_iow(DM9000_GPR, 0x01...
64 eth_halt(); 65 puts ("\nAbort by Ctrl+C\n"); 66 return (-1); 67 } 68 } 69 } 6. 修改net目录下的makefile,添加 COBJS-$(CONFIG_CMD_NET) += udp.o 7. 这样操作后可以通过udp_b命令发送和接收UDP广播了。实际跑在板子上能发送UDP广播,但接收不到UDP广播包。
eth_rx();471472 /*473 * Abort if ctrl-c was pressed.474 */475 if (ctrlc()) {476 /* cancelanyARP that maynothave completed */477 NetArpWaitPacketIP = 0;478479 net_cleanup_loop();480 eth_halt();481 /* Invalidate thelastprotocol */482 eth_set_last_protocol(BOOTP);483484 puts(...
542 eth_halt(); 543 else 544 eth_halt_state_only(); 545 546 eth_set_last_protocol(protocol); 547 548 ret = NetBootFileXferSize; 549 debug_cond(DEBUG_INT_STATE, "--- NetLoop Success!n"); 550 goto done; 551 552 case NETLOOP_FAIL: ...
542 eth_halt(); 543 else 544 eth_halt_state_only(); 545 546 eth_set_last_protocol(protocol); 547 548 ret = NetBootFileXferSize; 549 debug_cond(DEBUG_INT_STATE, "--- NetLoop Success!"); 550 goto done; 551 552 case NETLOOP_FAIL: ...
eth_halt(); return NetBootFileXferSize; case NETLOOP_FAIL: return (-1); } PingHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len) { IPaddr_t tmp; volatile IP_t *ip = (volatile IP_t *)pkt; tmp = NetReadIP((void *)&ip->ip_src); ...
vi drivers/dm9000x.c void eth_halt(void) { // DM9000_DBG("eth_halt/n"); /* RESET devie */ // phy_write(0, 0x8000); /* PHY RESET */ // DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */ // DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */ ...