lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Hardware - level for netif_remove()


From: Christian Steffen
Subject: Re: [lwip-users] Hardware - level for netif_remove()
Date: Fri, 07 May 2010 17:10:08 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4

Hi Martin,

your're right. I won't modify the "netif". And with the buggy Atmel MACB driver you're right, too.

In my mind I will add an interface with netif_add() and give this function the function to initialize the hardware. When I will remove this interface in call the netif_remove() function and give them a function to close the Hardware. In my eyes there should be a low_level_init/add(), low_level_input(), low_level_output() and consequently a low_level_remove(). Sure, I can call my own low_level_remove() after a netif_remove(), but it's not the most beautiful way.

Mit freundlichen Grüßen / Best Regards
Christian Steffen

Am 07.05.2010 16:29, schrieb Martin Persich
you can't modify LwIP "netif" file for close of Ethernet hardware, I think.
It is sufficiet only to modify function "low_level_output" in "ethernetif.c"
file. You can add condition in the first line of this function - if ethernet
hardware is not running - then immediately return. LwIP dont't need any
additional information about it. This is the same as problem on LAN, when
data packet is not deliverer to target device, I think.
And then you need to stop reading of incomming packet from MACB in "ETHINT"
task. But the main problem is in original "macb.c" file from Atmel Software
Framework (V 1.7.0), by my mind. If you disabling MACB hardware (function
"vDisableMACBOperations" in "macb.c" file), there is a problem with next
callig of "xMACBInit" function. Many functions of MACB driver ("macb.c")
uses local variables and there is no way to clear this variables after new
initialization. I have my own version of MACB driver in this moment which
solve this problems and allows restart of autonegotiation process if
ethernet cable is unplugged and then conected to switch with another
parameters (speed, FDX/HDX, ...). I believe that version Atmel SF 1.8.0 will
be OK !
Best Regards
Martin Persich




----- Original Message -----
From: "Christian Steffen"<address@hidden>
To: "Mailing list for lwIP users"<address@hidden>
Sent: Friday, May 07, 2010 7:58 AM
Subject: Re: [lwip-users] Hardware - level for netif_remove()


I know this function. But this function don't call any hardware function
stubs. When I add an Interface with netif_add() I refer a init routine
and a input routine. For the AVR32 Port this are ethernetif_init() and
ethernetif_input(). In the netif_remove() is no call to a similar
ethernetif_remove().

In the Context of lwIP, FreeRTOS and AVR32 starts a thread, that puts
the incomming data from MAC to the lwIP. And this task running along
when I remove this Interface.

Mit freundlichen Grüßen
Christian Steffen

Am 06.05.2010 21:52, schrieb Martin Velek:
Hi,

it should be. Check this link -
http://www.nongnu.org/lwip/netif_8c.html#9c6e541f0c184e1ea61a5cd8afe3e979

On 6 May 2010 09:21, Christian Steffen
<address@hidden>   wrote:

Hi,

for my application it's necessary to close the Ethernet hardware.
The initialisation routine is called by netif_add. Is there a responding
routine in netif_remove, that I have overlook?

I know, the ethernetif.c is a portable file of the AVR32 port and so my
problem :) . But the netif.c is a core file and I want modify the core
files
as less as possible.


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]