code_fodder
code_fodder

Reputation: 16341

linux kernel tty driver can you turn off echo by default in the code?

Related to this question: tty-flip-buffer-push-sends-data-back-to-itself

So I had the same issue, where I have written a driver and in my tty callback code that writes back out of the tty to the user (who is running cat /dev/mytty).

When I write to the tty it loops back and cat should print it out. However since echo it on it goes around in a loop forever. Entering the command stty -F /dev/mytty -echo fixes that.

So my question is in my driver code is there a setting that I can change to not default to echo on? Maybe in the tty_probe(...) or tty_set_operations(...) functinos?

Upvotes: 3

Views: 1657

Answers (1)

e.dan
e.dan

Reputation: 7487

You can turn off echo before the call to tty_set_operations() with something like the following:

tty_driver->init_termios.c_lflag &= ~ECHO;

Upvotes: 3

Related Questions