Merged from sys/dev/sio/sio.c revisions 1.354 and 1.358.
This commit is contained in:
parent
3af626e4c6
commit
26449b8fd7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=88955
@ -3308,9 +3308,14 @@ comparam(tp, t)
|
||||
* latencies are reasonable for humans. Serial comms
|
||||
* protocols shouldn't expect anything better since modem
|
||||
* latencies are larger.
|
||||
*
|
||||
* We have to set the FIFO trigger point such that we
|
||||
* don't overflow it accidently if a serial interrupt
|
||||
* is delayed. At high speeds, FIFO_RX_HIGH does not
|
||||
* leave enough slots free.
|
||||
*/
|
||||
com->fifo_image = t->c_ospeed <= 4800
|
||||
? FIFO_ENABLE : FIFO_ENABLE | FIFO_RX_HIGH;
|
||||
? FIFO_ENABLE : FIFO_ENABLE | FIFO_RX_MEDH;
|
||||
#ifdef COM_ESP
|
||||
/*
|
||||
* The Hayes ESP card needs the fifo DMA mode bit set
|
||||
@ -4375,6 +4380,7 @@ siocnputc(dev, c)
|
||||
dev_t dev;
|
||||
int c;
|
||||
{
|
||||
int need_unlock;
|
||||
int s;
|
||||
struct siocnstate sp;
|
||||
Port_t iobase;
|
||||
@ -4384,13 +4390,16 @@ siocnputc(dev, c)
|
||||
else
|
||||
iobase = siocniobase;
|
||||
s = spltty();
|
||||
if (sio_inited)
|
||||
need_unlock = 0;
|
||||
if (sio_inited == 2 && !mtx_owned(&sio_lock)) {
|
||||
mtx_lock_spin(&sio_lock);
|
||||
need_unlock = 1;
|
||||
}
|
||||
siocnopen(&sp, iobase, comdefaultrate);
|
||||
siocntxwait(iobase);
|
||||
outb(iobase + com_data, c);
|
||||
siocnclose(&sp, iobase);
|
||||
if (sio_inited)
|
||||
if (need_unlock)
|
||||
mtx_unlock_spin(&sio_lock);
|
||||
splx(s);
|
||||
}
|
||||
|
@ -3308,9 +3308,14 @@ comparam(tp, t)
|
||||
* latencies are reasonable for humans. Serial comms
|
||||
* protocols shouldn't expect anything better since modem
|
||||
* latencies are larger.
|
||||
*
|
||||
* We have to set the FIFO trigger point such that we
|
||||
* don't overflow it accidently if a serial interrupt
|
||||
* is delayed. At high speeds, FIFO_RX_HIGH does not
|
||||
* leave enough slots free.
|
||||
*/
|
||||
com->fifo_image = t->c_ospeed <= 4800
|
||||
? FIFO_ENABLE : FIFO_ENABLE | FIFO_RX_HIGH;
|
||||
? FIFO_ENABLE : FIFO_ENABLE | FIFO_RX_MEDH;
|
||||
#ifdef COM_ESP
|
||||
/*
|
||||
* The Hayes ESP card needs the fifo DMA mode bit set
|
||||
@ -4375,6 +4380,7 @@ siocnputc(dev, c)
|
||||
dev_t dev;
|
||||
int c;
|
||||
{
|
||||
int need_unlock;
|
||||
int s;
|
||||
struct siocnstate sp;
|
||||
Port_t iobase;
|
||||
@ -4384,13 +4390,16 @@ siocnputc(dev, c)
|
||||
else
|
||||
iobase = siocniobase;
|
||||
s = spltty();
|
||||
if (sio_inited)
|
||||
need_unlock = 0;
|
||||
if (sio_inited == 2 && !mtx_owned(&sio_lock)) {
|
||||
mtx_lock_spin(&sio_lock);
|
||||
need_unlock = 1;
|
||||
}
|
||||
siocnopen(&sp, iobase, comdefaultrate);
|
||||
siocntxwait(iobase);
|
||||
outb(iobase + com_data, c);
|
||||
siocnclose(&sp, iobase);
|
||||
if (sio_inited)
|
||||
if (need_unlock)
|
||||
mtx_unlock_spin(&sio_lock);
|
||||
splx(s);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user