mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ed Vance <EdV@macrolink.com>
To: "'Michael Buesch'" <freesoftwaredeveloper@web.de>
Cc: linux-kernel@vger.kernel.org
Subject: RE: modifying line state manually on ttyS
Date: Mon, 7 Apr 2003 09:22:26 -0700	[thread overview]
Message-ID: <11E89240C407D311958800A0C9ACF7D1A33E28@EXCHANGE> (raw)

On Mon, Apr 07, 2003 at 8:42 AM, Michael Buesch wrote:
> On Monday 07 April 2003 16:16, Alan Cox wrote:
> > TxD is a bad choice. A lot of the hardware cannot control TXD this
> > way. DTR is the usual one because it is easy to handle but there
> > are other control lines you can drive directly (see TIOCGMODEM)
> 
> Oh great, you have just discovered the reason, why my driver 
> is working
> on my Pentium1-PC but not on my Pentium4-PC. It's simply not supported
> by hardware.  I've spent hours and hours about this. :)
> 
> My device is actually using DTR and RTS. What line could I 
> use instead of
> TxD? Is it possible to use CTS for this, although it is normally a
> "input-signal", but not a "output-signal" like RTS?
> 
No, CTS cannot operate as an output. 

The following ioctl calls are implemented in the generic serial driver,
/usr/src/linux*/drivers/char/serial.c:

  Modem Lines
     On special files representing serial ports, the  modem  con-
     trol  lines  supported  by the hardware can be read, and the
     modem status lines supported by the hardware can be changed.
     The  following  modem  control  and status lines may be sup-
     ported by a device; they are defined by <asm/termios.h>:

          TIOCM_DTR      data terminal ready  (DTE output)
          TIOCM_RTS      request to send      (DTE output)
          TIOCM_CTS      clear to send        (DTE input)
          TIOCM_CAR      carrier detect       (DTE input)
          TIOCM_RNG      ring                 (DTE input)
          TIOCM_DSR      data set ready       (DTE input)
          TIOCM_OUT1     UART OUT1 signal     (misc output)
          TIOCM_OUT2     UART OUT2 signal     (misc output)

     TIOCM_CD is a synonym  for  TIOCM_CAR,  and  TIOCM_RI  is  a
     synonym for TIOCM_RNG. Not all of these are necessarily sup-
     ported by any particular device; check the manual  page  for
     the device in question. Output signals OUT1 and OUT2 are not
     always  connected to  port interface  pins.  Often  they are
     dedicated to control of  UART special functions or loopback.

     TIOCMBIS       The argument is a pointer  to  an  int  whose
                    value  is  a  mask  containing  modem control
                    lines to be turned  on.   The  control  lines
                    whose bits are set in the argument are turned
                    on; no other control lines are affected.

     TIOCMBIC       The argument is a pointer  to  an  int  whose
                    value  is  a  mask  containing  modem control
                    lines to be turned off.   The  control  lines
                    whose bits are set in the argument are turned
                    off; no other control lines are affected.

     TIOCMGET       The argument is a pointer  to  an  int.   The
                    current  state  of  the modem status lines is
                    fetched and stored in the int pointed  to  by
                    the argument.

     TIOCMSET       The argument is a pointer to an int  contain-
                    ing  a  new  set of modem control lines.  The
                    modem control lines are  turned  on  or  off,
                    depending on whether the bit for that mode is
                    set or clear.

Cheers,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------

             reply	other threads:[~2003-04-07 16:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07 16:22 Ed Vance [this message]
2003-04-07 16:48 ` Michael Buesch
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 15:02 Michael Buesch
2003-04-07 14:16 ` Alan Cox
2003-04-07 15:42   ` Michael Buesch
2003-04-07 15:34 ` Sergei Organov
2003-04-07 16:32   ` Michael Buesch
2003-04-07 17:01     ` Sergei Organov
2003-04-07 17:16       ` Michael Buesch
2003-04-07 15:51 ` Richard B. Johnson
2003-04-07 15:48   ` Michael Buesch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11E89240C407D311958800A0C9ACF7D1A33E28@EXCHANGE \
    --to=edv@macrolink.com \
    --cc=freesoftwaredeveloper@web.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®