All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] recieving network packets ?
@ 2006-01-25 14:03 Maximus
  2006-01-25 14:56 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Maximus @ 2006-01-25 14:03 UTC (permalink / raw)
  To: u-boot

Hi,
   I uboot - i want to recieve network packets.  I wrote a small
program using  the code available in uboot.
   However its not working ?.    Can anyone point me where i am going wrong ?.


   I am trying to write a server kind of a cmd - which recieves some
requests from host and
   carries out some actions.



   I just want UdpProtoHandler to be called whenever the ethernet
controller recieves a packet.

    As a start, i am sending raw ethernet packets on the network.


    But, NetReceive Function is not getting called.


    Why ?. Am i doing something wrong ?.




    Regards,

     John



My Code,

static void UdpProtoHandler (uchar * pkt, unsigned dest, unsigned src,
unsigned len) ;
static void udptimeout (void)
{
    NetSetTimeout (100 * CFG_HZ, udptimeout) ;
    NetState = NETLOOP_CONTINUE;
}

int send_udp (void)
{
    DECLARE_GLOBAL_DATA_PTR;

    eth_halt();

    if (eth_init(bd) < 0)
        return(-1);

    NetState = NETLOOP_CONTINUE;
    NetSetTimeout (10 * CFG_HZ, udptimeout);
    NetSetHandler (UdpProtoHandler) ;

    return 1 ;
}

static void UdpProtoHandler (uchar * pkt, unsigned dest, unsigned src,
unsigned len)
{

    puts ("handler:-------------------\n") ;
    printf ("dest : %u src:%u and length : %u\n", dest, src, len) ;

    while (len > 0) {
        printf ("%c", *pkt) ;
        pkt++ ; len-- ;
    }

    puts ("\ndone\n") ;
    NetState = NETLOOP_SUCCESS;
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-01-27 10:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-25 14:03 [U-Boot-Users] recieving network packets ? Maximus
2006-01-25 14:56 ` Wolfgang Denk
2006-01-26 11:23   ` [U-Boot-Users] " Maximus
2006-01-26 14:26     ` Andrew Wozniak
2006-01-26 20:58     ` Wolfgang Denk
2006-01-27  5:31       ` Maximus
2006-01-27 10:04         ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.