Commit ee29d109 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] MCA bus basic cleanups

parent ecf2c214
......@@ -194,10 +194,9 @@ struct resource mca_standard_resources[] = {
#define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource))
void __init mca_init(void)
int __init mca_init(void)
{
unsigned int i, j;
unsigned long flags;
/* WARNING: Be careful when making changes here. Putting an adapter
* and the motherboard simultaneously into setup mode may result in
......@@ -209,16 +208,16 @@ void __init mca_init(void)
/* Make sure the MCA bus is present */
if(!MCA_bus)
return;
printk("Micro Channel bus detected.\n");
return -ENODEV;
printk(KERN_INFO "Micro Channel bus detected.\n");
/* Allocate MCA_info structure (at address divisible by 8) */
mca_info = (struct MCA_info *)kmalloc(sizeof(struct MCA_info), GFP_KERNEL);
if(mca_info == NULL) {
printk("Failed to allocate memory for mca_info!");
return;
printk(KERN_ERR "Failed to allocate memory for mca_info!");
return -ENOMEM;
}
memset(mca_info, 0, sizeof(struct MCA_info));
......@@ -320,6 +319,8 @@ void __init mca_init(void)
#ifdef CONFIG_PROC_FS
mca_do_proc_init();
#endif
return 0;
}
subsys_initcall(mca_init);
......@@ -329,16 +330,16 @@ subsys_initcall(mca_init);
static void mca_handle_nmi_slot(int slot, int check_flag)
{
if(slot < MCA_MAX_SLOT_NR) {
printk("NMI: caused by MCA adapter in slot %d (%s)\n", slot+1,
printk(KERN_CRIT "NMI: caused by MCA adapter in slot %d (%s)\n", slot+1,
mca_info->slot[slot].name);
} else if(slot == MCA_INTEGSCSI) {
printk("NMI: caused by MCA integrated SCSI adapter (%s)\n",
printk(KERN_CRIT "NMI: caused by MCA integrated SCSI adapter (%s)\n",
mca_info->slot[slot].name);
} else if(slot == MCA_INTEGVIDEO) {
printk("NMI: caused by MCA integrated video adapter (%s)\n",
printk(KERN_CRIT "NMI: caused by MCA integrated video adapter (%s)\n",
mca_info->slot[slot].name);
} else if(slot == MCA_MOTHERBOARD) {
printk("NMI: caused by motherboard (%s)\n",
printk(KERN_CRIT "NMI: caused by motherboard (%s)\n",
mca_info->slot[slot].name);
}
......@@ -350,7 +351,7 @@ static void mca_handle_nmi_slot(int slot, int check_flag)
pos6 = mca_read_pos(slot, 6);
pos7 = mca_read_pos(slot, 7);
printk("NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7);
printk(KERN_CRIT "NMI: POS 6 = 0x%x, POS 7 = 0x%x\n", pos6, pos7);
}
} /* mca_handle_nmi_slot */
......@@ -367,21 +368,19 @@ void mca_handle_nmi(void)
* adapter was responsible for the error.
*/
for(i = 0; i < MCA_NUMADAPTERS; i++) {
/* 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);
for(i = 0; i < MCA_NUMADAPTERS; i++)
{
/* 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)) {
if(!(pos5 & 0x80)) {
mca_handle_nmi_slot(i, !(pos5 & 0x40));
return;
}
}
mca_nmi_hook();
} /* mca_handle_nmi */
......
This diff is collapsed.
......@@ -3,22 +3,6 @@
#ifdef _IBM_LANA_DRIVER_
/* version-dependent functions/structures */
#if LINUX_VERSION_CODE >= 0x020318
#define IBMLANA_READB(addr) isa_readb(addr)
#define IBMLANA_TOIO(dest, src, len) isa_memcpy_toio(dest, src, len)
#define IBMLANA_FROMIO(dest, src, len) isa_memcpy_fromio(dest, src, len)
#define IBMLANA_SETIO(dest, val, len) isa_memset_io(dest, val, len)
#define IBMLANA_NETDEV net_device
#else
#define IBMLANA_READB(addr) readb(addr)
#define IBMLANA_TOIO(dest, src, len) memcpy_toio(dest, src, len)
#define IBMLANA_FROMIO(dest, src, len) memcpy_fromio(dest, src, len)
#define IBMLANA_SETIO(dest, val, len) memset_io(dest, val, len)
#define IBMLANA_NETDEV device
#endif
/* maximum packet size */
#define PKTSIZE 1524
......@@ -33,25 +17,27 @@
/* media enumeration - defined in a way that it fits onto the LAN/A's
POS registers... */
typedef enum { Media_10BaseT, Media_10Base5,
typedef enum {
Media_10BaseT, Media_10Base5,
Media_Unknown, Media_10Base2, Media_Count
} ibmlana_medium;
/* private structure */
typedef struct {
unsigned int slot; /* MCA-Slot-# */
unsigned int slot; /* MCA-Slot-# */
struct net_device_stats stat; /* packet statistics */
int realirq; /* memorizes actual IRQ, even when
currently not allocated */
ibmlana_medium medium; /* physical cannector */
u32 tdastart, txbufstart, /* addresses */
rrastart, rxbufstart, rdastart, rxbufcnt, txusedcnt;
int nextrxdescr, /* next rx descriptor to be used */
lastrxdescr, /* last free rx descriptor */
nexttxdescr, /* last tx descriptor to be used */
currtxdescr, /* tx descriptor currently tx'ed */
txused[TXBUFCNT]; /* busy flags */
int realirq; /* memorizes actual IRQ, even when
currently not allocated */
ibmlana_medium medium; /* physical cannector */
u32 tdastart, txbufstart, /* addresses */
rrastart, rxbufstart, rdastart, rxbufcnt, txusedcnt;
int nextrxdescr, /* next rx descriptor to be used */
lastrxdescr, /* last free rx descriptor */
nexttxdescr, /* last tx descriptor to be used */
currtxdescr, /* tx descriptor currently tx'ed */
txused[TXBUFCNT]; /* busy flags */
spinlock_t lock;
} ibmlana_priv;
/* this card uses quite a lot of I/O ports...luckily the MCA bus decodes
......@@ -289,7 +275,7 @@ typedef struct {
#endif /* _IBM_LANA_DRIVER_ */
extern int ibmlana_probe(struct IBMLANA_NETDEV *);
extern int ibmlana_probe(struct net_device *);
#endif /* _IBM_LANA_INCLUDE_ */
......@@ -1780,7 +1780,7 @@ static int xl_change_mtu(struct net_device *dev, int mtu)
static void __devexit xl_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pdev->driver_data;
struct net_device *dev = pci_get_drvdata(pdev);
struct xl_private *xl_priv=(struct xl_private *)dev->priv;
unregister_trdev(dev);
......
This diff is collapsed.
......@@ -1050,6 +1050,8 @@ typedef struct net_local {
__u16 QueueSkb;
struct tr_statistics MacStat; /* MAC statistics structure */
spinlock_t lock;
} NET_LOCAL;
/************************************
......
This diff is collapsed.
......@@ -22,31 +22,36 @@
#ifndef _FD_MCS_H
#define _FD_MCS_H
extern int fd_mcs_detect( Scsi_Host_Template * );
extern int fd_mcs_release( struct Scsi_Host * );
extern int fd_mcs_command( Scsi_Cmnd * );
extern int fd_mcs_abort( Scsi_Cmnd * );
extern int fd_mcs_reset( Scsi_Cmnd *, unsigned int );
extern int fd_mcs_queue( Scsi_Cmnd *, void (*done)(Scsi_Cmnd *) );
extern int fd_mcs_biosparam( Disk *, struct block_device *, int * );
extern int fd_mcs_proc_info( char *, char **, off_t, int, int, int );
extern const char *fd_mcs_info(struct Scsi_Host *);
static int fd_mcs_detect(Scsi_Host_Template *);
static int fd_mcs_release(struct Scsi_Host *);
static int fd_mcs_command(Scsi_Cmnd *);
static int fd_mcs_abort(Scsi_Cmnd *);
static int fd_mcs_bus_reset(Scsi_Cmnd *);
static int fd_mcs_device_reset(Scsi_Cmnd *);
static int fd_mcs_host_reset(Scsi_Cmnd *);
static int fd_mcs_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
static int fd_mcs_biosparam(Disk *, struct block_device *, int *);
static int fd_mcs_proc_info(char *, char **, off_t, int, int, int);
static const char *fd_mcs_info(struct Scsi_Host *);
#define FD_MCS {\
proc_name: "fd_mcs", \
proc_info: fd_mcs_proc_info, \
detect: fd_mcs_detect, \
release: fd_mcs_release, \
info: fd_mcs_info, \
command: fd_mcs_command, \
queuecommand: fd_mcs_queue, \
abort: fd_mcs_abort, \
reset: fd_mcs_reset, \
bios_param: fd_mcs_biosparam, \
can_queue: 1, \
this_id: 7, \
sg_tablesize: 64, \
cmd_per_lun: 1, \
use_clustering: DISABLE_CLUSTERING }
#endif /* _FD_MCS_H */
proc_name: "fd_mcs", \
proc_info: fd_mcs_proc_info, \
detect: fd_mcs_detect, \
release: fd_mcs_release, \
info: fd_mcs_info, \
command: fd_mcs_command, \
queuecommand: fd_mcs_queue, \
eh_abort_handler: fd_mcs_abort, \
eh_bus_reset_handler: fd_mcs_bus_reset, \
eh_host_reset_handler: fd_mcs_host_reset, \
eh_device_reset_handler: fd_mcs_device_reset, \
bios_param: fd_mcs_biosparam, \
can_queue: 1, \
this_id: 7, \
sg_tablesize: 64, \
cmd_per_lun: 1, \
use_clustering: DISABLE_CLUSTERING \
}
#endif /* _FD_MCS_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