1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

Use tty_close() and ttygone() where it need instead of

commenting of ttyclose() for __FreeBSD_version >= 502122.

First symptom.
# kldunload ltmdm.ko
kldunload: can't unload file: Device busy

Second symptom.
If ppp(8) used for connect /dev/cual0 and it was
disconnected, the new ppp session return the
following error in ppp.log:
tun0: Warning: deflink: /dev/cual0: Bad file descriptor

Bump PORTREVISION one more time.
This commit is contained in:
Sergey A. Osokin 2004-07-27 20:35:54 +00:00
parent 1f6439146e
commit 2f3d2c4f09
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=114893
2 changed files with 27 additions and 23 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= ltmdm
PORTVERSION= 1.4
PORTREVISION= 10
PORTREVISION= 11
CATEGORIES= comms
MASTER_SITES= http://www.dons.net.au/~darius/ \
http://soupnazi.org/FreeBSD/ports/distfiles/

View File

@ -1,5 +1,5 @@
--- sys/dev/ltmdm/ltmdmsio.c.orig Thu Jul 22 15:13:32 2004
+++ sys/dev/ltmdm/ltmdmsio.c Thu Jul 22 15:15:32 2004
--- sys/dev/ltmdm/ltmdmsio.c.orig Tue Mar 12 04:47:31 2002
+++ sys/dev/ltmdm/ltmdmsio.c Tue Jul 27 23:28:56 2004
@@ -60,7 +60,9 @@
#include <sys/proc.h>
#include <sys/module.h>
@ -152,7 +152,7 @@
/*
* initialize the device registers as follows:
@@ -1433,11 +1484,17 @@
@@ -1433,11 +1484,19 @@
s = splfunc();
if (tp) {
@ -166,11 +166,13 @@
comhardclose(com);
+#if __FreeBSD_version < 502122
ttyclose(tp);
+#else
+ ttygone(tp);
+#endif
}
vxdPortClose();
siosettimeout();
@@ -1470,7 +1527,11 @@
@@ -1470,7 +1529,11 @@
}
static int
@ -182,7 +184,7 @@
{
struct com_s *com;
int error;
@@ -1610,7 +1671,11 @@
@@ -1610,7 +1673,11 @@
* the true carrier.
*/
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
@ -194,7 +196,7 @@
}
/*
* Wait for DCD if necessary.
@@ -1626,7 +1691,11 @@
@@ -1626,7 +1693,11 @@
goto out;
goto open_top;
}
@ -206,7 +208,7 @@
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
@@ -1639,7 +1708,11 @@
@@ -1639,7 +1710,11 @@
}
static int
@ -218,7 +220,7 @@
{
struct com_s *com;
int mynor;
@@ -1654,11 +1727,17 @@
@@ -1654,11 +1729,19 @@
return (ENODEV);
tp = com->tp;
s = splfunc();
@ -232,11 +234,13 @@
comhardclose(com);
+#if __FreeBSD_version < 502122
ttyclose(tp);
+#else
+ tty_close(tp);
+#endif
siosettimeout();
splx(s);
if (com->gone) {
@@ -1685,7 +1764,9 @@
@@ -1685,7 +1768,9 @@
s = splfunc();
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
@ -246,7 +250,7 @@
write_vuart_port(UART_CFCR, com->cfcr_image &= ~CFCR_SBREAK);
{
write_vuart_port(UART_IER, 0);
@@ -1724,7 +1805,11 @@
@@ -1724,7 +1809,11 @@
}
static int
@ -258,7 +262,7 @@
{
int mynor;
struct com_s *com;
@@ -1735,11 +1820,19 @@
@@ -1735,11 +1824,19 @@
com = com_addr(MINOR_TO_UNIT(mynor));
if (com == NULL || com->gone)
return (ENODEV);
@ -278,7 +282,7 @@
{
int mynor;
struct com_s *com;
@@ -1754,7 +1847,11 @@
@@ -1754,7 +1851,11 @@
if (com == NULL || com->gone)
return (ENODEV);
@ -290,7 +294,7 @@
}
static void
@@ -1860,7 +1957,11 @@
@@ -1860,7 +1961,11 @@
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
@ -302,7 +306,7 @@
lt_disable_intr();
} while (buf < com->iptr);
}
@@ -1894,23 +1995,34 @@
@@ -1894,23 +1999,34 @@
u_char recv_data;
u_char int_ctl;
u_char int_ctl_new;
@ -337,7 +341,7 @@
line_status = read_vuart_port(UART_LSR);
/* input event? (check first to help avoid overruns) */
@@ -1948,7 +2060,11 @@
@@ -1948,7 +2064,11 @@
recv_data = 0;
}
++com->bytes_in;
@ -349,7 +353,7 @@
setsofttty();
ioptr = com->iptr;
if (ioptr >= com->ibufend)
@@ -2053,7 +2169,11 @@
@@ -2053,7 +2173,11 @@
}
static int
@ -361,7 +365,7 @@
{
struct com_s *com;
int error;
@@ -2134,7 +2254,11 @@
@@ -2134,7 +2258,11 @@
if (lt->c_ospeed != 0)
dt->c_ospeed = tp->t_ospeed;
}
@ -373,7 +377,7 @@
if (error != ENOIOCTL)
return (error);
s = splfunc();
@@ -2189,13 +2313,17 @@
@@ -2189,13 +2317,17 @@
com->do_timestamp = TRUE;
*(struct timeval *)data = com->timestamp;
break;
@ -391,7 +395,7 @@
if (error == ENODEV)
error = ENOTTY;
return (error);
@@ -2257,8 +2385,13 @@
@@ -2257,8 +2389,13 @@
com->state &= ~CS_CHECKMSR;
lt_enable_intr();
if (delta_modem_status & MSR_DCD)
@ -405,7 +409,7 @@
}
if (com->state & CS_ODONE) {
lt_disable_intr();
@@ -2270,7 +2403,11 @@
@@ -2270,7 +2407,11 @@
sio_busycheck_handle = timeout(siobusycheck, com, hz / 100);
com->extra_state |= CSE_BUSYCHECK;
}
@ -417,7 +421,7 @@
}
if (com_events == 0)
break;
@@ -2769,11 +2906,21 @@
@@ -2769,11 +2910,21 @@
&& (!(t->c_iflag & PARMRK)
|| (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK))
&& !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN))
@ -439,7 +443,7 @@
}
#ifdef KLD_MODULE
@@ -2796,7 +2943,7 @@
@@ -2796,7 +2947,7 @@
#endif
DRIVER_MODULE(ltmdm, pci, ltmdm_pci_driver, ltmdm_devclass, ltmdm_event, 0);