Skip to content
Snippets Groups Projects
Commit df45c194 authored by f4grx's avatar f4grx
Browse files

remove annoying debug messages, configure procfs

parent 1d8b0320
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,12 @@
-include $(TOPDIR)/Make.defs
ASRCS =
CSRCS = eeprom.c leds.c lcd.c timer.c system.c radio.c tun.c
CSRCS = eeprom.c leds.c lcd.c timer.c system.c radio.c
ifeq ($(CONFIG_NET_TUN),y)
CSRCS += tun.c
endif
CSRCS += tlv.c crc.c sha256.c hdlc.c
CSRCS += update.c
......
......@@ -146,7 +146,7 @@ void *hn70ap_radio_rxthread(void *arg)
}
else
{
syslog(LOG_ERR, "radio rx failed -> errno=%d\n", errno);
//syslog(LOG_ERR, "radio rx failed -> errno=%d\n", errno);
}
} //callback defined
} //radio alive
......
......@@ -55,7 +55,7 @@ static bool hn70ap_system_initialized = false;
int hn70ap_system_init(void)
{
int ret;
int tunid;
int tunid = -1;
bool defaults;
char tunname[IFNAMSIZ];
......@@ -102,20 +102,23 @@ int hn70ap_system_init(void)
{
syslog(LOG_ERR, "WARNING: Failed to initialize Screen\n");
}
#ifdef CONFIG_NET_TUN
ret = hn70ap_tun_init();
if(ret != 0)
{
syslog(LOG_ERR, "WARNING: Failed to initialize tunnels\n");
}
strncpy(tunname, "uhf%d", IFNAMSIZ);
strncpy(tunname, "uhf0", IFNAMSIZ);
#if 0
ret = hn70ap_tun_devinit(tunname);
if(ret != 0)
{
syslog(LOG_ERR, "WARNING: Failed to initialize TUN interface\n");
}
tunid = ret;
#endif
#endif
ret = hn70ap_radio_init();
if(ret != 0)
......
......@@ -89,7 +89,7 @@ void *hn70ap_tun_rxthread(void *arg)
}
else
{
syslog(LOG_ERR, "tunnel rx failed -> errno=%d\n", errno);
//syslog(LOG_ERR, "tunnel rx failed -> errno=%d\n", errno);
}
} //callback defined
} //tunnel alive
......@@ -153,7 +153,7 @@ int hn70ap_tun_devinit(char name[IFNAMSIZ])
return -1;
}
if ((fd = open("/dev/tun", O_RDWR)) < 0)
if ((fd = open("/dev/tun", O_RDWR | O_NONBLOCK)) < 0)
{
return fd;
}
......@@ -173,9 +173,11 @@ int hn70ap_tun_devinit(char name[IFNAMSIZ])
tunnel->fd = fd;
strncpy(tunnel->ifname, ifr.ifr_name, IFNAMSIZ);
syslog(LOG_INFO, "Started interface: %s\n", tunnel->ifname);
//Start RX thread
tunnel->alive = true;
ret = pthread_create(&tunnel->rxthread, NULL, hn70ap_tun_rxthread, NULL);
ret = pthread_create(&tunnel->rxthread, NULL, hn70ap_tun_rxthread, tunnel);
if(ret < 0)
{
syslog(LOG_ERR, "Failed to start the receive thread\n");
......
......@@ -73,6 +73,18 @@ void hn70ap_mount_storage(void)
printf("Mass Storage mounted at /data\n");
}
#endif
#ifdef CONFIG_FS_PROCFS
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
fprintf(stderr, "Failed to mount /proc\n");
}
else
{
printf("Mounted /proc\n");
}
#endif
}
/****************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment