Commit Graph

525 Commits

Author SHA1 Message Date
Patrick Porlan 2f0485e757 ringbuffer: Switch ringbuffer to g_slice allocator
This should allow for more efficient handling of equally sized
buffers, in terms of alignment and recycling.
2011-03-16 21:34:54 -05:00
Patrick Porlan bb0e3e0a58 PPP: Optimize write buffer management
Extend the write buffer handling in gathdlc.c to minimize stalling and
process switching during large PPP transfers. The single write buffer
is replaced by a queue of buffers, allowing for much larger emission
windows without hugely impacting memory consumption. This reduces the
time required to send 50 MB between a couple of local PPP interfaces on
my laptop from ~53s to ~3s.
2011-03-15 14:15:26 -05:00
Patrick Porlan 992019cad4 gatchat: Optimize ringbuffer modulo operations
Replace modulo operations in ringbuffer.c by masking operations.  This
is possible because the size of the ring buffers is always a power of
two, and yields a small performance improvement.

The improvement should be mostly visible on processors that implement
division in microcode (Atom) or lack a division instruction (ARM).
2011-03-02 22:50:32 -06:00
Denis Kenzior ef49d65b70 gsmdial: Introduce data_mode
If we're in PPP mode, then don't send unsolicited notifications.  Only a
NO CARRIER is really allowed.
2011-02-28 16:13:56 -06:00
Denis Kenzior 51d950994d gatserver: Tweak use of g_at_server_suspend/resume 2011-02-28 16:13:56 -06:00
Denis Kenzior d3350d6662 test-server: Make sure to send CONNECT
Before starting the ppp session we should make sure that the CONNECT
response has been sent on the wire.
2011-02-28 16:13:56 -06:00
Denis Kenzior 4da1a9318c gatserver: Exit garbage state on HDLC frame end 2011-02-28 16:13:56 -06:00
Denis Kenzior 6f8675d7fa gatppp: Try to detect no carrier conditions 2011-02-28 16:13:56 -06:00
Denis Kenzior ea56a71067 gatppp: Delay signaling ppp_down
Delay signaling of ppp_down until we exit the GAtHDLC read handler.
Otherwise exchanging the read handler on GAtIO might lead to funny
double consumption problems.
2011-02-28 16:13:56 -06:00
Denis Kenzior 0dc8e5e588 gathdlc: Try to detect no carrier conditions
Sometimes we receive the no carrier embedded in a stream following the
PPP packets.  This might be due to write scheduling on the remote side
or read scheduling locally.  Try not to consume the no carrier condition
and assume the previous hdlc frames will result in closing of the ppp
stack.
2011-02-28 16:13:56 -06:00
Denis Kenzior 703271e629 gatio: Remove stray empty line 2011-02-28 16:13:56 -06:00
Denis Kenzior 78eb4ee59c gatio: update comment 2011-02-28 16:13:56 -06:00
Denis Kenzior 09ca5aaef0 gathdlc: Unregister read / write handlers
When GAtHDLC is being unregistered make sure to unregister read / write
handlers so as not to crash.
2011-02-28 16:13:56 -06:00
Denis Kenzior 1cbe91090d gathdlc: drain the last hdlc frame processed
If we're being destroyed, we should drain the last HDLC frame
2011-02-28 16:13:56 -06:00
Denis Kenzior 2446d1aa43 gsmdial: register notification before resuming 2011-02-28 16:13:56 -06:00
Denis Kenzior 57f32ff899 ppp: Remove some g_prints 2011-02-28 16:13:56 -06:00
Denis Kenzior 75730bbaac ppp_cp: Replace some left over g_prints with DBG 2011-02-28 16:13:56 -06:00
Denis Kenzior e880aab120 gatppp: Replace some left-over g_prints with DBG 2011-02-28 16:13:55 -06:00
Denis Kenzior b6bc221bc8 gatppp: Send the final terminate ack
In the case where we're going down, but have a pending terminate ack,
delay signaling the upper layers until the ack has been put on the wire.
2011-02-28 16:13:55 -06:00
Denis Kenzior 802962adbc gatppp: Add a debug macro 2011-02-28 16:13:55 -06:00
Denis Kenzior 5ffe6f7beb gatio: Add write 'done' notifier
This allows external clients to get notified when GAtIO no longer has a
registered write watcher.  E.g. no more data is currently pending.
2011-02-28 16:13:55 -06:00
Denis Kenzior 3f2f11fe8f test-server: Remove root user check 2011-02-28 16:13:55 -06:00
Denis Kenzior 92404672fc gatserver: Update the internal command parsers
commit 61b30c025d changed the way the
command callbacks are being called (namely the contents of the GAtResult
object).  Most command callbacks were updated, but the internal ones
were forgotten.  This patch fixes this issue.
2011-02-28 16:13:51 -06:00
Denis Kenzior d841fc868a gatchat: Fix minor style issues 2011-02-25 10:55:08 -06:00
Frédéric Danis 8f8559edf6 gatchat: add g_at_result_iter_next_number_default API 2011-02-24 14:01:23 -06:00
Frédéric Dalleau 42224e2bbe gatserver: Add function to enable/disable echo 2011-02-23 09:31:07 -06:00
Olivier Guiter 4ae645d7e6 gatserver: Add various ATSx handlers 2011-02-22 09:45:59 -06:00
Guillaume Zajac 205d40db82 test-server: Fix crash when remote disconnects
If the remote side kills the connection when PPP is established, we
should not try to resume the AT server.
2011-02-17 11:30:47 -06:00
Denis Kenzior 36056ddb38 gsmdial: Fix minor style quirk 2011-02-16 15:45:39 -06:00
Gustavo F. Padovan c57c78062e gsmdial: add option for Bluetooth DUN dialing 2011-02-16 15:45:34 -06:00
Martin Xu 694589f51d PPP: Use default ACCM (0xffffffff) to trasmit
Using my Huawei EM770W modem, if set ACCM as 0x00000000, RXJ-
event breaks PPP link, after IP package transmit for a while.
Using default ACCM, the issue can be fixed.
I tested it at China Unicom networks.
2011-02-16 12:01:39 -06:00
Denis Kenzior 6eeaacc706 gatserver: Be more const correct 2011-02-16 00:23:44 -06:00
Denis Kenzior 55d54e377a test-server: Fix a few more occurrences 2011-02-15 16:05:02 -06:00
Denis Kenzior a6f910e27c gatserver: Change callback signature
Provide the originating GAtServer to the callback
2011-02-15 15:47:32 -06:00
Denis Kenzior a0cca0a970 gatserver: extend D with GSM/UMTS specifics 2011-02-15 15:47:32 -06:00
Denis Kenzior 5da299ad34 test-server: Behavior to match previous commit 2011-02-15 15:47:32 -06:00
Denis Kenzior 61b30c025d gatserver: Don't bother reporting command prefixes
The command line parser knows where the actual command line parameters
begin, so there's no need to make the callback skip the prefix and the
additional separator characters.
2011-02-15 15:47:32 -06:00
Martin Xu ad16e81aff PPP: Fix transmit ACCM and receive ACCM mixup
According to RFC1662 Section 7.1, ACCM Configuration Option is
used to inform the peer which control characters MUST remain
mapped when the peer sends them.
2011-02-14 14:22:32 -06:00
Olivier Guiter a1f5a5520a gatserver: Add ATS5 command feature 2011-02-14 09:51:30 -06:00
Denis Kenzior 2b9a14dd0c gatmux: Remove unused error variable 2011-02-08 16:48:52 -06:00
Carlos Pargada 1b10f55f5c gatchat: improve large file downlink data transfer
Fix large file downlink data transfer on IFX modem. Increase buffer size of
ring buffer to support close received Packets from the modem. Set highest
priority for write data on IO device
2011-01-20 12:59:40 +01:00
Marcel Holtmann d70011661c gatchat: The IO setup already ensures no encoding and no buffering 2011-01-20 10:56:21 +01:00
Marcel Holtmann 5d524cac73 gatchat: Small cleanup to make function look simpler 2011-01-20 10:55:31 +01:00
Marcel Holtmann 2f2460f5ae gatchat: Disable encoding for RawIP GIOChannel 2011-01-19 15:28:59 +01:00
Marcel Holtmann 2126700c3e gatchat: Fix setup of GIOChannel from multiplexer DLC 2011-01-19 12:10:10 +01:00
Denis Kenzior 45abba276b gatchat: Turn off buffering of GAtChat IO channels
After commit d83da35370 this was causing
the command queue to never run.
2011-01-18 12:16:19 -06:00
Olivier Guiter b931e77470 gatserver: ATS6 command handler added 2011-01-18 16:10:23 +01:00
Marcel Holtmann d83da35370 gatchat: Use g_io_channel_read_chars and g_io_channel_write_chars 2011-01-18 15:11:31 +01:00
Jeevaka Badrappan 2182336c8b gatchat: M15 coding styles fixes 2011-01-12 08:06:59 -08:00
Vinicius Costa Gomes 2702a2e349 gatchat: fix canceling in progress commands
As g_queue_peek_head() returns the node data field, we have to compare
it against the actual command, not against the pointer to the queue node.
2010-12-07 12:16:20 -06:00