From owner-freebsd-hackers Fri Oct 27 5:40:54 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from hermes.atrada.de (hermes.atrada.de [212.118.32.33]) by hub.freebsd.org (Postfix) with SMTP id ECD3637B479 for ; Fri, 27 Oct 2000 05:40:50 -0700 (PDT) Received: from erlangen01.atrada.de by hermes.atrada.de via smtpd (for hub.FreeBSD.org [216.136.204.18]) with SMTP; 27 Oct 2000 12:40:50 UT Received: (private information removed) Message-ID: <58A002A02C5ED311812E0050044517F00D2611@erlangen01.atrada.de> From: Alexander Maret To: "'freebsd-hackers@freebsd.org'" Subject: Accessing the tty structure of an opened device Date: Fri, 27 Oct 2000 14:40:38 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, is it possible to access the tty structure of an opened device directly? Background: I'm trying to sense the DCD state of a serial port for getting the pulses and spaces of a simple IR device. I could use ioctl commands to get the current state but then I would have to check the state continously which uses too much cpu time. What I want to do is something like that: - open the serial port - get the tty structure of the opened device - define something like that: #define TSA_CARR_OFF(tp) (!((void *)&(tp)->t_rawq)) and then wait for TSA_CARR_OFF and TSA_CARR_ON for example: - get current DCD state if DCD is up error = tsleep(TSA_CARR_OFF(tp), .....) to get a wakeup on DCD down. Is this possible and if yes where do I get access to the tty structure of my opened serial port? Unfortunately I'm no kernel hacker so be patient with me. I tried to find examples within the source code and in "The design and implementation of the 4.4 BSD OS" but couldn't find a good solution. An example code how to access the tty structure would be great. Perhaps you can point me to the right files within the kernel sources. Thanks in advance, Alex To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message