- Register = in_be32 (BaseAddress + XEL_RSR_OFFSET);
- Register &= ~XEL_RSR_RECV_DONE_MASK;
- out_be32 (BaseAddress + XEL_RSR_OFFSET, Register);
+ reg = in_be32 (baseaddress + XEL_RSR_OFFSET);
+ reg &= ~XEL_RSR_RECV_DONE_MASK;
+ out_be32 (baseaddress + XEL_RSR_OFFSET, reg);
+
+ debug("Packet receive from 0x%x, length %dB\n", baseaddress, length);
+ NetReceive((uchar *) etherrxbuff, length);
+ return length;
+
+}
+
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
+ int txpp, int rxpp)
+{
+ struct eth_device *dev;
+ struct xemaclite *emaclite;
+
+ dev = calloc(1, sizeof(*dev));
+ if (dev == NULL)
+ return -1;
+
+ emaclite = calloc(1, sizeof(struct xemaclite));
+ if (emaclite == NULL) {
+ free(dev);
+ return -1;
+ }
+
+ dev->priv = emaclite;
+
+ emaclite->txpp = txpp;
+ emaclite->rxpp = rxpp;
+
+ sprintf(dev->name, "Xelite.%lx", base_addr);
+
+ dev->iobase = base_addr;
+ dev->init = emaclite_init;
+ dev->halt = emaclite_halt;
+ dev->send = emaclite_send;
+ dev->recv = emaclite_recv;
+
+ eth_register(dev);