Hello, I'm using 2.6.22 version on ARM board. I have a custom device attached to UART and would like to implement my own driver. I would like to implement 'line discipline' (to send and receive complete packets from device and send them to userspace without fragmentation) and also would like to have it's own character device e.g. /dev/mydev0 so when someone opens that device /dev/ttyS0 gets disconnected from UART and my driver interacts with it using my line discipline. Also there are other lines connected to the device (reset etc. so I would like to control them using gpio).

As I understand it so far I need to write my own TTY driver to have my own /dev/mydev0 device and then make it use my own line discipline.. but how can I bind it to any particular USART (e.g. /dev/ttyS0 or /dev/ttyS1 etc. so when someone opens /dev/mydev0 ttyS0 gets used internally and if /dev/mydev1 ttyS1 and so on.)?

The other question is, I would like to use USART in synchronous mode, but haven't found any support for it in linux. Would it be possible to change the driver, add custom ioctl so it can change to synchronous mode and use this only from my custom device driver?

Any advice would be appreciated. Thank You very much

karel