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[] = { ...@@ -194,10 +194,9 @@ struct resource mca_standard_resources[] = {
#define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource)) #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 int i, j;
unsigned long flags;
/* WARNING: Be careful when making changes here. Putting an adapter /* WARNING: Be careful when making changes here. Putting an adapter
* and the motherboard simultaneously into setup mode may result in * and the motherboard simultaneously into setup mode may result in
...@@ -209,16 +208,16 @@ void __init mca_init(void) ...@@ -209,16 +208,16 @@ void __init mca_init(void)
/* Make sure the MCA bus is present */ /* Make sure the MCA bus is present */
if(!MCA_bus) if(!MCA_bus)
return; return -ENODEV;
printk("Micro Channel bus detected.\n"); printk(KERN_INFO "Micro Channel bus detected.\n");
/* Allocate MCA_info structure (at address divisible by 8) */ /* Allocate MCA_info structure (at address divisible by 8) */
mca_info = (struct MCA_info *)kmalloc(sizeof(struct MCA_info), GFP_KERNEL); mca_info = (struct MCA_info *)kmalloc(sizeof(struct MCA_info), GFP_KERNEL);
if(mca_info == NULL) { if(mca_info == NULL) {
printk("Failed to allocate memory for mca_info!"); printk(KERN_ERR "Failed to allocate memory for mca_info!");
return; return -ENOMEM;
} }
memset(mca_info, 0, sizeof(struct MCA_info)); memset(mca_info, 0, sizeof(struct MCA_info));
...@@ -320,6 +319,8 @@ void __init mca_init(void) ...@@ -320,6 +319,8 @@ void __init mca_init(void)
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
mca_do_proc_init(); mca_do_proc_init();
#endif #endif
return 0;
} }
subsys_initcall(mca_init); subsys_initcall(mca_init);
...@@ -329,16 +330,16 @@ subsys_initcall(mca_init); ...@@ -329,16 +330,16 @@ subsys_initcall(mca_init);
static void mca_handle_nmi_slot(int slot, int check_flag) static void mca_handle_nmi_slot(int slot, int check_flag)
{ {
if(slot < MCA_MAX_SLOT_NR) { 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); mca_info->slot[slot].name);
} else if(slot == MCA_INTEGSCSI) { } 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); mca_info->slot[slot].name);
} else if(slot == MCA_INTEGVIDEO) { } 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); mca_info->slot[slot].name);
} else if(slot == MCA_MOTHERBOARD) { } 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); mca_info->slot[slot].name);
} }
...@@ -350,7 +351,7 @@ static void mca_handle_nmi_slot(int slot, int check_flag) ...@@ -350,7 +351,7 @@ static void mca_handle_nmi_slot(int slot, int check_flag)
pos6 = mca_read_pos(slot, 6); pos6 = mca_read_pos(slot, 6);
pos7 = mca_read_pos(slot, 7); 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 */ } /* mca_handle_nmi_slot */
...@@ -367,13 +368,12 @@ void mca_handle_nmi(void) ...@@ -367,13 +368,12 @@ void mca_handle_nmi(void)
* adapter was responsible for the error. * adapter was responsible for the error.
*/ */
for(i = 0; i < MCA_NUMADAPTERS; i++) { for(i = 0; i < MCA_NUMADAPTERS; i++)
{
/* Bit 7 of POS 5 is reset when this adapter has a hardware /* Bit 7 of POS 5 is reset when this adapter has a hardware
* error. Bit 7 it reset if there's error information * error. Bit 7 it reset if there's error information
* available in POS 6 and 7. * available in POS 6 and 7.
*/ */
pos5 = mca_read_pos(i, 5); pos5 = mca_read_pos(i, 5);
if(!(pos5 & 0x80)) { if(!(pos5 & 0x80)) {
...@@ -381,7 +381,6 @@ void mca_handle_nmi(void) ...@@ -381,7 +381,6 @@ void mca_handle_nmi(void)
return; return;
} }
} }
mca_nmi_hook(); mca_nmi_hook();
} /* mca_handle_nmi */ } /* mca_handle_nmi */
......
This diff is collapsed.
...@@ -3,22 +3,6 @@ ...@@ -3,22 +3,6 @@
#ifdef _IBM_LANA_DRIVER_ #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 */ /* maximum packet size */
#define PKTSIZE 1524 #define PKTSIZE 1524
...@@ -33,7 +17,8 @@ ...@@ -33,7 +17,8 @@
/* media enumeration - defined in a way that it fits onto the LAN/A's /* media enumeration - defined in a way that it fits onto the LAN/A's
POS registers... */ POS registers... */
typedef enum { Media_10BaseT, Media_10Base5, typedef enum {
Media_10BaseT, Media_10Base5,
Media_Unknown, Media_10Base2, Media_Count Media_Unknown, Media_10Base2, Media_Count
} ibmlana_medium; } ibmlana_medium;
...@@ -52,6 +37,7 @@ typedef struct { ...@@ -52,6 +37,7 @@ typedef struct {
nexttxdescr, /* last tx descriptor to be used */ nexttxdescr, /* last tx descriptor to be used */
currtxdescr, /* tx descriptor currently tx'ed */ currtxdescr, /* tx descriptor currently tx'ed */
txused[TXBUFCNT]; /* busy flags */ txused[TXBUFCNT]; /* busy flags */
spinlock_t lock;
} ibmlana_priv; } ibmlana_priv;
/* this card uses quite a lot of I/O ports...luckily the MCA bus decodes /* this card uses quite a lot of I/O ports...luckily the MCA bus decodes
...@@ -289,7 +275,7 @@ typedef struct { ...@@ -289,7 +275,7 @@ typedef struct {
#endif /* _IBM_LANA_DRIVER_ */ #endif /* _IBM_LANA_DRIVER_ */
extern int ibmlana_probe(struct IBMLANA_NETDEV *); extern int ibmlana_probe(struct net_device *);
#endif /* _IBM_LANA_INCLUDE_ */ #endif /* _IBM_LANA_INCLUDE_ */
...@@ -1780,7 +1780,7 @@ static int xl_change_mtu(struct net_device *dev, int mtu) ...@@ -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) 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; struct xl_private *xl_priv=(struct xl_private *)dev->priv;
unregister_trdev(dev); unregister_trdev(dev);
......
This diff is collapsed.
...@@ -1050,6 +1050,8 @@ typedef struct net_local { ...@@ -1050,6 +1050,8 @@ typedef struct net_local {
__u16 QueueSkb; __u16 QueueSkb;
struct tr_statistics MacStat; /* MAC statistics structure */ struct tr_statistics MacStat; /* MAC statistics structure */
spinlock_t lock;
} NET_LOCAL; } NET_LOCAL;
/************************************ /************************************
......
This diff is collapsed.
...@@ -22,15 +22,17 @@ ...@@ -22,15 +22,17 @@
#ifndef _FD_MCS_H #ifndef _FD_MCS_H
#define _FD_MCS_H #define _FD_MCS_H
extern int fd_mcs_detect( Scsi_Host_Template * ); static int fd_mcs_detect(Scsi_Host_Template *);
extern int fd_mcs_release( struct Scsi_Host * ); static int fd_mcs_release(struct Scsi_Host *);
extern int fd_mcs_command( Scsi_Cmnd * ); static int fd_mcs_command(Scsi_Cmnd *);
extern int fd_mcs_abort( Scsi_Cmnd * ); static int fd_mcs_abort(Scsi_Cmnd *);
extern int fd_mcs_reset( Scsi_Cmnd *, unsigned int ); static int fd_mcs_bus_reset(Scsi_Cmnd *);
extern int fd_mcs_queue( Scsi_Cmnd *, void (*done)(Scsi_Cmnd *) ); static int fd_mcs_device_reset(Scsi_Cmnd *);
extern int fd_mcs_biosparam( Disk *, struct block_device *, int * ); static int fd_mcs_host_reset(Scsi_Cmnd *);
extern int fd_mcs_proc_info( char *, char **, off_t, int, int, int ); static int fd_mcs_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
extern const char *fd_mcs_info(struct Scsi_Host *); 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 {\ #define FD_MCS {\
proc_name: "fd_mcs", \ proc_name: "fd_mcs", \
...@@ -40,13 +42,16 @@ extern const char *fd_mcs_info(struct Scsi_Host *); ...@@ -40,13 +42,16 @@ extern const char *fd_mcs_info(struct Scsi_Host *);
info: fd_mcs_info, \ info: fd_mcs_info, \
command: fd_mcs_command, \ command: fd_mcs_command, \
queuecommand: fd_mcs_queue, \ queuecommand: fd_mcs_queue, \
abort: fd_mcs_abort, \ eh_abort_handler: fd_mcs_abort, \
reset: fd_mcs_reset, \ 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, \ bios_param: fd_mcs_biosparam, \
can_queue: 1, \ can_queue: 1, \
this_id: 7, \ this_id: 7, \
sg_tablesize: 64, \ sg_tablesize: 64, \
cmd_per_lun: 1, \ cmd_per_lun: 1, \
use_clustering: DISABLE_CLUSTERING } use_clustering: DISABLE_CLUSTERING \
}
#endif /* _FD_MCS_H */ #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