Commit 62d21830 authored by spiiroin's avatar spiiroin

Merge branch 'mer1765_broken_config' into 'master'

Use MEEGOLOCK features only when enabled

See merge request !24
parents 3b81d0f9 1e3378f6
......@@ -21,6 +21,10 @@
02110-1301 USA
*/
#ifndef MEEGOLOCK
# warning usb_moded-dsme.h included without enabling MEEGOLOCK
#endif
gboolean is_in_user_state(void);
gboolean dsme_listener_start(void);
void dsme_listener_stop(void);
......@@ -53,10 +53,15 @@
#define UDHCP_CONFIG_LINK "/etc/udhcpd.conf"
const char default_interface[] = "usb0";
/** IP forwarding configuration block */
typedef struct ipforward_data
{
/** Address of primary DNS */
char *dns1;
/** Address of secondary DNS */
char *dns2;
/** Interface from which packets should be forwarded */
char *nat_interface;
}ipforward_data;
......
......@@ -50,8 +50,11 @@ static int cleanup = 0;
static int cable = 0, charger = 0;
static guint cable_connection_timeout_id = 0;
/** Bookkeeping data for power supply locating heuristics */
typedef struct power_device {
/** Device path used by udev */
const char *syspath;
/** Likelyhood of being power supply */
int score;
} power_device;
......
......@@ -32,13 +32,13 @@
#include <signal.h>
#include <libkmod.h>
#ifdef SYSTEMD
#include <systemd/sd-daemon.h>
#endif
#include "usb_moded.h"
#include "usb_moded-modes.h"
#include "usb_moded-dsme.h"
#include "usb_moded-dbus.h"
#include "usb_moded-dbus-private.h"
#include "usb_moded-hw-ab.h"
......@@ -55,6 +55,7 @@
#include "usb_moded-mac.h"
#include "usb_moded-android.h"
#include "usb_moded-systemd.h"
#ifdef MEEGOLOCK
#include "usb_moded-dsme.h"
#endif
......@@ -280,10 +281,12 @@ rethink_usb_charging_fallback(void)
/* Device must be in USER state or in rescue mode
*/
#ifdef MEEGOLOCK
if( !is_in_user_state() && !rescue_mode ) {
log_notice("device is not in USER mode; stay in %s", usb_mode);
goto EXIT;
}
#endif
log_debug("attempt to leave %s", usb_mode);
set_usb_connected_state();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment