#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <str_error.h>
#include <ddf/driver.h>
#include <ddf/log.h>
#include "test1.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
Main entry point. | |
static int | register_fun_verbose (ddf_dev_t *parent, const char *message, const char *name, const char *match_id, int match_score, int expected_rc) |
Register child and inform user about it. | |
static int | test1_add_device (ddf_dev_t *dev) |
Callback when new device is passed to this driver. | |
Variables | |
static driver_ops_t | driver_ops |
static driver_t | test1_driver |
Definition in file test1.c.
static int register_fun_verbose | ( | ddf_dev_t * | parent, | |
const char * | message, | |||
const char * | name, | |||
const char * | match_id, | |||
int | match_score, | |||
int | expected_rc | |||
) | [static] |
static int test1_add_device | ( | ddf_dev_t * | dev | ) | [static] |
Callback when new device is passed to this driver.
This function is the body of the test: it shall register new child (named `clone') that shall be driven by the same task. When the clone is added, it registers another child (named `child') that is also driven by this task. The conditions ensure that we do not recurse indefinitely. When successful, the device tree shall contain following fragment:
/virtual/test1 /virtual/test1/clone /virtual/test1/clone/child
and devman shall not deadlock.
dev | New device. |