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

* [U-Boot-Users] recieving network packets ?
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2006-01-25 14:56 UTC (permalink / raw)
  To: u-boot

In message <3634de740601250603r38b2b323i4a075f7fcabe5260@mail.gmail.com> you wrote:
>
>    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>  ?.

Which protocol are you trying to implement?

Did you read  the  description  in  net/net.c,  and  did  you  extend
NetLoop()  for  your  protocol? You don;t mention any of this in your
code snippet...

And did you try enabling DEBUG messages in the network code?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bankers do it with interest (penalty for early withdrawal).

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

* [U-Boot-Users] Re: recieving network packets ?
  2006-01-25 14:56 ` Wolfgang Denk
@ 2006-01-26 11:23   ` Maximus
  2006-01-26 14:26     ` Andrew Wozniak
  2006-01-26 20:58     ` Wolfgang Denk
  0 siblings, 2 replies; 7+ messages in thread
From: Maximus @ 2006-01-26 11:23 UTC (permalink / raw)
  To: u-boot

On 1/25/06, Wolfgang Denk <wd@denx.de> wrote:
> In message <3634de740601250603r38b2b323i4a075f7fcabe5260@mail.gmail.com> you
> wrote:
> >
> >    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>  ?.
>
> Which protocol are you trying to implement?

   Its an application level protocol using UDP. i am able to send
packet but unable to recieve
   packets.

   I am trying to add a command which when executed, just acts like a
server - it just recieves some packets from a remote host and takes
action.

   i am having trouble in just doing that. i read the description in net/net.c.


   Could u please help me on this. please let me know where am i doing wrong.

   i am implementing a command  it does not send any packets - it just
recieves packets
   from a remote host. (Just like a server in network applications.)



Regards,
John.

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

* [U-Boot-Users] Re: recieving network packets ?
  2006-01-26 11:23   ` [U-Boot-Users] " Maximus
@ 2006-01-26 14:26     ` Andrew Wozniak
  2006-01-26 20:58     ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Wozniak @ 2006-01-26 14:26 UTC (permalink / raw)
  To: u-boot

Maximus wrote:
> On 1/25/06, Wolfgang Denk <wd@denx.de> wrote:
>> In message <3634de740601250603r38b2b323i4a075f7fcabe5260@mail.gmail.com> you
>> wrote:
>>>    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>  ?.
>>
>> Which protocol are you trying to implement?
> 
>    Its an application level protocol using UDP. i am able to send
> packet but unable to recieve
>    packets.
> 
>    I am trying to add a command which when executed, just acts like a
> server - it just recieves some packets from a remote host and takes
> action.
> 
>    i am having trouble in just doing that. i read the description in net/net.c.
> 
> 
>    Could u please help me on this. please let me know where am i doing wrong.
> 
>    i am implementing a command  it does not send any packets - it just
> recieves packets
>    from a remote host. (Just like a server in network applications.)

UBoot has a netconsole capability which listens via UDP. Why not try 
using this feature instead of inventing something new.

Once you have netconsole configured and working, a remote client can 
send a UBoot command, shell script, custom command or even a UBoot applet.

> 
> 
> Regards,
> John.
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=k&kid\x103432&bid#0486&dat\x121642
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 

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

* [U-Boot-Users] Re: recieving network packets ?
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2006-01-26 20:58 UTC (permalink / raw)
  To: u-boot

In message <3634de740601260323l57a698beh2636f99d70dddd98@mail.gmail.com> you wrote:
>
>    Its an application level protocol using UDP. i am able to send
                                                  ^^^^^^^^^^^^^^^^^
> packet but unable to recieve
             ^^^^^^^^^^^^^^^^^
>    packets.
...
>    i am implementing a command  it does not send any packets - it just
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^      ^^^^
> recieves packets
  ^^^^^^^^

Your problem description is confusing.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The sooner our happiness together begins, the longer it will last.
	-- Miramanee, "The Paradise Syndrome", stardate 4842.6

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

* [U-Boot-Users] Re: recieving network packets ?
  2006-01-26 20:58     ` Wolfgang Denk
@ 2006-01-27  5:31       ` Maximus
  2006-01-27 10:04         ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Maximus @ 2006-01-27  5:31 UTC (permalink / raw)
  To: u-boot

Hi,
    I just want to implement a command which just recieves commands
(UDP Packets) from
remote and executes them.

Just a standalone function which does the same.

Is this possible in u-boot ?

I was just thinking of using Main packet reception loop in NetLoop
Function - something like
calling eth_rx within a loop.


What does WATCHDOG_RESET do ?. is it neccessary to include in such a loop ?

Regards,
John

On 1/27/06, Wolfgang Denk <wd@denx.de> wrote:
> In message <3634de740601260323l57a698beh2636f99d70dddd98@mail.gmail.com> you
> wrote:
> >
> >    Its an application level protocol using UDP. i am able to send
>                                                   ^^^^^^^^^^^^^^^^^
> > packet but unable to recieve
>              ^^^^^^^^^^^^^^^^^
> >    packets.
> ...
> >    i am implementing a command  it does not send any packets - it just
>                                      ^^^^^^^^^^^^^^^^^^^^^^^^^      ^^^^
> > recieves packets
>   ^^^^^^^^
>
> Your problem description is confusing.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> The sooner our happiness together begins, the longer it will last.
> 	-- Miramanee, "The Paradise Syndrome", stardate 4842.6
>

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

* [U-Boot-Users] Re: recieving network packets ?
  2006-01-27  5:31       ` Maximus
@ 2006-01-27 10:04         ` Wolfgang Denk
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2006-01-27 10:04 UTC (permalink / raw)
  To: u-boot

In message <3634de740601262131n53583c14y8ad5889c2d6b9efc@mail.gmail.com> you wrote:
>
>     I just want to implement a command which just recieves commands
> (UDP Packets) from
> remote and executes them.
> 
> Just a standalone function which does the same.

Why are yoiu re-inventing the wheel?  As  mentioned  before,  U-Booit
supports the netconsole protocol. Just use the existing code.

> Is this possible in u-boot ?

Of course it is.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never call a man a fool.  Borrow from him.

^ 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.