summaryrefslogtreecommitdiffstats
path: root/sbus.h
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2010-03-29 15:01:54 -0500
committerDennis Gilmore <dennis@ausil.us>2010-03-29 15:01:54 -0500
commit56c795c0115c0d62e9438b6b458f35c32ef6e366 (patch)
tree706c699dfcc357f021d287b380f29bec0ee25870 /sbus.h
downloadlssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.tar.gz
lssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.tar.xz
lssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.zip
import spots 0.1 tarballHEADmaster
Diffstat (limited to 'sbus.h')
-rw-r--r--sbus.h60
1 files changed, 60 insertions, 0 deletions
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 <stdio.h>
+
+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