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: Bill Auerbach
Subject: RE: [lwip-users] Hardware - level for netif_remove()
Date: Fri, 7 May 2010 17:24:52 -0400

Perhaps the function passed to netif_add could take a 2nd argument.  Use
this in netif_add:

  /* call user specified initialization function for netif */
  if (init(netif,1) != ERR_OK) {
    return NULL;
  }

And this in netif_remove:

  /* call user specified initialization function for netif */
  if (init(netif,0) != ERR_OK) {
    return NULL;
  }

Impact on existing ports is minimal.  If netif_remove isn't called, the
second parameter can simply be ignored in the init function.

Bill

>-----Original Message-----
>From: address@hidden
>[mailto:address@hidden On
>Behalf Of Martin Persich
>Sent: Friday, May 07, 2010 11:52 AM
>To: Mailing list for lwIP users
>Subject: Re: [lwip-users] Hardware - level for netif_remove()
>
>Hi Christian,
>yes, there is missing low-level function called from "netif_remove"
>alike as
>function parameter "netif_init_fn init" in function "netif_add". Perhaps
>in
>LwIP 1.4.0 ...
>I am consulting bugs in MACB driver with Atmel's tech.support in this
>moment.
>I can offer you my version of "ethernetif.c" and "macb.c" file if you
>want.
>Best Regards
>Martin Persich
>
>
>----- Original Message -----
>From: "Christian Steffen" <address@hidden>
>To: "Mailing list for lwIP users" <address@hidden>
>Sent: Friday, May 07, 2010 5:10 PM
>Subject: Re: [lwip-users] Hardware - level for netif_remove()
>
>
>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#9c6e541f0c184e1ea61a5cd8afe3e97
>9
>>>
>>> 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
>>
>
>
>_______________________________________________
>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]