Re: serial and tty driver

2007-02-18 Thread Theodore Tso
On Sun, Feb 18, 2007 at 11:52:58AM +0300, Mockern wrote:
> Thank you for you respond.
> 
> I asked this question since I have one problem with my tty driver.
> It based on serial_core.c. It works well except Linux cat operation:(.
> (e.g. cat < ttyS10). I thought in tty driver there is no function
> for this operation and I wanted to know that maybe serial driver has it.
> 
> Could it be the reason that cat operation in tty driver does not work
> (but I can write and read from user space application!)?
> Or maybe I need to implement a special function in my tty driver to support 
> Linux
> cat operation?

If you do something like "cat < ttyS10" it will work by opening the
device just like a user space application --- but the shell, which is
opening /dev/ttyS10, won't use any of the special flags that a user
space application might use to not wait for the carrier detect line to
go high, for example.  

I'd have to see the sources of the driver and your user space
application to be sure, but one thing you should try is "stty -F
/dev/ttyS10 clocal" and see if that allows "cat < /dev/ttyS10" to
work.  

Regards,

- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-18 Thread Mockern
Thank you for you respond.

I asked this question since I have one problem with my tty driver.
It based on serial_core.c. It works well except Linux cat operation:(.
(e.g. cat < ttyS10). I thought in tty driver there is no function
for this operation and I wanted to know that maybe serial driver has it.

Could it be the reason that cat operation in tty driver does not work
(but I can write and read from user space application!)?
Or maybe I need to implement a special function in my tty driver to support 
Linux
cat operation?

Thank you again 

  

>On Sat, Feb 17, 2007 at 12:24:22PM -0600, Paul Fulghum wrote:
>> Mockern wrote:
>> >I have a question, what is really difference between serial and tty
>> >drivers?
>> >
>> >As I understand tty is high level and communicates with user space. 
>> 
>> The serial core implements many of the details of a tty
>> driver in a common place so that individual hardware drivers
>> (serial drivers) only need implement the hardware specific code.
>> 
>> This prevents duplicating tty logic in many drivers,
>> with the possibility of mistakes/inconsistency in the
>> different tty drivers.
>> 
>> The stand alone tty drivers are mostly legacy code from
>> the time before serial core that have not been ported
>> to be a serial drivers.
>
>Not necessarily; there are a number of tty drivers, such as the
>console drivers and pseudo-tty drivers that have absolutely nothing to
>do with an RS-232 port.
>
>On the other side of the argument, another factorization of the layers
>that might have made sense was to move the functionality to the
>high-level tty layer (or in the case of hangup code, all the way up to
>the VFS layer as a generic sys_revoke functionality), but the reason
>why it didn't is largely historical.
>
>   - Ted
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/


-- 
Яндекс.Почта: объем почтового ящика не ограничен! 
http://mail.yandex.ru/monitoring/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-18 Thread Mockern
Thank you for you respond.

I asked this question since I have one problem with my tty driver.
It based on serial_core.c. It works well except Linux cat operation:(.
(e.g. cat  ttyS10). I thought in tty driver there is no function
for this operation and I wanted to know that maybe serial driver has it.

Could it be the reason that cat operation in tty driver does not work
(but I can write and read from user space application!)?
Or maybe I need to implement a special function in my tty driver to support 
Linux
cat operation?

Thank you again 

  

On Sat, Feb 17, 2007 at 12:24:22PM -0600, Paul Fulghum wrote:
 Mockern wrote:
 I have a question, what is really difference between serial and tty
 drivers?
 
 As I understand tty is high level and communicates with user space. 
 
 The serial core implements many of the details of a tty
 driver in a common place so that individual hardware drivers
 (serial drivers) only need implement the hardware specific code.
 
 This prevents duplicating tty logic in many drivers,
 with the possibility of mistakes/inconsistency in the
 different tty drivers.
 
 The stand alone tty drivers are mostly legacy code from
 the time before serial core that have not been ported
 to be a serial drivers.

Not necessarily; there are a number of tty drivers, such as the
console drivers and pseudo-tty drivers that have absolutely nothing to
do with an RS-232 port.

On the other side of the argument, another factorization of the layers
that might have made sense was to move the functionality to the
high-level tty layer (or in the case of hangup code, all the way up to
the VFS layer as a generic sys_revoke functionality), but the reason
why it didn't is largely historical.

   - Ted
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


-- 
Яндекс.Почта: объем почтового ящика не ограничен! 
http://mail.yandex.ru/monitoring/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-18 Thread Theodore Tso
On Sun, Feb 18, 2007 at 11:52:58AM +0300, Mockern wrote:
 Thank you for you respond.
 
 I asked this question since I have one problem with my tty driver.
 It based on serial_core.c. It works well except Linux cat operation:(.
 (e.g. cat  ttyS10). I thought in tty driver there is no function
 for this operation and I wanted to know that maybe serial driver has it.
 
 Could it be the reason that cat operation in tty driver does not work
 (but I can write and read from user space application!)?
 Or maybe I need to implement a special function in my tty driver to support 
 Linux
 cat operation?

If you do something like cat  ttyS10 it will work by opening the
device just like a user space application --- but the shell, which is
opening /dev/ttyS10, won't use any of the special flags that a user
space application might use to not wait for the carrier detect line to
go high, for example.  

I'd have to see the sources of the driver and your user space
application to be sure, but one thing you should try is stty -F
/dev/ttyS10 clocal and see if that allows cat  /dev/ttyS10 to
work.  

Regards,

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-17 Thread Theodore Tso
On Sat, Feb 17, 2007 at 12:24:22PM -0600, Paul Fulghum wrote:
> Mockern wrote:
> >I have a question, what is really difference between serial and tty
> >drivers?
> >
> >As I understand tty is high level and communicates with user space. 
> 
> The serial core implements many of the details of a tty
> driver in a common place so that individual hardware drivers
> (serial drivers) only need implement the hardware specific code.
> 
> This prevents duplicating tty logic in many drivers,
> with the possibility of mistakes/inconsistency in the
> different tty drivers.
> 
> The stand alone tty drivers are mostly legacy code from
> the time before serial core that have not been ported
> to be a serial drivers.

Not necessarily; there are a number of tty drivers, such as the
console drivers and pseudo-tty drivers that have absolutely nothing to
do with an RS-232 port.

On the other side of the argument, another factorization of the layers
that might have made sense was to move the functionality to the
high-level tty layer (or in the case of hangup code, all the way up to
the VFS layer as a generic sys_revoke functionality), but the reason
why it didn't is largely historical.

- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial or tty driver

2007-02-17 Thread H. Peter Anvin

Mockern wrote:

I have a question, what is really difference between serial and tty drivers?
As I understand tty is high level and communicates with user space. 


That's pretty much it, yes.  When you're talking to a serial port, you 
have a stack that looks roughly like:


(Userspace)
VFS layer
tty layer --\
serial core layerline discipline
serial driver
(Hardware)

There are other devices which can exist below the tty layer, like the 
pty driver:


(Userspace)
VFS layer
tty layer --\
pty driver   line discipline

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-17 Thread Paul Fulghum

Mockern wrote:

I have a question, what is really difference between serial and tty
drivers?

As I understand tty is high level and communicates with user space. 


The serial core implements many of the details of a tty
driver in a common place so that individual hardware drivers
(serial drivers) only need implement the hardware specific code.

This prevents duplicating tty logic in many drivers,
with the possibility of mistakes/inconsistency in the
different tty drivers.

The stand alone tty drivers are mostly legacy code from
the time before serial core that have not been ported
to be a serial drivers.

--
Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-17 Thread Paul Fulghum

Mockern wrote:

I have a question, what is really difference between serial and tty
drivers?

As I understand tty is high level and communicates with user space. 


The serial core implements many of the details of a tty
driver in a common place so that individual hardware drivers
(serial drivers) only need implement the hardware specific code.

This prevents duplicating tty logic in many drivers,
with the possibility of mistakes/inconsistency in the
different tty drivers.

The stand alone tty drivers are mostly legacy code from
the time before serial core that have not been ported
to be a serial drivers.

--
Paul
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial or tty driver

2007-02-17 Thread H. Peter Anvin

Mockern wrote:

I have a question, what is really difference between serial and tty drivers?
As I understand tty is high level and communicates with user space. 


That's pretty much it, yes.  When you're talking to a serial port, you 
have a stack that looks roughly like:


(Userspace)
VFS layer
tty layer --\
serial core layerline discipline
serial driver
(Hardware)

There are other devices which can exist below the tty layer, like the 
pty driver:


(Userspace)
VFS layer
tty layer --\
pty driver   line discipline

-hpa
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: serial and tty driver

2007-02-17 Thread Theodore Tso
On Sat, Feb 17, 2007 at 12:24:22PM -0600, Paul Fulghum wrote:
 Mockern wrote:
 I have a question, what is really difference between serial and tty
 drivers?
 
 As I understand tty is high level and communicates with user space. 
 
 The serial core implements many of the details of a tty
 driver in a common place so that individual hardware drivers
 (serial drivers) only need implement the hardware specific code.
 
 This prevents duplicating tty logic in many drivers,
 with the possibility of mistakes/inconsistency in the
 different tty drivers.
 
 The stand alone tty drivers are mostly legacy code from
 the time before serial core that have not been ported
 to be a serial drivers.

Not necessarily; there are a number of tty drivers, such as the
console drivers and pseudo-tty drivers that have absolutely nothing to
do with an RS-232 port.

On the other side of the argument, another factorization of the layers
that might have made sense was to move the functionality to the
high-level tty layer (or in the case of hangup code, all the way up to
the VFS layer as a generic sys_revoke functionality), but the reason
why it didn't is largely historical.

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/