[RFC] [WIP] net: add initial ENC28J60 support

Antony Pavlov antonynpavlov at gmail.com
Tue Jun 10 20:48:00 PDT 2014


On Tue, 10 Jun 2014 09:08:33 +0200
Sascha Hauer <s.hauer at 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.

-- 
Best regards,
  Antony Pavlov



More information about the barebox mailing list