NET: More renaming

This commit is contained in:
Gregory Nutt 2014-07-03 17:53:16 -06:00
parent d3357f81f5
commit dfb5bc1413
8 changed files with 63 additions and 65 deletions

View File

@ -73,7 +73,7 @@ CSRCS += up_romgetc.c
endif
ifeq ($(CONFIG_NET),y)
CSRCS += up_uipdriver.c
CSRCS += up_netdriver.c
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_BUFSIZE)
ifneq ($(HOSTOS),Cygwin)
HOSTSRCS += up_tapdev.c up_netdev.c

View File

@ -1,36 +1,36 @@
calloc NXcalloc
close NXclose
closedir NXclosedir
dup NXdup
free NXfree
fclose NXfclose
fopen NXfopen
fputc NXfputc
fread NXfread
fwrite NXfwrite
fsync NXfsync
gettimeofday NXgettimeofday
ioctl NXioctl
lseek NXlseek
malloc NXmalloc
malloc_init NXmalloc_init
mkdir NXmkdir
mount NXmount
open NXopen
opendir NXopendir
read NXread
realloc NXrealloc
rewinddir NXrewinddir
rmdir NXrmdir
seekdir NXseekdir
select NXselect
sleep NXsleep
socket NXsocket
stat NXstat
statfs NXstatfs
system NXsystem
umount NXumount
unlink NXunlink
usleep NXusleep
write NXwrite
zmalloc NXzmalloc
calloc NXcalloc
close NXclose
closedir NXclosedir
dup NXdup
free NXfree
fclose NXfclose
fopen NXfopen
fputc NXfputc
fread NXfread
fwrite NXfwrite
fsync NXfsync
gettimeofday NXgettimeofday
ioctl NXioctl
lseek NXlseek
malloc NXmalloc
malloc_init NXmalloc_init
mkdir NXmkdir
mount NXmount
open NXopen
opendir NXopendir
read NXread
realloc NXrealloc
rewinddir NXrewinddir
rmdir NXrmdir
seekdir NXseekdir
select NXselect
sleep NXsleep
socket NXsocket
stat NXstat
statfs NXstatfs
system NXsystem
umount NXumount
unlink NXunlink
usleep NXusleep
write NXwrite
zmalloc NXzmalloc

View File

@ -103,7 +103,7 @@ void up_idle(void)
/* Run the network if enabled */
#ifdef CONFIG_NET
uipdriver_loop();
netdriver_loop();
#endif
/* Fake some power management stuff for testing purposes */

View File

@ -128,6 +128,6 @@ void up_initialize(void)
#endif
#ifdef CONFIG_NET
uipdriver_init(); /* Our "real" network driver */
netdriver_init(); /* Our "real" network driver */
#endif
}

View File

@ -222,12 +222,12 @@ extern void wpcap_send(unsigned char *buf, unsigned int buflen);
#define netdev_send(buf,buflen) wpcap_send(buf,buflen)
#endif
/* up_uipdriver.c *********************************************************/
/* up_netdriver.c *********************************************************/
#ifdef CONFIG_NET
extern int uipdriver_init(void);
extern int uipdriver_setmacaddr(unsigned char *macaddr);
extern void uipdriver_loop(void);
extern int netdriver_init(void);
extern int netdriver_setmacaddr(unsigned char *macaddr);
extern void netdriver_loop(void);
#endif
#endif /* __ASSEMBLY__ */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* up_uipdriver.c
* arch/sim/src/up_netdriver.c
*
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -138,7 +138,7 @@ static int sim_txpoll(struct net_driver_s *dev)
* Public Functions
****************************************************************************/
void uipdriver_loop(void)
void netdriver_loop(void)
{
/* netdev_read will return 0 on a timeout event and >0 on a data received event */
@ -207,7 +207,7 @@ void uipdriver_loop(void)
sched_unlock();
}
int uipdriver_init(void)
int netdriver_init(void)
{
/* Internal initalization */
@ -220,7 +220,7 @@ int uipdriver_init(void)
return OK;
}
int uipdriver_setmacaddr(unsigned char *macaddr)
int netdriver_setmacaddr(unsigned char *macaddr)
{
(void)memcpy(g_sim_dev.d_mac.ether_addr_octet, macaddr, IFHWADDRLEN);
return 0;

View File

@ -62,7 +62,7 @@
#include <linux/net.h>
extern int syslog(const char *format, ...);
extern int uipdriver_setmacaddr(unsigned char *macaddr);
extern int netdriver_setmacaddr(unsigned char *macaddr);
/****************************************************************************
* Private Definitions
@ -73,15 +73,15 @@ extern int uipdriver_setmacaddr(unsigned char *macaddr);
#define DEVTAP "/dev/net/tun"
#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC
# define UIP_IPADDR0 192
# define UIP_IPADDR1 168
# define UIP_IPADDR2 0
# define UIP_IPADDR3 128
# define TAP_IPADDR0 192
# define TAP_IPADDR1 168
# define TAP_IPADDR2 0
# define TAP_IPADDR3 128
#else
# define UIP_IPADDR0 0
# define UIP_IPADDR1 0
# define UIP_IPADDR2 0
# define UIP_IPADDR3 0
# define TAP_IPADDR0 0
# define TAP_IPADDR1 0
# define TAP_IPADDR2 0
# define TAP_IPADDR3 0
#endif
/****************************************************************************
@ -157,7 +157,7 @@ static int up_setmacaddr(void)
{
/* Set the MAC address */
ret = uipdriver_setmacaddr(&req.ifr_hwaddr.sa_data);
ret = netdriver_setmacaddr(&req.ifr_hwaddr.sa_data);
}
}
@ -197,7 +197,7 @@ void tapdev_init(void)
/* Assign an IPv4 address to the tap device */
snprintf(buf, sizeof(buf), "/sbin/ifconfig tap0 inet %d.%d.%d.%d\n",
UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3);
TAP_IPADDR0, TAP_IPADDR1, TAP_IPADDR2, TAP_IPADDR3);
system(buf);
/* Set the MAC address */

View File

@ -54,18 +54,16 @@
#include <stdlib.h>
#include <malloc.h>
extern int uipdriver_setmacaddr(unsigned char *macaddr);
extern int netdriver_setmacaddr(unsigned char *macaddr);
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define BUF ((struct eth_hdr_s *)&uip_buf[0])
#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC
# define UIP_IPADDR (10 << 24 | 0 << 16 | 0 << 8 | 1)
# define WCAP_IPADDR (10 << 24 | 0 << 16 | 0 << 8 | 1)
#else
# define UIP_IPADDR (0)
# define WCAP_IPADDR (0)
#endif
/****************************************************************************
@ -231,7 +229,7 @@ static void set_ethaddr(struct in_addr addr)
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
(void)uipdriver_setmacaddr(adapters->PhysicalAddress);
(void)netdriver_setmacaddr(adapters->PhysicalAddress);
break;
}
}
@ -253,7 +251,7 @@ void wpcap_init(void)
struct in_addr addr;
FARPROC dlladdr;
addr.s_addr = htonl(UIP_IPADDR);
addr.s_addr = htonl(WCAP_IPADDR);
printf("wpcap_init: IP address: %s\n", inet_ntoa(addr));
wpcap = LoadLibrary("wpcap.dll");