/* Maximum receive ring size; that is, the number of packets we can buffer before overflow happens. Basically, this just needs to be enough to prevent a packet being discarded while we are processing the previous one.  */
static int ks8851_mll_recv(struct eth_device *dev)
/* Maximum receive ring size; that is, the number of packets we can buffer before overflow happens. Basically, this just needs to be enough to prevent a packet being discarded while we are processing the previous one.  */
static int ks8851_mll_recv(struct eth_device *dev)
{
	u16 status;
	status = ks_rdreg16(dev, KS_ISR);
	ks_wrreg16(dev, KS_ISR, status);
	if ((status & IRQ_RXI))
		ks_rcv(dev, (uchar **)net_rx_packets);
	if ((status & IRQ_LDI)) {
		u16 pmecr = ks_rdreg16(dev, KS_PMECR);
		pmecr &= ~PMECR_WKEVT_MASK;
		ks_wrreg16(dev, KS_PMECR, pmecr | PMECR_WKEVT_LINK);
	}
	return 0;
}