This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "packets eaten" with AT91 EMAC Ethernet driver



----- Original Message ----- From: "Jürgen Lambrecht" <J.Lambrecht@televic.com>
To: <ecos-discuss@ecos.sourceware.org>
Cc: "Andrew Lunn" <andrew@lunn.ch>; "I-Yanaslov" <yanaslov_iv@ic-bresler.ru>
Sent: Tuesday, June 10, 2008 8:11 PM
Subject: Re: [ECOS] "packets eaten" with AT91 EMAC Ethernet driver



Lambrecht Jürgen wrote:

Indeed, that was the problem:
Wrong code in at91_eth_deliver():

  if (tsr&AT91_EMAC_TSR_COMP) //5
  {
     at91_reset_tbd(priv);
     _eth_drv_tx_done(sc,priv->curr_tx_key,0);
     priv->tx_busy = false;
  }

Correct code:
  {
     at91_reset_tbd(priv, b_reset_tbd_idx);
     priv->tx_busy = false;
     _eth_drv_tx_done(sc,priv->curr_tx_key,0);
  }

If the low-level driver is available (can_send() returns not zero) then the first packet is sent.
If the low-level driver is not available it stops here. It is supposed that the low-level driver will inform then the middleware when it is ready by calling tx_done.
eth_drv_tx_done on its turn calls eth_drv_send() which then checks again can_send()


The AT91 driver first called tx_done, calling send calling can_send which returns 0 of course.
And afterwards - too late - busy is set to true, so that can_send can return 1...

"priv->tx_busy = false;" is not consumes many time.
So, ISR is better place to do it.
Than, TX driver becomes to ready (can_send() returns 1 ) just at moment whan a HW becomes to ready, even if DSR and __eth_drv_tx_done() is still running.


Ivan.


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]