[Top] [All Lists]

I can't read data from COM1

To: "LinuxKernelMailList" <>, "MipsMailList" <>, "LinuxEmbeddedMailList" <>
Subject: I can't read data from COM1
From: "Green" <>
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.
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.
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->,file,buf,count), as the following
/* Function tty_read( ) in tty_io.c */
if (tty->
      /* Program will be blocked here */
      i = (tty->,file,buf,count);
      /* Error happened */
      i = -EIO;
What parameter should I reset?
Thanks in advance.
<Prev in Thread] Current Thread [Next in Thread>