-/*
-
- etherdev_read()
-
- This function will read an entire IP packet into the uip_buf.
- If it must wait for more than 0.5 seconds, it will return with
- the return value 0. Otherwise, when a full packet has been read
- into the uip_buf buffer, the length of the packet is returned.
-
- */
-unsigned int etherdev_read(void)
-{
- unsigned int bytes_read;
-
- /* tick_count threshold should be 12 for 0.5 sec bail-out
- One second (24) worked better for me, but socket recycling
- is then slower. I set UIP_TIME_WAIT_TIMEOUT 60 in uipopt.h
- to counter this. Retransmission timing etc. is affected also. */
- while ((!(bytes_read = etherdev_poll())) && (tick_count < 12)) continue;
-
- tick_count = 0;
-
- return bytes_read;
-}
-