I know that tty line discipline processes special characters (such as ^C, ^? and etc), but it is only about input from pty master device. But what about input from pty slave device? What tty line discipline does with input from pty slave device? Where can I find some code examples?
Line discipline doesn't apply to pty master device, which is simply a interface to receive or send bytes to "generic tty".
A generic tty is basically a tty device (either /dev/ttyx or pty slave device) with a line discipline, which transform the bytes from another end (either kernel terminal emulator or pty master device) into certain signals or do line-buffer-editing