diff --git a/src/include/86box/network.h b/src/include/86box/network.h index 1d6763b44..f559d55a0 100644 --- a/src/include/86box/network.h +++ b/src/include/86box/network.h @@ -105,8 +105,6 @@ extern netdev_t network_devs[32]; /* Function prototypes. */ extern void network_wait(uint8_t wait); -extern void network_busy(uint8_t set); -extern void network_end(void); extern void network_init(void); extern void network_attach(void *, uint8_t *, NETRXCB, NETWAITCB, NETSETLINKSTATE); diff --git a/src/network/net_pcap.c b/src/network/net_pcap.c index 6fd22f571..1fff7255c 100644 --- a/src/network/net_pcap.c +++ b/src/network/net_pcap.c @@ -338,8 +338,6 @@ net_pcap_close(void) /* Tell the thread to terminate. */ if (poll_tid != NULL) { - network_busy(0); - /* Wait for the thread to finish. */ pcap_log("PCAP: waiting for thread to end...\n"); thread_wait_event(poll_state, -1); diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index 514126118..fc4afcf78 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -446,8 +446,6 @@ net_slirp_close(void) /* Tell the thread to terminate. */ if (slirp->poll_tid) { - network_busy(0); - /* Wait for the thread to finish. */ slirp_log("SLiRP: waiting for thread to end...\n"); thread_wait_event(slirp->poll_state, -1); diff --git a/src/network/network.c b/src/network/network.c index bcb19e9ef..4e78434e6 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -124,16 +124,6 @@ static netpkt_t *first_pkt[3] = { NULL, NULL, NULL }, *last_pkt[3] = { NULL, NULL, NULL }; -static struct { - volatile int busy, - queue_in_use; - - event_t *wake_poll_thread, - *poll_complete, - *queue_not_in_use; -} poll_data; - - #ifdef ENABLE_NETWORK_LOG int network_do_log = ENABLE_NETWORK_LOG; static FILE *network_dump = NULL; @@ -201,23 +191,6 @@ network_wait(uint8_t wait) } -void -network_busy(uint8_t set) -{ - poll_data.busy = !!set; - - if (! set) - thread_set_event(poll_data.wake_poll_thread); -} - - -void -network_end(void) -{ - thread_set_event(poll_data.poll_complete); -} - - /* * Initialize the configured network cards. * @@ -362,7 +335,8 @@ network_rx_queue(void *priv) /* Transmission. */ network_queue_get(2, &pkt); - network_queue_put(1, pkt->priv, pkt->data, pkt->len); + if (pkt != NULL) + network_queue_put(1, pkt->priv, pkt->data, pkt->len); // network_busy(0); @@ -391,10 +365,6 @@ network_attach(void *dev, uint8_t *mac, NETRXCB rx, NETWAITCB wait, NETSETLINKST network_set_wait(0); - /* Create the network events. */ - poll_data.poll_complete = thread_create_event(); - poll_data.wake_poll_thread = thread_create_event(); - /* Activate the platform module. */ switch(network_type) { case NET_TYPE_PCAP: @@ -443,16 +413,6 @@ network_close(void) /* Force-close the SLIRP module. */ net_slirp_close(); - /* Close the network events. */ - if (poll_data.wake_poll_thread != NULL) { - thread_destroy_event(poll_data.wake_poll_thread); - poll_data.wake_poll_thread = NULL; - } - if (poll_data.poll_complete != NULL) { - thread_destroy_event(poll_data.poll_complete); - poll_data.poll_complete = NULL; - } - /* Close the network thread mutex. */ thread_close_mutex(network_mutex); network_mutex = NULL; @@ -541,15 +501,11 @@ network_reset(void) void network_tx(uint8_t *bufp, int len) { - network_busy(1); - ui_sb_update_icon(SB_NETWORK, 1); network_queue_put(2, NULL, bufp, len); ui_sb_update_icon(SB_NETWORK, 0); - - network_busy(0); }