00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00015
00016
00017
#ifndef _OTTO_DEV_H
00018
#define _OTTO_DEV_H
00019
00020
00022 enum otto_link_type
00023 {
00024
OTTO_LINK_TYPE_UNKNOWN = 0,
00025
OTTO_LINK_TYPE_ISO,
00026
OTTO_LINK_TYPE_VPW,
00027
OTTO_LINK_TYPE_PWM,
00028 };
00029
00031 struct otto_device
00032 {
00033 char *
file;
00034 int rate;
00035 int flags;
00036 void *
priv;
00037
00038 int nbus;
00039 struct otto_bus *
busses;
00040
00041 struct otto_driver *
drv;
00042 struct otto_device *
next;
00043 };
00044
00046 struct otto_bus
00047 {
00048 enum otto_link_type type;
00049 int rate;
00050 int flags;
00051 void *
priv;
00052 };
00053
00054
00058 struct otto_driver
00059 {
00060 char *
name;
00061 char *
desc;
00062 char *
author;
00063 char *
license;
00064
00065
struct otto_device * (*open) (
const char *);
00066 int (*close) (
struct otto_device *);
00067 int (*write) (
struct otto_device *,
int,
union otto_packet *);
00068 int (*read) (
struct otto_device *,
int,
union otto_packet *);
00069 int (*control) (
struct otto_device *,
int,
void *,
int );
00070
00071 struct otto_device *
dev_first;
00072 struct otto_driver *
next;
00073 };
00074
00075
00077
void
00078
otto_register(
00079
struct otto_driver *drv
00080 );
00081
00084
struct otto_device *
00085
otto_open(
00086
const char *name,
00087
const char *fname
00088 );
00089
00091
int
00092
otto_close(
00093
struct otto_device *dev
00094 );
00095
00097
int
00098
otto_write(
00099
struct otto_device *dev,
00100
int bus,
00101
union otto_packet *packet,
00102 size_t size
00103 );
00104
00106
int
00107
otto_read(
00108
struct otto_device *dev,
00109
int bus,
00110
union otto_packet *packet,
00111 size_t size
00112 );
00113
00116
int
00117
otto_control(
00118
struct otto_device *dev,
00119
int bus,
00120
void *data,
00121
int cmd
00122 );
00123
00126
int
00127
otto_getselectfd(
00128
struct otto_device *dev
00129 );
00130
00131
00132
#endif