diff options
author | Dennis Gilmore <dennis@ausil.us> | 2010-03-29 15:01:54 -0500 |
---|---|---|
committer | Dennis Gilmore <dennis@ausil.us> | 2010-03-29 15:01:54 -0500 |
commit | 56c795c0115c0d62e9438b6b458f35c32ef6e366 (patch) | |
tree | 706c699dfcc357f021d287b380f29bec0ee25870 /sbus.h | |
download | lssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.tar.gz lssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.tar.xz lssbus-56c795c0115c0d62e9438b6b458f35c32ef6e366.zip |
Diffstat (limited to 'sbus.h')
-rw-r--r-- | sbus.h | 60 |
1 files changed, 60 insertions, 0 deletions
@@ -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 |