net: axi_emac: Split recv from free_pkt
authorMichal Simek <michal.simek@xilinx.com>
Wed, 9 Dec 2015 13:13:23 +0000 (14:13 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 14:55:51 +0000 (15:55 +0100)
Call net_process_received_packet() by core.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/xilinx_axi_emac.c

index 172ccc5b952bdb198906f43029e22f8bbd4b970f..adfee8c151238aa5b85d3875a52c229f30c4d577 100644 (file)
@@ -571,9 +571,14 @@ static int axiemac_recv(struct udevice *dev, int flags, uchar **packetp)
 #ifdef DEBUG
        print_buffer(&rxframe, &rxframe[0], 1, length, 16);
 #endif
-       /* Pass the received frame up for processing */
-       if (length)
-               net_process_received_packet(rxframe, length);
+
+       *packetp = rxframe;
+       return length;
+}
+
+static int axiemac_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+       struct axidma_priv *priv = dev_get_priv(dev);
 
 #ifdef DEBUG
        /* It is useful to clear buffer to be sure that it is consistent */
@@ -655,6 +660,7 @@ static const struct eth_ops axi_emac_ops = {
        .start                  = axiemac_init,
        .send                   = axiemac_send,
        .recv                   = axiemac_recv,
+       .free_pkt               = axiemac_free_pkt,
        .stop                   = axiemac_halt,
        .write_hwaddr           = axiemac_setup_mac,
 };