mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC] [WIP] net: add initial ENC28J60 support
Date: Wed, 11 Jun 2014 08:23:35 +0200	[thread overview]
Message-ID: <20140611062335.GY15686@pengutronix.de> (raw)
In-Reply-To: <20140611074800.6f02ad5d6eb98b467cd94032@gmail.com>

On Wed, Jun 11, 2014 at 07:48:00AM +0400, Antony Pavlov wrote:
> On Tue, 10 Jun 2014 09:08:33 +0200
> Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> > Hi Antony,
> > 
> > On Fri, Jun 06, 2014 at 12:02:57PM +0400, Antony Pavlov wrote:
> 
> Thanks for comments!
> But there is one issue (see below).
> 
> ...
> 
> > > +
> > > +static int enc28j60_eth_rx(struct eth_device *edev)
> > > +{
> > > +	struct enc28j60_net *priv = edev->priv;
> > > +	int pk_counter;
> > > +
> > > +	pk_counter = locked_regb_read(priv, EPKTCNT);
> > > +	if (pk_counter && netif_msg_intr(priv))
> > > +		printk(KERN_DEBUG DRV_NAME ": intRX, pk_cnt: %d\n", pk_counter);
> > > +
> > > +	if (pk_counter > priv->max_pk_counter) {
> > > +		priv->max_pk_counter = pk_counter;
> > > +		if (netif_msg_rx_status(priv) && priv->max_pk_counter > 1)
> > > +			printk(KERN_DEBUG DRV_NAME ": RX max_pk_cnt: %d\n",
> > > +				priv->max_pk_counter);
> > > +	}
> > > +
> > > +	while (pk_counter-- > 0)
> > > +		enc28j60_hw_rx(edev);
> > 
> > You should only receive a single packet in your receive function.
> > Otherwise some protocols may not function properly. We noticed this
> > recently and didn't have the chance to fix all drivers.
> > 
> 
> If I receive only one packet (I have simply dropped 'while (pk_counter-- > 0)')
> then tftp does not work.

Does pk_counter have the correct value the second time you read from
EPKTCNT?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-06-11  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  8:02 Antony Pavlov
2014-06-10  7:08 ` Sascha Hauer
2014-06-11  3:48   ` Antony Pavlov
2014-06-11  6:23     ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140611062335.GY15686@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox