NET: More renaming
This commit is contained in:
parent
44988c6ca6
commit
9f5418e5d3
@ -73,7 +73,7 @@ CSRCS += up_romgetc.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET),y)
|
ifeq ($(CONFIG_NET),y)
|
||||||
CSRCS += up_uipdriver.c
|
CSRCS += up_netdriver.c
|
||||||
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_BUFSIZE)
|
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_BUFSIZE)
|
||||||
ifneq ($(HOSTOS),Cygwin)
|
ifneq ($(HOSTOS),Cygwin)
|
||||||
HOSTSRCS += up_tapdev.c up_netdev.c
|
HOSTSRCS += up_tapdev.c up_netdev.c
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
calloc NXcalloc
|
calloc NXcalloc
|
||||||
close NXclose
|
close NXclose
|
||||||
closedir NXclosedir
|
closedir NXclosedir
|
||||||
dup NXdup
|
dup NXdup
|
||||||
free NXfree
|
free NXfree
|
||||||
fclose NXfclose
|
fclose NXfclose
|
||||||
fopen NXfopen
|
fopen NXfopen
|
||||||
fputc NXfputc
|
fputc NXfputc
|
||||||
fread NXfread
|
fread NXfread
|
||||||
fwrite NXfwrite
|
fwrite NXfwrite
|
||||||
fsync NXfsync
|
fsync NXfsync
|
||||||
gettimeofday NXgettimeofday
|
gettimeofday NXgettimeofday
|
||||||
ioctl NXioctl
|
ioctl NXioctl
|
||||||
lseek NXlseek
|
lseek NXlseek
|
||||||
malloc NXmalloc
|
malloc NXmalloc
|
||||||
malloc_init NXmalloc_init
|
malloc_init NXmalloc_init
|
||||||
mkdir NXmkdir
|
mkdir NXmkdir
|
||||||
mount NXmount
|
mount NXmount
|
||||||
open NXopen
|
open NXopen
|
||||||
opendir NXopendir
|
opendir NXopendir
|
||||||
read NXread
|
read NXread
|
||||||
realloc NXrealloc
|
realloc NXrealloc
|
||||||
rewinddir NXrewinddir
|
rewinddir NXrewinddir
|
||||||
rmdir NXrmdir
|
rmdir NXrmdir
|
||||||
seekdir NXseekdir
|
seekdir NXseekdir
|
||||||
select NXselect
|
select NXselect
|
||||||
sleep NXsleep
|
sleep NXsleep
|
||||||
socket NXsocket
|
socket NXsocket
|
||||||
stat NXstat
|
stat NXstat
|
||||||
statfs NXstatfs
|
statfs NXstatfs
|
||||||
system NXsystem
|
system NXsystem
|
||||||
umount NXumount
|
umount NXumount
|
||||||
unlink NXunlink
|
unlink NXunlink
|
||||||
usleep NXusleep
|
usleep NXusleep
|
||||||
write NXwrite
|
write NXwrite
|
||||||
zmalloc NXzmalloc
|
zmalloc NXzmalloc
|
||||||
|
@ -103,7 +103,7 @@ void up_idle(void)
|
|||||||
/* Run the network if enabled */
|
/* Run the network if enabled */
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
uipdriver_loop();
|
netdriver_loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Fake some power management stuff for testing purposes */
|
/* Fake some power management stuff for testing purposes */
|
||||||
|
@ -128,6 +128,6 @@ void up_initialize(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
uipdriver_init(); /* Our "real" network driver */
|
netdriver_init(); /* Our "real" network driver */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -222,12 +222,12 @@ extern void wpcap_send(unsigned char *buf, unsigned int buflen);
|
|||||||
#define netdev_send(buf,buflen) wpcap_send(buf,buflen)
|
#define netdev_send(buf,buflen) wpcap_send(buf,buflen)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* up_uipdriver.c *********************************************************/
|
/* up_netdriver.c *********************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
extern int uipdriver_init(void);
|
extern int netdriver_init(void);
|
||||||
extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
extern int netdriver_setmacaddr(unsigned char *macaddr);
|
||||||
extern void uipdriver_loop(void);
|
extern void netdriver_loop(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* up_uipdriver.c
|
* arch/sim/src/up_netdriver.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -138,7 +138,7 @@ static int sim_txpoll(struct net_driver_s *dev)
|
|||||||
* Public Functions
|
* 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 */
|
/* 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();
|
sched_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
int uipdriver_init(void)
|
int netdriver_init(void)
|
||||||
{
|
{
|
||||||
/* Internal initalization */
|
/* Internal initalization */
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ int uipdriver_init(void)
|
|||||||
return OK;
|
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);
|
(void)memcpy(g_sim_dev.d_mac.ether_addr_octet, macaddr, IFHWADDRLEN);
|
||||||
return 0;
|
return 0;
|
@ -62,7 +62,7 @@
|
|||||||
#include <linux/net.h>
|
#include <linux/net.h>
|
||||||
|
|
||||||
extern int syslog(const char *format, ...);
|
extern int syslog(const char *format, ...);
|
||||||
extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
extern int netdriver_setmacaddr(unsigned char *macaddr);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Definitions
|
* Private Definitions
|
||||||
@ -73,15 +73,15 @@ extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
|||||||
#define DEVTAP "/dev/net/tun"
|
#define DEVTAP "/dev/net/tun"
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC
|
#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC
|
||||||
# define UIP_IPADDR0 192
|
# define TAP_IPADDR0 192
|
||||||
# define UIP_IPADDR1 168
|
# define TAP_IPADDR1 168
|
||||||
# define UIP_IPADDR2 0
|
# define TAP_IPADDR2 0
|
||||||
# define UIP_IPADDR3 128
|
# define TAP_IPADDR3 128
|
||||||
#else
|
#else
|
||||||
# define UIP_IPADDR0 0
|
# define TAP_IPADDR0 0
|
||||||
# define UIP_IPADDR1 0
|
# define TAP_IPADDR1 0
|
||||||
# define UIP_IPADDR2 0
|
# define TAP_IPADDR2 0
|
||||||
# define UIP_IPADDR3 0
|
# define TAP_IPADDR3 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -157,7 +157,7 @@ static int up_setmacaddr(void)
|
|||||||
{
|
{
|
||||||
/* Set the MAC address */
|
/* 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 */
|
/* Assign an IPv4 address to the tap device */
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "/sbin/ifconfig tap0 inet %d.%d.%d.%d\n",
|
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);
|
system(buf);
|
||||||
|
|
||||||
/* Set the MAC address */
|
/* Set the MAC address */
|
||||||
|
@ -54,18 +54,16 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
extern int uipdriver_setmacaddr(unsigned char *macaddr);
|
extern int netdriver_setmacaddr(unsigned char *macaddr);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define BUF ((struct eth_hdr_s *)&uip_buf[0])
|
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC
|
#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
|
#else
|
||||||
# define UIP_IPADDR (0)
|
# define WCAP_IPADDR (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -231,7 +229,7 @@ static void set_ethaddr(struct in_addr addr)
|
|||||||
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
adapters->PhysicalAddress[2], adapters->PhysicalAddress[3],
|
||||||
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
adapters->PhysicalAddress[4], adapters->PhysicalAddress[5]);
|
||||||
|
|
||||||
(void)uipdriver_setmacaddr(adapters->PhysicalAddress);
|
(void)netdriver_setmacaddr(adapters->PhysicalAddress);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -253,7 +251,7 @@ void wpcap_init(void)
|
|||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
FARPROC dlladdr;
|
FARPROC dlladdr;
|
||||||
|
|
||||||
addr.s_addr = htonl(UIP_IPADDR);
|
addr.s_addr = htonl(WCAP_IPADDR);
|
||||||
printf("wpcap_init: IP address: %s\n", inet_ntoa(addr));
|
printf("wpcap_init: IP address: %s\n", inet_ntoa(addr));
|
||||||
|
|
||||||
wpcap = LoadLibrary("wpcap.dll");
|
wpcap = LoadLibrary("wpcap.dll");
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
* Function: netdev_carrier_on
|
* Function: netdev_carrier_on
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Notifies the uip layer about an available carrier.
|
* Notifies the networking layer about an available carrier.
|
||||||
* (e.g. a cable was plugged in)
|
* (e.g. a cable was plugged in)
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
@ -108,7 +108,7 @@ int netdev_carrier_on(FAR struct net_driver_s *dev)
|
|||||||
* Function: netdev_carrier_off
|
* Function: netdev_carrier_off
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Notifies the uip layer about an disappeared carrier.
|
* Notifies the networking layer about an disappeared carrier.
|
||||||
* (e.g. a cable was unplugged)
|
* (e.g. a cable was unplugged)
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
|
Loading…
Reference in New Issue
Block a user