arch/sim: Change the return type of netdriver_setmacaddr to void
This commit is contained in:
parent
582b2af912
commit
6b1187b402
@ -354,7 +354,7 @@ void wpcap_send(unsigned char *buf, unsigned int buflen);
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
int netdriver_init(void);
|
||||
int netdriver_setmacaddr(unsigned char *macaddr);
|
||||
void netdriver_setmacaddr(unsigned char *macaddr);
|
||||
void netdriver_loop(void);
|
||||
#endif
|
||||
|
||||
|
@ -370,8 +370,7 @@ int netdriver_init(void)
|
||||
return OK;
|
||||
}
|
||||
|
||||
int netdriver_setmacaddr(unsigned char *macaddr)
|
||||
void netdriver_setmacaddr(unsigned char *macaddr)
|
||||
{
|
||||
memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN);
|
||||
return 0;
|
||||
}
|
||||
|
@ -88,10 +88,10 @@ struct sel_arg_struct
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* NuttX Domain Public Function Prototypes
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int netdriver_setmacaddr(unsigned char *macaddr);
|
||||
void netdriver_setmacaddr(unsigned char *macaddr);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -131,10 +131,9 @@ static inline void dump_ethhdr(const char *msg, unsigned char *buf,
|
||||
# define dump_ethhdr(m,b,l)
|
||||
#endif
|
||||
|
||||
static int up_setmacaddr(void)
|
||||
static void set_macaddr(void)
|
||||
{
|
||||
unsigned char mac[7];
|
||||
int ret = -1;
|
||||
|
||||
/* Assign a random locally-created MAC address.
|
||||
*
|
||||
@ -158,8 +157,7 @@ static int up_setmacaddr(void)
|
||||
mac[5] = rand() % 256;
|
||||
mac[6] = 0;
|
||||
|
||||
ret = netdriver_setmacaddr(mac);
|
||||
return ret;
|
||||
netdriver_setmacaddr(mac);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -230,7 +228,7 @@ void tapdev_init(void)
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
up_setmacaddr();
|
||||
set_macaddr();
|
||||
}
|
||||
|
||||
unsigned int tapdev_read(unsigned char *buf, unsigned int buflen)
|
||||
|
@ -69,8 +69,6 @@
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
__attribute__ ((dllimport)) extern char **__argv[];
|
||||
|
||||
struct pcap;
|
||||
|
||||
struct pcap_if
|
||||
@ -111,21 +109,17 @@ typedef int (*pcap_sendpacket_t)(struct pcap *, unsigned char *, int);
|
||||
HMODULE wpcap;
|
||||
static struct pcap *pcap;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
extern int netdriver_setmacaddr(unsigned char *macaddr);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static pcap_findalldevs_t pcap_findalldevs;
|
||||
static pcap_open_live_t pcap_open_live;
|
||||
static pcap_next_ex_t pcap_next_ex;
|
||||
static pcap_sendpacket_t pcap_sendpacket;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void netdriver_setmacaddr(unsigned char *macaddr);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user