linux-mips-fnet
[Top] [All Lists]

I can't read data from COM1

To: "LinuxKernelMailList" <linux-kernel@vger.kernel.org>, "MipsMailList" <linux-mips@fnet.fr>, "LinuxEmbeddedMailList" <linux-embedded@waste.org>
Subject: I can't read data from COM1
From: "Green" <greeen@iii.org.tw>
Date: Mon, 9 Apr 2001 16:36:30 +0800
Hi all,
 
I write a sample code(user mode) to test the serial driver.
I can open COM1 and write string to COM1.
But, when I want to read data from COM1, the program will block at read function.
I trace the driver source code.
 
1.
When the program execute write operation, it will call tty_write( ) at /drivers/char/tty_io.c.
Then it will call gs_write( ) at /drivers/char/general.c.
 
2.
When the program execute read operation,it will call tty_read( ) at /drivers/char/tty_io.c.
Then I don't know which function would be called.
But it was blocked at operation which called (tty->ldisc.read)(tty,file,buf,count), as the following
 
/* Function tty_read( ) in tty_io.c */
if (tty->ldisc.read)
{
      /* Program will be blocked here */
      i = (tty->ldisc.read)(tty,file,buf,count);
 }
 else
 {
      /* Error happened */
      i = -EIO;
 }
 
What parameter should I reset?
Thanks in advance.
                                                                                                                            Green
 
<Prev in Thread] Current Thread [Next in Thread>