SAMV7 EMAC: Sometimes TX is not started when TSTART is set??? Workaround seems to be to set it twice. Restored full optimization. Also CONFIG_NET_NOINTS is set so that interrupt level provessing is avoided

This commit is contained in:
Gregory Nutt 2015-03-28 09:42:45 -06:00
parent 750fad37f0
commit afd737ddcc

View File

@ -1318,7 +1318,7 @@ static int sam_transmit(struct sam_emac_s *priv, int qid)
(uintptr_t)txdesc->addr + dev->d_len);
}
/* Update TX descriptor status. */
/* Update TX descriptor status (with USED=0). */
status = dev->d_len | EMACTXD_STA_LAST;
if (txhead == priv->xfrq[qid].ntxbuffers - 1)
@ -1347,6 +1347,13 @@ static int sam_transmit(struct sam_emac_s *priv, int qid)
regval |= EMAC_NCR_TSTART;
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
/* REVISIT: Sometimes TSTART is missed? In this case, the symptom is
* that the packet is not sent until the next transfer when TXSTART
* is set again.
*/
sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval);
/* Setup the TX timeout watchdog (perhaps restarting the timer) */
(void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1,
@ -1515,7 +1522,7 @@ static void sam_dopoll(struct sam_emac_s *priv, int qid)
static int sam_recvframe(struct sam_emac_s *priv, int qid)
{
struct emac_rxdesc_s *rxdesc;
volatile struct emac_rxdesc_s *rxdesc;
struct net_driver_s *dev;
const uint8_t *src;
uint8_t *dest;