Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netisdn Make isdntel hangup via /dev/isdnteld work by di...



details:   https://anonhg.NetBSD.org/src/rev/c3ee96a5c695
branches:  trunk
changeset: 552311:c3ee96a5c695
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 23 14:15:59 2003 +0000

description:
Make isdntel hangup via /dev/isdnteld work by digging out the correct
soft context and using it instead of the incorrect one.

Also, don't bother to crash the kernel if we try to hangup a non-connected
dialer, simply return an error.

diffstat:

 sys/netisdn/i4b_tel.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 64a73c0b1195 -r c3ee96a5c695 sys/netisdn/i4b_tel.c
--- a/sys/netisdn/i4b_tel.c     Tue Sep 23 13:45:27 2003 +0000
+++ b/sys/netisdn/i4b_tel.c     Tue Sep 23 14:15:59 2003 +0000
@@ -27,7 +27,7 @@
  *     i4b_tel.c - device driver for ISDN telephony
  *     --------------------------------------------
  *
- *     $Id: i4b_tel.c,v 1.13 2003/04/06 18:20:13 wiz Exp $
+ *     $Id: i4b_tel.c,v 1.14 2003/09/23 14:15:59 pooka Exp $
  *
  * $FreeBSD$
  *
@@ -36,7 +36,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i4b_tel.c,v 1.13 2003/04/06 18:20:13 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i4b_tel.c,v 1.14 2003/09/23 14:15:59 pooka Exp $");
 
 #include "isdntel.h"
 
@@ -785,10 +785,12 @@
        }
        else if(func == FUNCDIAL)
        {
+               tel_sc_t *telsc = &tel_sc[unit][FUNCTEL];
+
 #define CMDBUFSIZ 80 
                char cmdbuf[CMDBUFSIZ];
                int len = min(CMDBUFSIZ-1, uio->uio_resid);
-       
+
                error = uiomove(cmdbuf, len, uio);
 
                if(cmdbuf[0] == CMD_DIAL)
@@ -797,7 +799,10 @@
                }
                else if(cmdbuf[0] == CMD_HUP)
                {
-                       i4b_l4_drvrdisc(sc->cdp->cdid);
+                       if (!(telsc->devstate & ST_CONNECTED))
+                               error = EIO;
+                       else
+                               i4b_l4_drvrdisc(telsc->cdp->cdid);
                }
        }
        else
@@ -1143,7 +1148,7 @@
        tel_sc_t *sc = softc;
 
        /* audio device */
-       
+
        sc->cdp = (call_desc_t *)cdp;
 
        sc->devstate |= ST_CONNECTED;



Home | Main Index | Thread Index | Old Index