diff options
author | Zheng Da <zhengda1936@gmail.com> | 2009-12-06 05:26:23 +0100 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2009-12-06 05:26:23 +0100 |
commit | 8a6d48c0542876eb3acfc0970c0ab7872db08d5f (patch) | |
tree | 496e78bc728317ea779781b92f897d16936ee231 /libdde_linux26/contrib/include/linux/mca-legacy.h | |
parent | b4bffcfcdf3ab7a55d664e9aa5907f88da503f38 (diff) |
check in the original version of dde linux26.
Diffstat (limited to 'libdde_linux26/contrib/include/linux/mca-legacy.h')
-rw-r--r-- | libdde_linux26/contrib/include/linux/mca-legacy.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libdde_linux26/contrib/include/linux/mca-legacy.h b/libdde_linux26/contrib/include/linux/mca-legacy.h new file mode 100644 index 00000000..7a3aea84 --- /dev/null +++ b/libdde_linux26/contrib/include/linux/mca-legacy.h @@ -0,0 +1,66 @@ +/* -*- mode: c; c-basic-offset: 8 -*- */ + +/* This is the function prototypes for the old legacy MCA interface + * + * Please move your driver to the new sysfs based one instead */ + +#ifndef _LINUX_MCA_LEGACY_H +#define _LINUX_MCA_LEGACY_H + +#include <linux/mca.h> + +#warning "MCA legacy - please move your driver to the new sysfs api" + +/* MCA_NOTFOUND is an error condition. The other two indicate + * motherboard POS registers contain the adapter. They might be + * returned by the mca_find_adapter() function, and can be used as + * arguments to mca_read_stored_pos(). I'm not going to allow direct + * access to the motherboard registers until we run across an adapter + * that requires it. We don't know enough about them to know if it's + * safe. + * + * See Documentation/mca.txt or one of the existing drivers for + * more information. + */ +#define MCA_NOTFOUND (-1) + + + +/* Returns the slot of the first enabled adapter matching id. User can + * specify a starting slot beyond zero, to deal with detecting multiple + * devices. Returns MCA_NOTFOUND if id not found. Also checks the + * integrated adapters. + */ +extern int mca_find_adapter(int id, int start); +extern int mca_find_unused_adapter(int id, int start); + +extern int mca_mark_as_used(int slot); +extern void mca_mark_as_unused(int slot); + +/* gets a byte out of POS register (stored in memory) */ +extern unsigned char mca_read_stored_pos(int slot, int reg); + +/* This can be expanded later. Right now, it gives us a way of + * getting meaningful information into the MCA_info structure, + * so we can have a more interesting /proc/mca. + */ +extern void mca_set_adapter_name(int slot, char* name); + +/* These routines actually mess with the hardware POS registers. They + * temporarily disable the device (and interrupts), so make sure you know + * what you're doing if you use them. Furthermore, writing to a POS may + * result in two devices trying to share a resource, which in turn can + * result in multiple devices sharing memory spaces, IRQs, or even trashing + * hardware. YOU HAVE BEEN WARNED. + * + * You can only access slots with this. Motherboard registers are off + * limits. + */ + +/* read a byte from the specified POS register. */ +extern unsigned char mca_read_pos(int slot, int reg); + +/* write a byte to the specified POS register. */ +extern void mca_write_pos(int slot, int reg, unsigned char byte); + +#endif |