From 56c795c0115c0d62e9438b6b458f35c32ef6e366 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 29 Mar 2010 15:01:54 -0500 Subject: import spots 0.1 tarball --- sbus.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sbus.h (limited to 'sbus.h') diff --git a/sbus.h b/sbus.h new file mode 100644 index 0000000..8ba1d63 --- /dev/null +++ b/sbus.h @@ -0,0 +1,60 @@ +#ifndef _SBUS_H_ +#define _SBUS_H_ + +#include + +enum deviceClass { + CLASS_UNSPEC, CLASS_OTHER, CLASS_NETWORK, CLASS_SCSI, CLASS_MOUSE, + CLASS_AUDIO, CLASS_VIDEO +}; + +enum deviceBus { + /* + * BUS_SBUS is sort of a misnomer - it's more or less Sun + * OpenPROM probing of all various associated non-PCI buses + */ + BUS_UNSPEC = 0, + BUS_OTHER = (1 << 0), + BUS_SBUS = (1 << 1), +}; + +struct sbusDevice { + struct device *next; /* next device in list */ + int index; + enum deviceClass class; /* type */ + enum deviceBus bus; /* bus it's attached to */ + char * device; /* device file associated with it */ + char * desc; /* a description */ + /* sbus specific fields */ + struct sbusDevice *(*newDevice) (struct sbusDevice *dev ); + void (*freeDevice) (struct sbusDevice *dev); + void (*writeDevice) (struct sbusDevice *dev); + + int width; + int height; + int freq; + int monitor; +}; + +struct sbusDevice *sbusNewDevice(struct sbusDevice *dev); +struct device *sbusProbe(enum deviceClass probeClass, + struct device *devlist); + +struct device { + struct device *next; + int index; + enum deviceClass class; /* type */ + enum deviceBus bus; /* bus it's attached to */ + char * device; /* device file associated with it */ + char * desc; /* a description */ + struct device *(*newDevice) (struct device *old, struct device *new); + void (*freeDevice) (struct sbusDevice *dev); + void (*writeDevice) (struct device *dev); +}; + +struct device *newDevice(struct device *old, struct device *new); +void freeDevice(struct device *dev); +void writeDevice(struct device *dev); +struct device *readDevice(FILE *file); + +#endif -- cgit