* modem multiplexing mode?
@ 2003-08-19 9:51 Dalibor Kranjcic
2003-08-19 13:43 ` Theodore Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Dalibor Kranjcic @ 2003-08-19 9:51 UTC (permalink / raw)
To: linux-serial
Hi,
Is there any way to send addtional traffic (AT commands) to serial port
(/dev/ttyS1 (COM2) in my example) when ppp is atached to it, thus
providing something as a modem
multiplexing mode/protocol (Wavecom GPRS modem), since /dev/ttyS1 is
locked by pppd and used by ppp modules.
I tried to use /dev/ttyS12 as virtual port for COM2, which would
allow sending of additional data flow to COM2 independently from the
data flow which is already sent trough /dev/ttyS1 (ppp traffic).
So, I expect write to /dev/ttyS12 to activate rs_interrupt_single method
which does the actual write in serial driver.
Once I'm in rs_interrupt_single method I
would redirect the incoming user space data to TX lines for COM2.
The write to /dev/ttyS12 fails with EIO Input/Output error, I suppose
because there is no UART defined for this device and some initialization
stuff doesn't go trough.
Is there any way to have more (virtual) tty device files for the same
COM
thus allowing AT commands to be sent despite present ppp traffic.
Is it possible to send AT commands when ppp traffic is running on serial
port?
Thanks for any advice...
Dalibor Kranjcic.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: modem multiplexing mode?
2003-08-19 9:51 modem multiplexing mode? Dalibor Kranjcic
@ 2003-08-19 13:43 ` Theodore Ts'o
0 siblings, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2003-08-19 13:43 UTC (permalink / raw)
To: Dalibor Kranjcic; +Cc: linux-serial
On Tue, Aug 19, 2003 at 11:51:32AM +0200, Dalibor Kranjcic wrote:
> Is there any way to send addtional traffic (AT commands) to serial port
> (/dev/ttyS1 (COM2) in my example) when ppp is atached to it, thus
> providing something as a modem
> multiplexing mode/protocol (Wavecom GPRS modem), since /dev/ttyS1 is
> locked by pppd and used by ppp modules.
This is actually a very hard problem, since there's a fundamental race
condition --- you need to at the kernel level, block off access to the
ppp port while your user space application sends commands to the
modem, and the kernel would have to send +++ to put the modem into
command mode, which means the kernel would need to know about the
modem command sequences. Worse yet, there is no way of know whether
or not the "OK\n" printed after you send the +++ sequence is the
response from the modem, or part of an incoming PPP packet that was
sent just as you were trying to put the modem into command mode.
> Is it possible to send AT commands when ppp traffic is running on serial
> port?
It's possible, but it would require a lot of kernel hacking, not only
in the serial driver (and putting carnal knowledge about modems into
the serial driver where it has no place belonging), but also in the
PPP driver, in order to intercept the return messages from the modem.
It would be a very, very, very, very hard thing to do. And probably
not worth it. Why would you want to do such a thing, anyway?
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
* modem multiplexing mode?
@ 2003-08-21 7:28 Dalibor Kranjcic
0 siblings, 0 replies; 3+ messages in thread
From: Dalibor Kranjcic @ 2003-08-21 7:28 UTC (permalink / raw)
To: linux-serial
Hi,
I have managed to modify serial driver for the Wavecom modem in order to
send AT commands and
PPP traffic separately with use of external fifo:
When traffic comes to the serial driver I check if it is AT or DATA. If
DATA (PPP) traffic comes to serial I proceed it normally, if AT traffic
comes I write it to the external fifo (let's say /dev/ATtraffic).
Sending traffic to serial driver is a little bit tricky. After writing
to fifo I need an entry point to the driver.
Driver must know that something was written to fifo. So I open an
'dummy' device for example /dev/ttyS12. This allows me to jump into
driver's rs_open method. From there I can read AT commands written to
fifo previously and proceed them to the TX line. Of course this traffic
must be multiplexed before coming to TX lines and I also have to watch
out not to break ppp packets in the middle.
This works well and I'm really able to send/receive AT packets while ppp
is up, but maybe there is better way to do it?
What do you think about this solution?
Thanks for any advice...
Dalibor.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-08-21 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-19 9:51 modem multiplexing mode? Dalibor Kranjcic
2003-08-19 13:43 ` Theodore Ts'o
-- strict thread matches above, loose matches on Subject: below --
2003-08-21 7:28 Dalibor Kranjcic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox