static err_t low_level_output(struct netif *netif, struct pbuf *p) { // struct ethernetif *ethernetif = netif->state; struct pbuf *q; // uint32_t i; u32_t tx_len; tx_len = 0; #if ETH_PAD_SIZE pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ #endif for (q = p; q != NULL; q = q->next) { memcpy(&gTxBuf[tx_len], q->payload, q->len); tx_len += q->len; } ENET_MacSendData(gTxBuf, tx_len); // printf("sending frame:%d!!!!!!!!!!!!!\r\n", tx_len); //for(i=0;i<tx_len;i++) { // printf("%x ", gTxBuf[i]); } // printf("\r\n"); #if ETH_PAD_SIZE pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ #endif LINK_STATS_INC(link.xmit); return ERR_OK; }
//发送一包数据 void tapdev_send(void) { ENET_MacSendData(uip_buf, uip_len); // UART_printf("MacSend:%d\r\n", uip_len); }