test1.c File Reference

#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


Detailed Description

Definition in file test1.c.


Function Documentation

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]

Register child and inform user about it.

Parameters:
parent Parent device.
message Message for the user.
name Device name.
match_id Device match id.
score Device match score.

Definition at line 60 of file test1.c.

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.

Parameters:
dev New device.
Returns:
Error code reporting success of the operation.

Definition at line 125 of file test1.c.


Generated on Thu Jun 2 07:45:52 2011 for HelenOS/USB by  doxygen 1.4.7