Fixed newly-introduced compile-breaking bugs in the network code.
This commit is contained in:
@@ -185,7 +185,7 @@ poll_thread(void *arg)
|
|||||||
if (pcap == NULL) break;
|
if (pcap == NULL) break;
|
||||||
|
|
||||||
/* Wait for the next packet to arrive. */
|
/* Wait for the next packet to arrive. */
|
||||||
if (network_wait)
|
if (network_get_wait())
|
||||||
data = NULL;
|
data = NULL;
|
||||||
else
|
else
|
||||||
data = (uint8_t *)f_pcap_next((void *)pcap, &h);
|
data = (uint8_t *)f_pcap_next((void *)pcap, &h);
|
||||||
|
@@ -148,7 +148,7 @@ poll_thread(void *arg)
|
|||||||
/* Wait for the next packet to arrive. */
|
/* Wait for the next packet to arrive. */
|
||||||
data_valid = 0;
|
data_valid = 0;
|
||||||
|
|
||||||
if (!network_wait && (QueuePeek(slirpq) != 0)) {
|
if (!network_get_wait() && (QueuePeek(slirpq) != 0)) {
|
||||||
/* Grab a packet from the queue. */
|
/* Grab a packet from the queue. */
|
||||||
// ui_sb_update_icon(SB_NETWORK, 1);
|
// ui_sb_update_icon(SB_NETWORK, 1);
|
||||||
|
|
||||||
|
@@ -99,7 +99,7 @@ static netcard_t net_cards[] = {
|
|||||||
int network_type;
|
int network_type;
|
||||||
int network_ndev;
|
int network_ndev;
|
||||||
int network_card;
|
int network_card;
|
||||||
volatile int network_wait = 0;
|
static volatile int net_wait = 0;
|
||||||
char network_host[522];
|
char network_host[522];
|
||||||
netdev_t network_devs[32];
|
netdev_t network_devs[32];
|
||||||
#ifdef ENABLE_NIC_LOG
|
#ifdef ENABLE_NIC_LOG
|
||||||
@@ -221,7 +221,7 @@ network_attach(void *dev, uint8_t *mac, NETRXCB rx)
|
|||||||
net_cards[network_card].rx = rx;
|
net_cards[network_card].rx = rx;
|
||||||
network_mac = mac;
|
network_mac = mac;
|
||||||
|
|
||||||
network_wait = 0;
|
network_set_wait(0);
|
||||||
|
|
||||||
/* Create the network events. */
|
/* Create the network events. */
|
||||||
poll_data.wake_poll_thread = thread_create_event();
|
poll_data.wake_poll_thread = thread_create_event();
|
||||||
@@ -450,5 +450,19 @@ network_card_get_from_internal_name(char *s)
|
|||||||
void
|
void
|
||||||
network_set_wait(int wait)
|
network_set_wait(int wait)
|
||||||
{
|
{
|
||||||
network_wait = wait;
|
network_wait(1);
|
||||||
|
net_wait = wait;
|
||||||
|
network_wait(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
network_get_wait(void)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
network_wait(1);
|
||||||
|
ret = net_wait;
|
||||||
|
network_wait(0);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -89,7 +89,6 @@ extern "C" {
|
|||||||
/* Global variables. */
|
/* Global variables. */
|
||||||
extern int nic_do_log; /* config */
|
extern int nic_do_log; /* config */
|
||||||
extern int network_ndev;
|
extern int network_ndev;
|
||||||
extern volatile int network_wait;
|
|
||||||
extern netdev_t network_devs[32];
|
extern netdev_t network_devs[32];
|
||||||
|
|
||||||
|
|
||||||
@@ -126,6 +125,7 @@ extern int network_card_get_from_internal_name(char *);
|
|||||||
extern const device_t *network_card_getdevice(int);
|
extern const device_t *network_card_getdevice(int);
|
||||||
|
|
||||||
extern void network_set_wait(int wait);
|
extern void network_set_wait(int wait);
|
||||||
|
extern int network_get_wait(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user