* ioctl(TIOCMGET) on Lite5200
@ 2004-06-08 16:22 saurosalomoni
2004-06-08 17:23 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: saurosalomoni @ 2004-06-08 16:22 UTC (permalink / raw)
To: linuxppc-embedded
Hi there.
I'm having a problem with a specific argument of the
ioctl function, which is ioctl(TIOCMGET).
I wrote a simple routine which just reads or writes the
RTS pin.
It worked OK on my Red Hat 9, under x86, but when I try
to run it on a Lite5200 using denx kernel 2.4-25, it
keeps saying "TIOCMGET failed: Invalid argument" and
crashes out...
I think it could be due to some differences between the
two drivers, but I'm not sure about that. I wonder if
there's another argument that could provided me this
information, or if there's a way to ask for it
"manually" with ioctl...
Thanks in advance.
Here's a simple version of my code:
int fd, status;
fd = open("/dev/ttyS0", O_RDWR);
if (ioctl(fd, TIOCMGET, &status) < 0)
printf("TIOCMGET failed: %s\n", strerror(errno));
else
{...
/* then, to check the status, i make this test */
if (status & TIOCM_RTS)
/* to set RTS */
status &= ~TIOCM_RTS;
ioctl(fd, TIOCMSET, &status);
/* and to reset RTS */
status |= TIOCM_RTS;
ioctl(fd, TIOCMSET, &status);
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ioctl(TIOCMGET) on Lite5200
2004-06-08 16:22 ioctl(TIOCMGET) on Lite5200 saurosalomoni
@ 2004-06-08 17:23 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-06-08 17:23 UTC (permalink / raw)
To: saurosalomoni; +Cc: linuxppc-embedded
In message <HZ0056$6237825DE310949AB818EA81D16B09F0@bol.com.br> you wrote:
>
> I'm having a problem with a specific argument of the
> ioctl function, which is ioctl(TIOCMGET).
> I wrote a simple routine which just reads or writes the
> RTS pin.
> It worked OK on my Red Hat 9, under x86, but when I try
> to run it on a Lite5200 using denx kernel 2.4-25, it
> keeps saying "TIOCMGET failed: Invalid argument" and
Well, that says it all: the TIOCMGET ioctl() is not available for the
5200's PSC uart driver.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
A right is not what someone gives you; it's what no one can take from
you. - Ramsey Clark
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ioctl(TIOCMGET) on Lite5200
@ 2004-06-09 12:56 saurosalomoni
2004-06-09 13:14 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: saurosalomoni @ 2004-06-09 12:56 UTC (permalink / raw)
To: wd; +Cc: linuxppc-embedded
> In message
<HZ0056$6237825DE310949AB818EA81D16B09F0@bol.com.br> you
wrote:
> >
> > I'm having a problem with a specific argument of the
> > ioctl function, which is ioctl(TIOCMGET).
> > I wrote a simple routine which just reads or writes the
> > RTS pin.
> > It worked OK on my Red Hat 9, under x86, but when I try
> > to run it on a Lite5200 using denx kernel 2.4-25, it
> > keeps saying "TIOCMGET failed: Invalid argument" and
>
> Well, that says it all: the TIOCMGET ioctl() is not
available for the
> 5200's PSC uart driver.
>
> Best regards,
>
> Wolfgang Denk
So, if the 5200 series don't support TIOCMGET and
TIOCMSET ioctl() (nor TIOCMBIS and TIOCMBIC, I've just
tried them), what could I possibly use to get/set the
control pin RTS in my Lite5200?...
Is there any other system call or function that
accomplishes that?
Thank you very much.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ioctl(TIOCMGET) on Lite5200
2004-06-09 12:56 saurosalomoni
@ 2004-06-09 13:14 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-06-09 13:14 UTC (permalink / raw)
To: saurosalomoni; +Cc: linuxppc-embedded
In message <HZ1LA5$9EA97153A3F2D2EC1AD72AC1798B6528@bol.com.br> you wrote:
>
> So, if the 5200 series don't support TIOCMGET and
> TIOCMSET ioctl() (nor TIOCMBIS and TIOCMBIC, I've just
> tried them), what could I possibly use to get/set the
> control pin RTS in my Lite5200?...
> Is there any other system call or function that
> accomplishes that?
The current version of the 5200 PSC UART driver does not support
hardware handshake, so there is no way to control the RTS pin. If you
really must, you can either extend the driver to support hardware
handshake, or you could simply write a small driver to control this
pin as GPIO.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
Imitation is the sincerest form of plagarism.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-06-09 13:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-08 16:22 ioctl(TIOCMGET) on Lite5200 saurosalomoni
2004-06-08 17:23 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2004-06-09 12:56 saurosalomoni
2004-06-09 13:14 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).