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
 

Reply via email to