platform/upstream/ofono.git
14 years agoppp: Refactor how tls/tlu/tld/tlf are used
Denis Kenzior [Tue, 13 Apr 2010 19:00:01 +0000 (14:00 -0500)]
ppp: Refactor how tls/tlu/tld/tlf are used

With the upper layer driving these, the special handling is no longer
required.

14 years agoppp: Let the upper layer handle open / up events
Denis Kenzior [Tue, 13 Apr 2010 18:58:12 +0000 (13:58 -0500)]
ppp: Let the upper layer handle open / up events

This removes the need for the layer_started functions in lcp and ipcp.
For LCP the link is always up unless the socket has been closed, and for
IPCP the link should be opened as soon as LCP is ready anyway.

14 years agoMerge: make link
Denis Kenzior [Tue, 13 Apr 2010 18:57:03 +0000 (13:57 -0500)]
Merge: make link

14 years agoppp: Reset the options whenever the layer is down
Denis Kenzior [Tue, 13 Apr 2010 18:34:12 +0000 (13:34 -0500)]
ppp: Reset the options whenever the layer is down

So we can re-negotiate the options if the layer is opened again.

14 years agoppp: Rename data to pppcp
Denis Kenzior [Mon, 12 Apr 2010 21:02:02 +0000 (16:02 -0500)]
ppp: Rename data to pppcp

14 years agoppp: unref should mean a hard shutdown
Denis Kenzior [Fri, 9 Apr 2010 21:01:30 +0000 (16:01 -0500)]
ppp: unref should mean a hard shutdown

This can happen when e.g. the modem is physically removed from the
system and it is not feasible to wait for the nice shutdown state to be
reached.

14 years agoppp: Signal Down & Close when socket is closed
Denis Kenzior [Fri, 9 Apr 2010 20:51:08 +0000 (15:51 -0500)]
ppp: Signal Down & Close when socket is closed

14 years agoppp: Add pppcp_signal_down
Denis Kenzior [Fri, 9 Apr 2010 19:40:05 +0000 (14:40 -0500)]
ppp: Add pppcp_signal_down

For use when the link is abruptly terminated by the remote side

14 years agoppp: Use pppcp_signal functions directly
Denis Kenzior [Fri, 9 Apr 2010 18:30:56 +0000 (13:30 -0500)]
ppp: Use pppcp_signal functions directly

No real need to wrap them behind lcp_ functions

14 years agoppp: Keep track when read watcher dies
Denis Kenzior [Fri, 9 Apr 2010 17:15:37 +0000 (12:15 -0500)]
ppp: Keep track when read watcher dies

14 years agoppp: Remove unused define
Denis Kenzior [Fri, 9 Apr 2010 16:49:10 +0000 (11:49 -0500)]
ppp: Remove unused define

14 years agoFix: busy loop in atserver
Denis Kenzior [Tue, 13 Apr 2010 03:33:04 +0000 (22:33 -0500)]
Fix: busy loop in atserver

14 years agoReindent the handler registration inside AT server
Marcel Holtmann [Tue, 13 Apr 2010 01:13:02 +0000 (18:13 -0700)]
Reindent the handler registration inside AT server

14 years agoUse ppp_debug() for PPP CP event debug statements
Marcel Holtmann [Tue, 13 Apr 2010 01:02:11 +0000 (18:02 -0700)]
Use ppp_debug() for PPP CP event debug statements

14 years agoRemove useless debug in PPP transmit destroy callback
Marcel Holtmann [Tue, 13 Apr 2010 00:53:29 +0000 (17:53 -0700)]
Remove useless debug in PPP transmit destroy callback

14 years agoRemove various GDestroyNotify function casting
Marcel Holtmann [Tue, 13 Apr 2010 00:48:20 +0000 (17:48 -0700)]
Remove various GDestroyNotify function casting

14 years agoThe exit() function should always use positive exit values
Marcel Holtmann [Tue, 13 Apr 2010 00:37:50 +0000 (17:37 -0700)]
The exit() function should always use positive exit values

14 years agoFix file descriptor leakage when closing PPP recording
Marcel Holtmann [Tue, 13 Apr 2010 00:33:44 +0000 (17:33 -0700)]
Fix file descriptor leakage when closing PPP recording

14 years agoThe AT+CGDATA command should return CONNECT on success
Marcel Holtmann [Mon, 12 Apr 2010 23:36:06 +0000 (16:36 -0700)]
The AT+CGDATA command should return CONNECT on success

14 years agoAdd fake support for AT+CGDATA and AT+CGDCONT inside AT server
Marcel Holtmann [Mon, 12 Apr 2010 23:34:13 +0000 (16:34 -0700)]
Add fake support for AT+CGDATA and AT+CGDCONT inside AT server

14 years agoAdd basic support for emulating AT+CGATT inside AT server
Marcel Holtmann [Mon, 12 Apr 2010 23:28:59 +0000 (16:28 -0700)]
Add basic support for emulating AT+CGATT inside AT server

14 years agoAdd basic support for emulating AT+CGREG inside AT server
Marcel Holtmann [Mon, 12 Apr 2010 23:22:57 +0000 (16:22 -0700)]
Add basic support for emulating AT+CGREG inside AT server

14 years agoAdd basic support for emulating AT+CREG inside AT server
Marcel Holtmann [Mon, 12 Apr 2010 23:19:34 +0000 (16:19 -0700)]
Add basic support for emulating AT+CREG inside AT server

14 years agoCheck for PIN after activating the modem
Marcel Holtmann [Sun, 11 Apr 2010 16:23:24 +0000 (18:23 +0200)]
Check for PIN after activating the modem

14 years agoReduce fake CFUN delay to 1 second to make testing simpler
Marcel Holtmann [Sun, 11 Apr 2010 16:18:01 +0000 (18:18 +0200)]
Reduce fake CFUN delay to 1 second to make testing simpler

14 years agoMake CPIN handling of AT server a bit more compliant
Marcel Holtmann [Sun, 11 Apr 2010 16:14:12 +0000 (18:14 +0200)]
Make CPIN handling of AT server a bit more compliant

14 years agoAdd really simple COPS support to AT command server
Marcel Holtmann [Sun, 11 Apr 2010 16:10:50 +0000 (18:10 +0200)]
Add really simple COPS support to AT command server

14 years agoThe user data pointer variable should be called user_data
Marcel Holtmann [Sun, 11 Apr 2010 15:42:40 +0000 (17:42 +0200)]
The user data pointer variable should be called user_data

14 years agoImplement full CFUN handling for AT server
Marcel Holtmann [Sun, 11 Apr 2010 15:36:34 +0000 (17:36 +0200)]
Implement full CFUN handling for AT server

14 years agoUse a ring buffer for non-blocking HDLC output streams
Marcel Holtmann [Sun, 11 Apr 2010 05:01:14 +0000 (07:01 +0200)]
Use a ring buffer for non-blocking HDLC output streams

14 years agoAdd initial implementation for QCDM test utility
Marcel Holtmann [Sat, 10 Apr 2010 13:13:23 +0000 (15:13 +0200)]
Add initial implementation for QCDM test utility

14 years agoAdd abstraction for HDLC stream handling
Marcel Holtmann [Sat, 10 Apr 2010 13:11:46 +0000 (15:11 +0200)]
Add abstraction for HDLC stream handling

14 years agoAdd utility helper for debugging binary blobs
Marcel Holtmann [Sat, 10 Apr 2010 09:56:11 +0000 (11:56 +0200)]
Add utility helper for debugging binary blobs

14 years agoAdd generic receive function definition
Marcel Holtmann [Sat, 10 Apr 2010 09:54:12 +0000 (11:54 +0200)]
Add generic receive function definition

14 years agoCheck for PIN status to see details in debug output
Marcel Holtmann [Sat, 10 Apr 2010 07:33:45 +0000 (09:33 +0200)]
Check for PIN status to see details in debug output

14 years agoAdd skeleton for QCDM test program
Marcel Holtmann [Fri, 9 Apr 2010 23:33:47 +0000 (01:33 +0200)]
Add skeleton for QCDM test program

14 years agoRemove one empty line and add another one
Marcel Holtmann [Fri, 9 Apr 2010 15:10:48 +0000 (17:10 +0200)]
Remove one empty line and add another one

14 years agoMove CRC-CCITT table and helper into separate file
Marcel Holtmann [Fri, 9 Apr 2010 15:08:30 +0000 (17:08 +0200)]
Move CRC-CCITT table and helper into separate file

14 years agoppp: Trivial style fix
Denis Kenzior [Fri, 9 Apr 2010 13:57:12 +0000 (08:57 -0500)]
ppp: Trivial style fix

Be more explicit

14 years agoppp: Use flags not booleans for ipcp options
Denis Kenzior [Fri, 9 Apr 2010 13:55:16 +0000 (08:55 -0500)]
ppp: Use flags not booleans for ipcp options

14 years agoppp: Use flags instead of booleans for lcp options
Denis Kenzior [Fri, 9 Apr 2010 13:44:29 +0000 (08:44 -0500)]
ppp: Use flags instead of booleans for lcp options

14 years agoppp: Stop the timer when re-starting
Denis Kenzior [Fri, 9 Apr 2010 00:47:58 +0000 (19:47 -0500)]
ppp: Stop the timer when re-starting

In case we receive NAK/REJ we should stop and re-start the timer,
otherwise we end up generating multiple Conf-Reqs

14 years agoppp: Rip out the now unused option string stuff
Denis Kenzior [Thu, 8 Apr 2010 21:43:47 +0000 (16:43 -0500)]
ppp: Rip out the now unused option string stuff

Using wireshark is much easier

14 years agoppp: Port LCP to the new option framework
Denis Kenzior [Thu, 8 Apr 2010 21:42:21 +0000 (16:42 -0500)]
ppp: Port LCP to the new option framework

14 years agoppp: port IPCP to the new option framework
Denis Kenzior [Thu, 8 Apr 2010 21:41:44 +0000 (16:41 -0500)]
ppp: port IPCP to the new option framework

14 years agoppp: Rip out the old option processing
Denis Kenzior [Thu, 8 Apr 2010 21:41:16 +0000 (16:41 -0500)]
ppp: Rip out the old option processing

Put in the new option processing

14 years agoppp: Fix make some functions const correct
Denis Kenzior [Thu, 8 Apr 2010 21:40:41 +0000 (16:40 -0500)]
ppp: Fix make some functions const correct

14 years agoppp: Make iterators work all the time
Denis Kenzior [Thu, 8 Apr 2010 21:40:13 +0000 (16:40 -0500)]
ppp: Make iterators work all the time

14 years agoppp: Move some one-time setters to the proto
Denis Kenzior [Thu, 8 Apr 2010 15:39:00 +0000 (10:39 -0500)]
ppp: Move some one-time setters to the proto

14 years agoppp: Add rca callback
Denis Kenzior [Wed, 7 Apr 2010 21:40:49 +0000 (16:40 -0500)]
ppp: Add rca callback

When the other side acks our options, then let us apply these options
locally and start using them

14 years agoppp: Add pppcp option iterators
Denis Kenzior [Wed, 7 Apr 2010 20:40:02 +0000 (15:40 -0500)]
ppp: Add pppcp option iterators

14 years agoppp: Remove lcp_protocol_reject
Denis Kenzior [Wed, 7 Apr 2010 21:26:15 +0000 (16:26 -0500)]
ppp: Remove lcp_protocol_reject

Use pppcp_send_reject_protocol

14 years agoppp: Move pppcp_timer_data private
Denis Kenzior [Wed, 7 Apr 2010 21:10:15 +0000 (16:10 -0500)]
ppp: Move pppcp_timer_data private

14 years agoppp: Cleanup ipcp.c
Denis Kenzior [Wed, 7 Apr 2010 19:49:57 +0000 (14:49 -0500)]
ppp: Cleanup ipcp.c

14 years agoppp: Hide away the magic_number in ppp_lcp.c
Denis Kenzior [Wed, 7 Apr 2010 19:49:10 +0000 (14:49 -0500)]
ppp: Hide away the magic_number in ppp_lcp.c

14 years agoppp: Use auth->proto, not ppp->proto
Denis Kenzior [Wed, 7 Apr 2010 04:11:26 +0000 (23:11 -0500)]
ppp: Use auth->proto, not ppp->proto

Otherwise we move on to NCP stage prematurely

14 years agoFix: Allow setting of tx ACCM
Denis Kenzior [Wed, 7 Apr 2010 03:45:14 +0000 (22:45 -0500)]
Fix: Allow setting of tx ACCM

Specification is explicit that ACCM defaults to ~0

14 years agoppp: Remove OPTION_ERR, treat errors as reject
Denis Kenzior [Wed, 7 Apr 2010 02:01:51 +0000 (21:01 -0500)]
ppp: Remove OPTION_ERR, treat errors as reject

14 years agoppp: Verify magic number is not zero
Denis Kenzior [Tue, 6 Apr 2010 22:39:16 +0000 (17:39 -0500)]
ppp: Verify magic number is not zero

14 years agoppp: Move up the look up table definition
Denis Kenzior [Tue, 6 Apr 2010 22:24:26 +0000 (17:24 -0500)]
ppp: Move up the look up table definition

14 years agoppp: Implement receive ACCM
Denis Kenzior [Tue, 6 Apr 2010 22:24:04 +0000 (17:24 -0500)]
ppp: Implement receive ACCM

14 years agoRefactor: Make struct pppcp declaration private
Denis Kenzior [Mon, 5 Apr 2010 21:55:28 +0000 (16:55 -0500)]
Refactor: Make struct pppcp declaration private

14 years agoRefactor: add pppcp_set/get_magic_number
Denis Kenzior [Mon, 5 Apr 2010 21:55:07 +0000 (16:55 -0500)]
Refactor: add pppcp_set/get_magic_number

14 years agoRefactor: add pppcp_set_prefix
Denis Kenzior [Mon, 5 Apr 2010 21:46:08 +0000 (16:46 -0500)]
Refactor: add pppcp_set_prefix

14 years agoRefactor: add pppcp_get_ppp
Denis Kenzior [Mon, 5 Apr 2010 21:44:00 +0000 (16:44 -0500)]
Refactor: add pppcp_get_ppp

14 years agoRefactor: add pppcp_set_option_strings
Denis Kenzior [Mon, 5 Apr 2010 21:42:17 +0000 (16:42 -0500)]
Refactor: add pppcp_set_option_strings

14 years agoRefactor: Move valid code selection to ipcp/lcp
Denis Kenzior [Mon, 5 Apr 2010 21:16:14 +0000 (16:16 -0500)]
Refactor: Move valid code selection to ipcp/lcp

We already have a set_valid_codes function, let us use it

14 years agoRefactor: Move packet_ops to a static look-up
Denis Kenzior [Mon, 5 Apr 2010 21:14:39 +0000 (16:14 -0500)]
Refactor: Move packet_ops to a static look-up

No need to allocate space for this, as it is always the same for all
instances.

14 years agoRefactor: Make option_scan more type safe
Denis Kenzior [Mon, 5 Apr 2010 19:32:11 +0000 (14:32 -0500)]
Refactor: Make option_scan more type safe

14 years agoRefactor: Make option_process more typesafe
Denis Kenzior [Mon, 5 Apr 2010 19:25:14 +0000 (14:25 -0500)]
Refactor: Make option_process more typesafe

option_process was declared with two gpointer arguments for the sole
reason of being used as a GFunc.  Casting to a GFunc or re-writing the
foreach as a loop is preferable.

14 years agoRefactor: Add pppcp_set_data & pppcp_get_data
Denis Kenzior [Mon, 5 Apr 2010 19:16:00 +0000 (14:16 -0500)]
Refactor: Add pppcp_set_data & pppcp_get_data

Using these functions makes the code much cleaner than trying to pass
the priv pointer everywhere

14 years agoMake pppcp_code enum a private structure
Marcel Holtmann [Mon, 5 Apr 2010 18:12:43 +0000 (11:12 -0700)]
Make pppcp_code enum a private structure

14 years agoMake pppcp_event_type enum a private structure
Marcel Holtmann [Mon, 5 Apr 2010 18:05:08 +0000 (11:05 -0700)]
Make pppcp_event_type enum a private structure

14 years agoRefactor: Move to a transition state table
Denis Kenzior [Mon, 5 Apr 2010 17:36:43 +0000 (12:36 -0500)]
Refactor: Move to a transition state table

It is much more compact to re-implement the transition states as a table
as opposed to functions with switch/case statements.  The logic is made
much easier to follow and much of the code duplication is eliminated

14 years agoRefactor: Make the enum assignments explicit
Denis Kenzior [Mon, 5 Apr 2010 15:13:10 +0000 (10:13 -0500)]
Refactor: Make the enum assignments explicit

They will be used for certain magic later on

14 years agoRefactor: Move the state definition to ppp_cp.c
Denis Kenzior [Mon, 5 Apr 2010 15:11:31 +0000 (10:11 -0500)]
Refactor: Move the state definition to ppp_cp.c

14 years agoppp: implement Max-Failure counter
Kristen Carlson Accardi [Sat, 3 Apr 2010 05:27:00 +0000 (22:27 -0700)]
ppp: implement Max-Failure counter

put a cap on the number of Configure-Nak packets we send.

14 years agoMove PPP constants where they are used
Marcel Holtmann [Sun, 4 Apr 2010 05:32:27 +0000 (22:32 -0700)]
Move PPP constants where they are used

14 years agoMake GAtPPP fields really private
Marcel Holtmann [Sun, 4 Apr 2010 05:25:09 +0000 (22:25 -0700)]
Make GAtPPP fields really private

14 years agoHide internals of ring buffer structure
Marcel Holtmann [Sat, 3 Apr 2010 04:51:19 +0000 (21:51 -0700)]
Hide internals of ring buffer structure

14 years agoRemove circular inclusion protection from ring buffer header
Marcel Holtmann [Sat, 3 Apr 2010 03:34:25 +0000 (20:34 -0700)]
Remove circular inclusion protection from ring buffer header

14 years agoFix some cases where g_try_new should be used
Marcel Holtmann [Sat, 3 Apr 2010 02:20:53 +0000 (19:20 -0700)]
Fix some cases where g_try_new should be used

14 years agoMove frame NULL checks into the unstuffing function
Marcel Holtmann [Sat, 3 Apr 2010 02:06:31 +0000 (19:06 -0700)]
Move frame NULL checks into the unstuffing function

14 years agoFix coding style with callback structures
Marcel Holtmann [Sat, 3 Apr 2010 02:01:38 +0000 (19:01 -0700)]
Fix coding style with callback structures

14 years agoppp: implement net close
Kristen Carlson Accardi [Fri, 2 Apr 2010 23:45:24 +0000 (16:45 -0700)]
ppp: implement net close

14 years agoRefactor: Get rid of (now) pointless comments
Denis Kenzior [Fri, 2 Apr 2010 20:22:23 +0000 (15:22 -0500)]
Refactor: Get rid of (now) pointless comments

14 years agoAlso the default case should have a break statement
Marcel Holtmann [Fri, 2 Apr 2010 20:48:44 +0000 (13:48 -0700)]
Also the default case should have a break statement

14 years agoRemove the PPP option from gsmdial
Denis Kenzior [Fri, 2 Apr 2010 20:13:25 +0000 (15:13 -0500)]
Remove the PPP option from gsmdial

Pointless since we should always connect using PPP

14 years agoRefactor: Get rid of packet handler registrations
Denis Kenzior [Fri, 2 Apr 2010 20:10:29 +0000 (15:10 -0500)]
Refactor: Get rid of packet handler registrations

There are only about 4 protocols that the current ppp code handles and
it is doubtful that it will grow much more.  There's no point in having
an extensive packet handler registration framework.

14 years agoFix tabs vs. whitespace coding style violation
Marcel Holtmann [Fri, 2 Apr 2010 20:34:10 +0000 (13:34 -0700)]
Fix tabs vs. whitespace coding style violation

14 years agoAdd more missing break statements
Marcel Holtmann [Fri, 2 Apr 2010 20:33:35 +0000 (13:33 -0700)]
Add more missing break statements

14 years agoppp: fix missing breaks in switch statements
Kristen Carlson Accardi [Fri, 2 Apr 2010 20:16:35 +0000 (13:16 -0700)]
ppp: fix missing breaks in switch statements

14 years agoAdd missing break or fall through comments to switch statements
Marcel Holtmann [Fri, 2 Apr 2010 19:40:45 +0000 (12:40 -0700)]
Add missing break or fall through comments to switch statements

14 years agoAlways reset option_rval for every option
Marcel Holtmann [Fri, 2 Apr 2010 18:43:20 +0000 (11:43 -0700)]
Always reset option_rval for every option

14 years agoAdd missing arpa/inet.h includes
Marcel Holtmann [Fri, 2 Apr 2010 18:42:42 +0000 (11:42 -0700)]
Add missing arpa/inet.h includes

14 years agoppp: use queue to transmit
Kristen Carlson Accardi [Fri, 2 Apr 2010 18:13:20 +0000 (11:13 -0700)]
ppp: use queue to transmit

Since we are using non buffered I/O, use a queue to transmit when buffer
space is available.

14 years agoSplit out ipcp protocol into ppp_ipcp.c
Denis Kenzior [Fri, 2 Apr 2010 17:42:04 +0000 (12:42 -0500)]
Split out ipcp protocol into ppp_ipcp.c

14 years agoppp: fix event generation on close
Kristen Carlson Accardi [Fri, 2 Apr 2010 17:28:18 +0000 (10:28 -0700)]
ppp: fix event generation on close

Prevents too early transition to PPP_DEAD

14 years agoFix: Make the C-APDU logic more readable
Denis Kenzior [Fri, 2 Apr 2010 16:28:02 +0000 (11:28 -0500)]
Fix: Make the C-APDU logic more readable

14 years agoStyle: Multiline comments
Denis Kenzior [Fri, 2 Apr 2010 16:20:44 +0000 (11:20 -0500)]
Style: Multiline comments