ETHER: Make sure SET NOASYNC is effective for Ethernet devices
- Make sure that asynchronous mode can't be changed if devices using sim_ether are already attached. - Add missing DEV_ETHER type flag for the only sim_ether using device that didn't already have it.
This commit is contained in:
parent
b273cac59e
commit
7a6a325580
3 changed files with 20 additions and 2 deletions
|
@ -130,7 +130,7 @@ DEVICE xs_dev = {
|
||||||
1, DEV_RDX, 20, 1, DEV_RDX, 8,
|
1, DEV_RDX, 20, 1, DEV_RDX, 8,
|
||||||
NULL, NULL, &xs_reset,
|
NULL, NULL, &xs_reset,
|
||||||
NULL, &xs_attach, &xs_detach,
|
NULL, &xs_attach, &xs_detach,
|
||||||
&xs_dib, DEV_DEBUG | XS_FLAGS, 0,
|
&xs_dib, DEV_DEBUG | XS_FLAGS | DEV_ETHER, 0,
|
||||||
xs_debug, NULL, NULL, &xs_help, NULL, NULL,
|
xs_debug, NULL, NULL, &xs_help, NULL, NULL,
|
||||||
&xs_description
|
&xs_description
|
||||||
};
|
};
|
||||||
|
|
10
scp.c
10
scp.c
|
@ -5767,6 +5767,16 @@ if (cptr && (*cptr != 0)) /* now eol? */
|
||||||
#ifdef SIM_ASYNCH_IO
|
#ifdef SIM_ASYNCH_IO
|
||||||
if (flag == sim_asynch_enabled) /* already set correctly? */
|
if (flag == sim_asynch_enabled) /* already set correctly? */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
|
if (1) {
|
||||||
|
uint32 i;
|
||||||
|
DEVICE *dptr;
|
||||||
|
|
||||||
|
for (i = 1; (dptr = sim_devices[i]) != NULL; i++) { /* flush attached files */
|
||||||
|
if ((DEV_TYPE(dptr) == DEV_ETHER) &&
|
||||||
|
(dptr->units->flags & UNIT_ATT))
|
||||||
|
return sim_messagef (SCPE_ALATT, "Can't change asynch mode with %s device attached\n", dptr->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
sim_asynch_enabled = flag;
|
sim_asynch_enabled = flag;
|
||||||
tmxr_change_async ();
|
tmxr_change_async ();
|
||||||
sim_timer_change_asynch ();
|
sim_timer_change_asynch ();
|
||||||
|
|
10
sim_ether.c
10
sim_ether.c
|
@ -2177,6 +2177,10 @@ return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* eth_set_async
|
||||||
|
*
|
||||||
|
* Turn on reciever processing which can be either asynchronous or polled
|
||||||
|
*/
|
||||||
t_stat eth_set_async (ETH_DEV *dev, int latency)
|
t_stat eth_set_async (ETH_DEV *dev, int latency)
|
||||||
{
|
{
|
||||||
#if !defined(USE_READER_THREAD) || !defined(SIM_ASYNCH_IO)
|
#if !defined(USE_READER_THREAD) || !defined(SIM_ASYNCH_IO)
|
||||||
|
@ -2186,7 +2190,7 @@ return sim_messagef (SCPE_NOFNC, "%s", msg);
|
||||||
#else
|
#else
|
||||||
int wakeup_needed;
|
int wakeup_needed;
|
||||||
|
|
||||||
dev->asynch_io = 1;
|
dev->asynch_io = sim_asynch_enabled;
|
||||||
dev->asynch_io_latency = latency;
|
dev->asynch_io_latency = latency;
|
||||||
pthread_mutex_lock (&dev->lock);
|
pthread_mutex_lock (&dev->lock);
|
||||||
wakeup_needed = (dev->read_queue.count != 0);
|
wakeup_needed = (dev->read_queue.count != 0);
|
||||||
|
@ -2199,6 +2203,10 @@ if (wakeup_needed) {
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* eth_clr_async
|
||||||
|
*
|
||||||
|
* Turn off reciever processing
|
||||||
|
*/
|
||||||
t_stat eth_clr_async (ETH_DEV *dev)
|
t_stat eth_clr_async (ETH_DEV *dev)
|
||||||
{
|
{
|
||||||
#if !defined(USE_READER_THREAD) || !defined(SIM_ASYNCH_IO)
|
#if !defined(USE_READER_THREAD) || !defined(SIM_ASYNCH_IO)
|
||||||
|
|
Loading…
Add table
Reference in a new issue