Commit bc0243ae authored by James Bottomley's avatar James Bottomley

mca-sysfs-VI

Make proc and legacy depend on compile options.
parent 34d0daf9
......@@ -1079,6 +1079,8 @@ config MCA
<file:Documentation/mca.txt> (and especially the web page given
there) before attempting to build an MCA bus kernel.
source "drivers/mca/Kconfig"
config HOTPLUG
bool "Support for hot-pluggable devices"
---help---
......
......@@ -408,16 +408,11 @@ subsys_initcall(mca_init);
/*--------------------------------------------------------------------*/
static void mca_handle_nmi_slot(int slot, int check_flag)
static void mca_handle_nmi_device(struct mca_device *mca_dev, int check_flag)
{
struct mca_device *mca_dev = mca_find_device_by_slot(slot);
int slot = mca_dev->slot;
if(!mca_dev) {
printk(KERN_CRIT "NMI: caused by unknown slot %d\n", slot);
} else if(slot < MCA_MAX_SLOT_NR) {
printk(KERN_CRIT "NMI: caused by MCA adapter in slot %d (%s)\n", slot+1,
mca_dev->dev.name);
} else if(slot == MCA_INTEGSCSI) {
if(slot == MCA_INTEGSCSI) {
printk(KERN_CRIT "NMI: caused by MCA integrated SCSI adapter (%s)\n",
mca_dev->dev.name);
} else if(slot == MCA_INTEGVIDEO) {
......@@ -433,8 +428,8 @@ static void mca_handle_nmi_slot(int slot, int check_flag)
if(check_flag) {
unsigned char pos6, pos7;
pos6 = mca_read_pos(slot, 6);
pos7 = mca_read_pos(slot, 7);
pos6 = mca_device_read_pos(mca_dev, 6);
pos7 = mca_device_read_pos(mca_dev, 7);
printk(KERN_CRIT "NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7);
}
......@@ -443,28 +438,30 @@ static void mca_handle_nmi_slot(int slot, int check_flag)
/*--------------------------------------------------------------------*/
void mca_handle_nmi(void)
static int mca_handle_nmi_callback(struct device *dev, void *data)
{
int i;
struct mca_device *mca_dev = to_mca_device(dev);
unsigned char pos5;
/* First try - scan the various adapters and see if a specific
* adapter was responsible for the error.
*/
pos5 = mca_device_read_pos(mca_dev, 5);
for(i = 0; i < MCA_NUMADAPTERS; i++)
{
if(!(pos5 & 0x80)) {
/* Bit 7 of POS 5 is reset when this adapter has a hardware
* error. Bit 7 it reset if there's error information
* available in POS 6 and 7.
*/
pos5 = mca_read_pos(i, 5);
if(!(pos5 & 0x80)) {
mca_handle_nmi_slot(i, !(pos5 & 0x40));
return;
}
mca_handle_nmi_device(mca_dev, !(pos5 & 0x40));
return 1;
}
return 0;
}
void mca_handle_nmi(void)
{
/* First try - scan the various adapters and see if a specific
* adapter was responsible for the error.
*/
bus_for_each_dev(&mca_bus_type, NULL, mca_handle_nmi_callback);
mca_nmi_hook();
} /* mca_handle_nmi */
comment "Micro Channel Architecture Bus support"
depends on MCA
config MCA_LEGACY
bool "Legacy MCA API Support"
depends on MCA
help
This compiles in support for the old slot based MCA API. If you
have an unconverted MCA driver, you will need to say Y here. It
is safe to say Y anyway.
config MCA_PROC_FS
bool "Support for the mca entry in /proc"
depends on MCA_LEGACY
help
If you want the old style /proc/mca directory in addition to the
new style sysfs say Y here.
# Makefile for the Linux MCA bus support
obj-y := mca-bus.o mca-device.o mca-driver.o mca-legacy.o
obj-y := mca-bus.o mca-device.o mca-driver.o
obj-$(CONFIG_PROC_FS) += mca-proc.o
obj-$(CONFIG_MCA_PROC_FS) += mca-proc.o
obj-$(CONFIG_MCA_LEGACY) += mca-legacy.o
export-objs := mca-bus.o mca-legacy.o mca-proc.o mca-driver.o
......
......@@ -65,17 +65,4 @@ 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);
#ifdef CONFIG_PROC_FS
extern void mca_do_proc_init(void);
extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev);
#else
static inline void mca_do_proc_init(void)
{
}
static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn *fn, void* dev)
{
}
#endif
#endif
......@@ -64,7 +64,7 @@ struct mca_device {
short pos_register;
enum MCA_AdapterStatus status;
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_MCA_PROC_FS
/* name of the proc/mca file */
char procname[8];
/* /proc info callback */
......@@ -128,8 +128,21 @@ extern void mca_unregister_driver(struct mca_driver *drv);
/* WARNING: only called by the boot time device setup */
extern int mca_register_device(int bus, struct mca_device *mca_dev);
/* for now, include the legacy API */
#ifdef CONFIG_MCA_LEGACY
#include <linux/mca-legacy.h>
#endif
#ifdef CONFIG_MCA_PROC_FS
extern void mca_do_proc_init(void);
extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev);
#else
static inline void mca_do_proc_init(void)
{
}
static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn *fn, void* dev)
{
}
#endif
#endif /* _LINUX_MCA_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment