lwip-users
[Top][All Lists]
Advanced

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

Re:Re: [lwip-users] problem in using raw api for avr32uc3ax application


From: jini-2003
Subject: Re:Re: [lwip-users] problem in using raw api for avr32uc3ax application
Date: Wed, 3 Sep 2008 15:36:13 +0800 (CST)

Thx for your reply!I think I understand what you say generally.
There are several functions in ethernetif.c based FREERTOS(ethernetif.c come from an example project) as follows:
static void low_level_init(struct netif *netif)
{
//  struct ethernetif *ethernetif = netif->state;
  unsigned portBASE_TYPE uxPriority;
  /* maximum transfer unit */
  netif->mtu = netifMTU;
 
  /* broadcast capability */
  netif->flags = NETIF_FLAG_BROADCAST;
 
  /* Do whatever else is needed to initialize interface. */ 
  xNetIf = netif;
  /* Initialise the MACB.  This routine contains code that polls status bits.
  If the Ethernet cable is not plugged in then this can take a considerable
  time.  To prevent this starving lower priority tasks of processing time we
  lower our priority prior to the call, then raise it back again once the
  initialisation is complete. */
  uxPriority = uxTaskPriorityGet( NULL );
  vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
  while( xMACBInit(&AVR32_MACB) == FALSE )
  {
    __asm__ __volatile__ ( "nop" );
  }
  vTaskPrioritySet( NULL, uxPriority );
  /* Create the task that handles the MACB. */
  // xTaskCreate( ethernetif_input, ( signed portCHAR * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );
  sys_thread_new( ethernetif_input, NULL, netifINTERFACE_TASK_PRIORITY );
}
 
as you see,there are uxTaskPriorityGet,sys_thread_new and so on in this function and I really do not know how to deal it if an os not used.
The similar problem also exist in other functions.
 

在2008-09-03,"Marek Matej" <address@hidden> 写道:
>Hi Jini,
>I am working on project with lwip 1.3.0 and system with no OS layer.
>Therefore RAW API is ised.
>In ethernetif.c, I have implemented :
>--ethernetif_init(); which is used for init any of netif
>--mac_init(); which is intended for initiating network hardware
>--mac_input(); for reading received packets from network controller
>--mac_output(); gues for what :)
>--ethernetif_handlepackets(); running in main loop
>As I understand, implementation of ethernetif.c is user specific and
>there is only recommendation how to put it together with Your hardware
>driver. In my case, is like this:
>Adding netif using function netif_add() needs to pass in argument
>function for initiating any network interface (ethernetif_init() ) and
>function intended to start processing any informing data (ip_input()
>in my case)
>Next, ethernetif_handlepackets(struct netif*) is reading packets from
>net. hw. and putting it to process function of IP stack. Thats nearly
>all from lower side.
>The higher side of implementation, is using c++ objects to emulate
>sockets, with using only  RAW API. (due to no OS layer).
>
>I try to explain how I deal with ethernetif.c, but I believe there is
>more even sophisticated way to attach network driver with stack.
>
>Mark
>
>
>2008/9/3 jini-2003 



200万入主万科中粮紫苑155平米8重空间大宅 周周送好礼
reply via email to

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