Ejemplo n.º 1
0
void network_send(void)
{
	if (uip_len > 0) {
		if(uip_len <= UIP_LLH_LEN + 40){
			zg_set_buf(uip_buf, uip_len);
		}
		else{
			memcpy((u8*)&uip_buf[54], (u8*)uip_appdata, (uip_len-54));
			zg_set_buf(uip_buf, uip_len);
		}
		zg_set_tx_status(1);
	}
}
Ejemplo n.º 2
0
void nic_send(void)
{
	if(uip_len < UIP_PAYLOADSIZE)
	{	
		// Transfer the message to the Wifi controller
		zg_set_buf((U8 *)uip_buf, uip_len);
		zg_set_tx_status(1);
	}
	
	// Process the in/out data from the Wifi controller
	zg_drv_process();	
	
}
Ejemplo n.º 3
0
static err_t
low_level_output(struct netif *netif, struct pbuf *p)
{
  struct g2100if *g2100if = netif->state;
  struct pbuf *q;

  // ***
  //initiate transfer();
  
#if ETH_PAD_SIZE
  pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
#endif

  for(q = p; q != NULL; q = q->next) {
    /* Send the data from the pbuf to the interface, one pbuf at a
       time. The size of the data in each pbuf is kept in the ->len
       variable. */
    // ***
    //send data from(q->payload, q->len);
    zg_set_buf(q->payload, q->len);
	zg_set_tx_status(1);
    while (!zg_get_cnf_pending()) { // wait until transfer is confirmed
    	zg_drv_process();
    }
  }

  // ***
  //signal that packet should be sent();

#if ETH_PAD_SIZE
  pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
#endif
  
  LINK_STATS_INC(link.xmit);

  return ERR_OK;
}