Multiplexing data on serial port while pppd is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I am new to Linux programming but I already read a lot of articles from A.Rubinni (Linux Device Drivers), etc... and all kind of articles.
I also searched through the google groups, but still I did not find a solution to my problem. I will describe my problem in a few sentences.
I have a modem that can do multiplexing between data and AT commands. It is attached to the serial port (ttyS0 device). I read that the line
discipline is the sulution, when accessing custom made external devices with existing hardware protocol. The problem here arises when the
pppd starts, it repleaces default line discipline with its own to cut off ttyS0 and does all the serial communication within the kernel space.
Anything sent to the modem must contain a special data header (for data) and AT header for AT commands and also checksum.


AT ->      0xAA...[at command]checksum
DATA-> 0xDD..[data]checksum

0xAA    - modem recognizes that the AT comand is being send
0xDD    - modem recognizes that DATA is being send

All I need to do is encapsulate everything and write down to the ttyS0 and vice versa, decapsulate and send to application. My idea was to
have to different virtual devices tty_at and tty_data both accessing the ttyS0 but without race conditions. So I would start pppd with first
parameter (tty_device) tty_data (reading, writing on sockets from application), and on the other hand application would use tty_at to (read,
write) AT comands to the same port (ttyS0). AT comands must bypass the ppp layer, but data must go through the ppp layer. Is the solution
to write two seperate serial tty drivers one for each of my virtual serial devices or am I totaly wrong?


- Is it possible to bypass pppd and do the multiplexing without race conditions?
- What would be the most appropriate way of doing such a thing?


I thank you in advance for suggestions and I am sure you can show me the right direction.

Ales Voda






-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux