[U-Boot-Users] recieving network packets ?

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; }

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

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.

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%103432&bid#0486&dat%12... _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

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

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@denx.de The sooner our happiness together begins, the longer it will last. -- Miramanee, "The Paradise Syndrome", stardate 4842.6

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
participants (3)
-
Andrew Wozniak
-
Maximus
-
Wolfgang Denk