Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* small memory usage fixes, split out meego devlock, Switch to g_mass…
…_storage for more recent kernels, Go to undefined if no matching mode is found, so non-existing modes are not set silently
- Loading branch information
Philippe De Swert
committed
Jan 13, 2012
1 parent
10347e8
commit 77679b7
Showing
14 changed files
with
204 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
@file usb-moded_network.c : (De)activates network depending on the network setting system. | ||
Copyright (C) 2011 Nokia Corporation. All rights reserved. | ||
Author: Philippe De Swert <philippe.de-swert@nokia.com> | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the Lesser GNU General Public License | ||
version 2 as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the Lesser GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
02110-1301 USA | ||
*/ | ||
|
||
/*============================================================================= */ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "usb_moded-network.h" | ||
|
||
#if CONNMAN | ||
#include <dbus/dbus.h> | ||
#include <dbus/dbus-glib.h> | ||
#include <dbus/dbus-glib-lowlevel.h> | ||
|
||
|
||
#endif | ||
|
||
/** | ||
* Activate the network interface | ||
* | ||
*/ | ||
int usb_network_up(void) | ||
{ | ||
#if CONNMAN | ||
DBusConnection *dbus_conn_connman = NULL; | ||
DBusMessage *msg = NULL, *reply = NULL; | ||
DBusError error; | ||
|
||
dbus_error_init(&error); | ||
|
||
if( (dbus_conn_connman = dbus_bus_get(DBUS_BUS_SYSTEM, &error)) == 0 ) | ||
{ | ||
log_err("Could not connect to dbus for connman\n"); | ||
} | ||
|
||
if ((msg = dbus_message_new_method_call("net.connman", "/", "net.connman.Service", connect)) != NULL) | ||
{ | ||
if ((reply = dbus_connection_send_with_reply_and_block(dbus_conn_connman, msg, -1, NULL)) != NULL) | ||
{ | ||
dbus_message_get_args(reply, NULL, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID); | ||
dbus_message_unref(reply); | ||
} | ||
dbus_message_unref(msg); | ||
} | ||
dbus_connection_unref(dbus_conn_connman); | ||
|
||
log_debug("connman state = %d\n", ret); | ||
return(ret); | ||
|
||
#else | ||
system("ifdown usb0 && ifup usb0"); | ||
return(0); | ||
#endif /* CONNMAN */ | ||
} | ||
|
||
/** | ||
* Deactivate the network interface | ||
* | ||
*/ | ||
int usb_network_down(void) | ||
{ | ||
#if CONNMAN | ||
#else | ||
system("ifdown usb0 down"); | ||
return(0); | ||
#endif /* CONNMAN */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright (C) 2011 Nokia Corporation. All rights reserved. | ||
Author: Philippe De Swert <philippe.de-swert@nokia.com> | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the Lesser GNU General Public License | ||
version 2 as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the Lesser GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
02110-1301 USA | ||
usb-moded_network : (De)activates network depending on the network setting system. | ||
*/ | ||
|
||
/*============================================================================= */ | ||
|
||
int usb_network_up(void); | ||
int usb_network_down(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.