Removed ethernode uIP driver from the main code

This commit is contained in:
adamdunkels 2007-03-14 00:32:30 +00:00
parent 548e4ce556
commit 9d030483ff
6 changed files with 59 additions and 53 deletions

View file

@ -9,7 +9,7 @@ CONTIKI_TARGET_DIRS = . dev apps net
SENSORS = sensors.c beep.c button-sensor.c pir-sensor.c vib-sensor.c \
radio-sensor.c irq.c eeprom.c \
dummy-sensors.c leds.c leds-arch.c esb-sensors.c
NETSIM = ether.c ethernode.c ethernode-drv.c lpm.c \
NETSIM = ether.c ethernode.c ethernode-uip.c lpm.c \
tapdev-drv.c tapdev-service.c tapdev.c rs232.c flash.c \
node.c nodes.c sensor.c display.c random.c radio.c \
dlloader.c main.c netsim-init.c contiki-main.c symtab.c symbols.c tr1001.c tr1001-drv.c \

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: contiki-main.c,v 1.5 2007/03/13 13:07:47 adamdunkels Exp $
* $Id: contiki-main.c,v 1.6 2007/03/14 00:32:30 adamdunkels Exp $
*/
#include "contiki.h"
@ -40,7 +40,7 @@
#include "net/tapdev.h"
#include "net/tapdev-drv.h"
#include "net/tapdev-service.h"
#include "net/ethernode-drv.h"
#include "net/ethernode-uip.h"
#include "net/ethernode-rime.h"
#include "net/ethernode.h"
#include "ether.h"
@ -57,8 +57,8 @@
static struct uip_fw_netif tapif =
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, tapdev_send)};
static struct uip_fw_netif ethernodeif =
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, ethernode_drv_send)};
/*static struct uip_fw_netif ethernodeif =
{UIP_FW_NETIF(172,16,0,0, 255,255,0,0, ethernode_drv_send)};*/
static const struct uip_eth_addr ethaddr = {{0x00,0x06,0x98,0x01,0x02,0x12}};
@ -68,7 +68,8 @@ static const struct uip_eth_addr ethaddr = {{0x00,0x06,0x98,0x01,0x02,0x12}};
SENSORS(&button_sensor, &pir_sensor, &vib_sensor, &radio_sensor);
PROCINIT(&sensors_process, &etimer_process, &tcpip_process,
&ethernode_drv_process, &ethernode_rime_process,
/* &ethernode_uip_process,*/
&ethernode_rime_process,
&uip_fw_process);
#if 0
@ -149,6 +150,7 @@ void
contiki_main(int flag)
{
random_init(getpid());
srand(getpid());
leds_init();
@ -156,13 +158,15 @@ contiki_main(int flag)
procinit_init();
rime_init();
if(flag == 1) {
process_start(&tapdev_drv_process, NULL);
uip_fw_register(&ethernodeif);
/* uip_fw_register(&ethernodeif);*/
uip_fw_default(&tapif);
printf("uip_hostaddr %02x%02x\n", uip_hostaddr.u16[0], uip_hostaddr.u16[1]);
} else {
uip_fw_default(&ethernodeif);
/* uip_fw_default(&ethernodeif);*/
}
leds_green(LEDS_ON);

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: ethernode-rime.c,v 1.1 2007/03/13 13:07:48 adamdunkels Exp $
* $Id: ethernode-rime.c,v 1.2 2007/03/14 00:32:30 adamdunkels Exp $
*/
#include "contiki.h"
@ -46,7 +46,7 @@ PROCESS_THREAD(ethernode_rime_process, ev, data)
{
PROCESS_BEGIN();
printf("ethernode_rime_process\n");
/* printf("ethernode_rime_process\n");*/
while(1) {
process_poll(&ethernode_rime_process);
@ -64,8 +64,8 @@ PROCESS_THREAD(ethernode_rime_process, ev, data)
rimebuf_set_datalen(len);
printf("ethernode_rime_process: received len %d\n",
len);
/* printf("ethernode_rime_process: received len %d\n",
len);*/
abc_input_packet();
}
}
@ -75,8 +75,9 @@ PROCESS_THREAD(ethernode_rime_process, ev, data)
}
/*---------------------------------------------------------------------------*/
void
abc_arch_send(u8_t *buf, int len)
abc_driver_send(void)
{
ethernode_send_buf(buf, len);
/* printf("ethernode_rime: sending %d bytes\n", rimebuf_totlen());*/
ethernode_send_buf(rimebuf_hdrptr(), rimebuf_totlen());
}
/*---------------------------------------------------------------------------*/

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: ethernode-drv.c,v 1.5 2007/03/13 13:07:48 adamdunkels Exp $
* $Id: ethernode-uip.c,v 1.1 2007/03/14 00:32:30 adamdunkels Exp $
*/
#include "contiki.h"
@ -43,26 +43,26 @@
#include "node-id.h"
PROCESS(ethernode_drv_process, "Ethernode driver");
PROCESS(ethernode_uip_process, "Ethernode driver");
enum { NULLEVENT };
/*---------------------------------------------------------------------------*/
u8_t
ethernode_drv_send(void)
ethernode_uip_send(void)
{
/* printf("%d: ethernode_drv_send\n", node_id);*/
/* printf("%d: ethernode_uip_send\n", node_id);*/
uip_len = hc_compress(&uip_buf[UIP_LLH_LEN], uip_len);
return ethernode_send();
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(ethernode_drv_process, ev, data)
PROCESS_THREAD(ethernode_uip_process, ev, data)
{
static int drop = 3;
PROCESS_BEGIN();
while(1) {
process_poll(&ethernode_drv_process);
process_poll(&ethernode_uip_process);
PROCESS_WAIT_EVENT();
/* Poll Ethernet device to see if there is a frame avaliable. */

View file

@ -29,17 +29,17 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: ethernode-drv.h,v 1.1 2006/06/17 22:41:36 adamdunkels Exp $
* $Id: ethernode-uip.h,v 1.1 2007/03/14 00:32:30 adamdunkels Exp $
*/
#ifndef __ETHERNODE_DRV_H__
#define __ETHERNODE_DRV_H__
#ifndef __ETHERNODE_UIP_H__
#define __ETHERNODE_UIP_H__
#include "contiki.h"
PROCESS_NAME(ethernode_drv_process);
PROCESS_NAME(ethernode_uip_process);
u8_t ethernode_drv_send(void);
u8_t ethernode_uip_send(void);
u8_t ethernode_drv_send(void);
u8_t ethernode_uip_send(void);
#endif /* __ETHERNODE_DRV_H__ */
#endif /* __ETHERNODE_UIP_H__ */

View file

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: ethernode.c,v 1.4 2007/03/13 13:07:48 adamdunkels Exp $
* $Id: ethernode.c,v 1.5 2007/03/14 00:32:30 adamdunkels Exp $
*/
/**
* \file
@ -90,6 +90,7 @@ do_send(u8_t type, u8_t dest, struct hdr *hdr, int len)
++state.seqno;
/* printf("ether_send len %d\n", len);*/
return ether_send((char *)hdr, len);
}