static struct {
uint64_t id;
int ongoing;
- struct trans_info ti;
+ struct syscommon_plugin_deviced_power_trans_info ti;
GList *waitings;
int transient_step;
int max_wait_timer;
};
static int transition_request_callback(void *data);
-static void prepare_transition(const struct trans_info *ti);
+static void prepare_transition(const struct syscommon_plugin_deviced_power_trans_info *ti);
static void action_transition(void);
static uint64_t get_next_state(void);
static uint64_t available_starting_state(void)
{
- struct trans_info *ti = NULL;
+ struct syscommon_plugin_deviced_power_trans_info *ti = NULL;
// If there is pending transition,
// the available state is the last state of pendiong transitions.
return transition_context.ongoing ? transition_context.ti.next : current;
}
-static int dequeue_transition(struct trans_info *ti)
+static int dequeue_transition(struct syscommon_plugin_deviced_power_trans_info *ti)
{
- struct trans_info *tail = NULL;
+ struct syscommon_plugin_deviced_power_trans_info *tail = NULL;
tail = g_queue_pop_tail(transition_queue);
if (!tail)
return 0;
}
-static void enqueue_transition(const struct trans_info *ti)
+static void enqueue_transition(const struct syscommon_plugin_deviced_power_trans_info *ti)
{
- struct trans_info *ti_new = NULL;
+ struct syscommon_plugin_deviced_power_trans_info *ti_new = NULL;
if (!ti)
return;
- ti_new = calloc(1, sizeof(struct trans_info));
+ ti_new = calloc(1, sizeof(struct syscommon_plugin_deviced_power_trans_info));
if (!ti_new)
return;
- memcpy(ti_new, ti, sizeof(struct trans_info));
+ memcpy(ti_new, ti, sizeof(struct syscommon_plugin_deviced_power_trans_info));
- g_queue_push_head(transition_queue, memcpy(ti_new, ti, sizeof(struct trans_info)));
+ g_queue_push_head(transition_queue, memcpy(ti_new, ti, sizeof(struct syscommon_plugin_deviced_power_trans_info)));
}
// intermediate state of ongoing transition
static void cancel_transition(void)
{
- struct trans_info *ti = NULL;
+ struct syscommon_plugin_deviced_power_trans_info *ti = NULL;
- struct trans_info poweroff = { .next = DEVICED_POWER_STATE_UNDEFINED };
- struct trans_info undo = {
+ struct syscommon_plugin_deviced_power_trans_info poweroff = { .next = DEVICED_POWER_STATE_UNDEFINED };
+ struct syscommon_plugin_deviced_power_trans_info undo = {
.curr = transition_context.ti.next,
.next = transition_context.ti.curr,
/**
static void action_transition(void)
{
uint64_t state = get_next_state();
- struct trans_info ti = { 0 , };
+ struct syscommon_plugin_deviced_power_trans_info ti = { 0 , };
int retval;
int index;
}
}
-static void prepare_transition(const struct trans_info *ti)
+static void prepare_transition(const struct syscommon_plugin_deviced_power_trans_info *ti)
{
assert(transition_context.waitings == NULL);
assert(transition_context.max_wait_timer == 0);
if (ti) {
- transition_context.ti = (struct trans_info) {
+ transition_context.ti = (struct syscommon_plugin_deviced_power_trans_info) {
.curr = ti->curr,
.next = ti->next,
.reason = ti->reason,
static gint find_ti_by_state(gconstpointer data, gconstpointer udata)
{
- const struct trans_info *ti = (const struct trans_info *) data;
+ const struct syscommon_plugin_deviced_power_trans_info *ti = (const struct trans_info *) data;
const uint64_t state = *(const uint64_t *) udata;
if (ti->curr & state)
static int transition_request_callback(void *data)
{
GList *ti_list, *l;
- const struct trans_info *t = NULL;
- struct trans_info ti = { 0 , };
+ const struct syscommon_plugin_deviced_power_trans_info *t = NULL;
+ struct syscommon_plugin_deviced_power_trans_info ti = { 0 , };
uint64_t available;
if (!data)
return 0;
}
- ti = (struct trans_info) {
+ ti = (struct syscommon_plugin_deviced_power_trans_info) {
.curr = available,
.next = t->next,
.reason = t->reason,
static int delayed_init_callback(void *data)
{
int retval;
- struct trans_info ti = { 0 , };
+ struct syscommon_plugin_deviced_power_trans_info ti = { 0 , };
delayed_init_done = 1;