public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: lesc <lesc@zhaw.ch>
To: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] How to attach higher ethernet stacks to the MAC driver
Date: Tue, 26 May 2015 08:15:00 -0000	[thread overview]
Message-ID: <55642BB2.6080403@zhaw.ch> (raw)
In-Reply-To: <55642B08.4000502@zhaw.ch>


Hi

On 21.05.2015 18:39, Incubus84@web.de wrote:
> Hi all,
>   
> I have a question regarding the connection between a mac-/phy-driver and a third
> party tcp / ip stack. In the mac layer I have functions like
> y_eth_isr, y_eth_init, y_eth_send, y_eth_recv, ... and many more.
>   
> In y_eth_init I attached an ISR (y_eth_isr) and the default DSR (eth_drv_dsr).
>   
> As far as I understood, the data flow is as follows:
> 1) The MAC (Hardware) receives an ethernet frame and creates an interrupt
> 2) y_eth_isr is called ( ret = (CYG_ISR_HANDLED | CYG_ISR_CALL_DSR); )
> 3) The default eth_drv_dsr is called
> 4) y_eth_deliver is called
> 5) y_eth_poll is called
> 6) The default eth_drv_recv is called
> 7) y_eth_recv in the mac driver is called
This seems correct so far.
>   
> This is not what I really could proove but what I investigated by reading the
> documentation and source code. Now.. my consideration was that I simply have to
> add the call to the receive function of the tcp/ip stack in y_eth_recv. Is this
> the right approach?
Well I thik it's depends on the Stack. The FreeBSD-Stack does some more 
things on the eth_drv Level.
ether_input 	Net/bsd_tcpip/current/sry/sys/net/if_ethersubr.c
ether_demux
	Net/bsd_tcpip/current/sry/sys/net/if_ethersubr.c


after this two routines the packet is handed over to ip_input wich runs 
on a lower priority. I would presume you would also need to do some 
things before calling the tcp stack to be 802.1 compliant. Maybe these 
files give you an input.
>   
> Another point: how can I reliable test the function of my hardware? I plugged in
> my device into an ethernet switch which says that there is a link. Using ipconfig
> under Windows just says -not connected-. Using ping is not a solution of course,
> because I have no ip address...
This is a hard one. Testing on this level is not easy. If you just want 
to see if the stack is running. You could also use arping and see with 
wireshark if you detect an answer. Testing of the whole system is much 
more difficult, you would need some sort of Mock /virtalisation of the 
different layers, which is really hard because of the timings etc.
>   
> And a third question: in the send function of the tcp/ip stack I have to forward
> the send buffer to y_eth_send in the mac layer. I simply do this by calling
> y_eth0_sc.funs->send(...). Is this the suitable way?
>   
This sounds also fine. Of course someone must handle the memory 
management of the sendbuffer.
> Kind Regards,
> Dennis
>   

I hope this helps
Serafin

-- 
Serafin Leschke, BSc in Computer Science UAS Zurich
Research Assistant




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

       reply	other threads:[~2015-05-26  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55642B08.4000502@zhaw.ch>
2015-05-26  8:15 ` lesc [this message]
2015-05-21 16:39 Incubus84

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55642BB2.6080403@zhaw.ch \
    --to=lesc@zhaw.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).