git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
scsi
/
NCR53c406a.c
diff --git
a/drivers/scsi/NCR53c406a.c
b/drivers/scsi/NCR53c406a.c
index
2abc6e4
..
ae37d3a
100644
(file)
--- a/
drivers/scsi/NCR53c406a.c
+++ b/
drivers/scsi/NCR53c406a.c
@@
-46,15
+46,15
@@
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
+#include <linux/bitops.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/dma.h>
-#include <asm/bitops.h>
#include <asm/irq.h>
#include <linux/blkdev.h>
#include <linux/spinlock.h>
#include "scsi.h"
#include <asm/irq.h>
#include <linux/blkdev.h>
#include <linux/spinlock.h>
#include "scsi.h"
-#include
"hosts.h"
+#include
<scsi/scsi_host.h>
/* ============================================================= */
/* ============================================================= */
@@
-62,7
+62,7
@@
#define SYNC_MODE 0 /* Synchronous transfer mode */
#define SYNC_MODE 0 /* Synchronous transfer mode */
-#if DEBUG
+#if
def
DEBUG
#undef NCR53C406A_DEBUG
#define NCR53C406A_DEBUG 1
#endif
#undef NCR53C406A_DEBUG
#define NCR53C406A_DEBUG 1
#endif
@@
-182,13
+182,13
@@
static int irq_probe(void);
static void *bios_base;
#endif
static void *bios_base;
#endif
-#if PORT_BASE
+#if
def
PORT_BASE
static int port_base = PORT_BASE;
#else
static int port_base;
#endif
static int port_base = PORT_BASE;
#else
static int port_base;
#endif
-#if IRQ_LEV
+#if
def
IRQ_LEV
static int irq_level = IRQ_LEV;
#else
static int irq_level = -1; /* 0 is 'no irq', so use -1 for 'uninitialized' */
static int irq_level = IRQ_LEV;
#else
static int irq_level = -1; /* 0 is 'no irq', so use -1 for 'uninitialized' */
@@
-447,7
+447,7
@@
static __inline__ int NCR53c406a_pio_write(unsigned char *request, unsigned int
}
#endif /* USE_PIO */
}
#endif /* USE_PIO */
-static int __init NCR53c406a_detect(
Scsi_Host_T
emplate * tpnt)
+static int __init NCR53c406a_detect(
struct scsi_host_t
emplate * tpnt)
{
int present = 0;
struct Scsi_Host *shpnt = NULL;
{
int present = 0;
struct Scsi_Host *shpnt = NULL;
@@
-606,22
+606,24
@@
static int NCR53c406a_release(struct Scsi_Host *shost)
}
/* called from init/main.c */
}
/* called from init/main.c */
-static
void __init NCR53c406a_setup(char *str, int *ints
)
+static
int __init NCR53c406a_setup(char *str
)
{
static size_t setup_idx = 0;
size_t i;
{
static size_t setup_idx = 0;
size_t i;
+ int ints[4];
DEB(printk("NCR53c406a: Setup called\n");
);
if (setup_idx >= PORT_COUNT - 1) {
printk("NCR53c406a: Setup called too many times. Bad LILO params?\n");
DEB(printk("NCR53c406a: Setup called\n");
);
if (setup_idx >= PORT_COUNT - 1) {
printk("NCR53c406a: Setup called too many times. Bad LILO params?\n");
- return;
+ return
0
;
}
}
+ get_options(str, 4, ints);
if (ints[0] < 1 || ints[0] > 3) {
printk("NCR53c406a: Malformed command line\n");
printk("NCR53c406a: Usage: ncr53c406a=<PORTBASE>[,<IRQ>[,<FASTPIO>]]\n");
if (ints[0] < 1 || ints[0] > 3) {
printk("NCR53c406a: Malformed command line\n");
printk("NCR53c406a: Usage: ncr53c406a=<PORTBASE>[,<IRQ>[,<FASTPIO>]]\n");
- return;
+ return
0
;
}
for (i = 0; i < PORT_COUNT && !port_base; i++)
if (ports[i] == ints[1]) {
}
for (i = 0; i < PORT_COUNT && !port_base; i++)
if (ports[i] == ints[1]) {
@@
-631,7
+633,7
@@
static void __init NCR53c406a_setup(char *str, int *ints)
}
if (!port_base) {
printk("NCR53c406a: Invalid PORTBASE 0x%x specified\n", ints[1]);
}
if (!port_base) {
printk("NCR53c406a: Invalid PORTBASE 0x%x specified\n", ints[1]);
- return;
+ return
0
;
}
if (ints[0] > 1) {
}
if (ints[0] > 1) {
@@
-654,6
+656,7
@@
static void __init NCR53c406a_setup(char *str, int *ints)
fast_pio = ints[3];
DEB(printk("NCR53c406a: port_base=0x%x, irq=%d, fast_pio=%d\n", port_base, irq_level, fast_pio);)
fast_pio = ints[3];
DEB(printk("NCR53c406a: port_base=0x%x, irq=%d, fast_pio=%d\n", port_base, irq_level, fast_pio);)
+ return 1;
}
__setup("ncr53c406a=", NCR53c406a_setup);
}
__setup("ncr53c406a=", NCR53c406a_setup);
@@
-707,7
+710,7
@@
static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
/* We are locked here already by the mid layer */
REG0;
/* We are locked here already by the mid layer */
REG0;
- outb(
SCpnt->device->id, DEST_ID);
/* set destination */
+ outb(
scmd_id(SCpnt), DEST_ID);
/* set destination */
outb(FLUSH_FIFO, CMD_REG); /* reset the fifos */
for (i = 0; i < SCpnt->cmd_len; i++) {
outb(FLUSH_FIFO, CMD_REG); /* reset the fifos */
for (i = 0; i < SCpnt->cmd_len; i++) {
@@
-719,15
+722,12
@@
static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
return 0;
}
return 0;
}
-static int NCR53c406a_abort(Scsi_Cmnd * SCpnt)
-{
- DEB(printk("NCR53c406a_abort called\n"));
- return FAILED; /* Don't know how to abort */
-}
-
static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
{
DEB(printk("NCR53c406a_reset called\n"));
static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
{
DEB(printk("NCR53c406a_reset called\n"));
+
+ spin_lock_irq(SCpnt->device->host->host_lock);
+
outb(C4_IMG, CONFIG4); /* Select reg set 0 */
outb(CHIP_RESET, CMD_REG);
outb(SCSI_NOP, CMD_REG); /* required after reset */
outb(C4_IMG, CONFIG4); /* Select reg set 0 */
outb(CHIP_RESET, CMD_REG);
outb(SCSI_NOP, CMD_REG); /* required after reset */
@@
-735,17
+735,10
@@
static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
chip_init();
rtrc(2);
chip_init();
rtrc(2);
- return SUCCESS;
-}
-static int NCR53c406a_device_reset(Scsi_Cmnd * SCpnt)
-{
- return FAILED;
-}
+ spin_unlock_irq(SCpnt->device->host->host_lock);
-static int NCR53c406a_bus_reset(Scsi_Cmnd * SCpnt)
-{
- return FAILED;
+ return SUCCESS;
}
static int NCR53c406a_biosparm(struct scsi_device *disk,
}
static int NCR53c406a_biosparm(struct scsi_device *disk,
@@
-1064,7
+1057,7
@@
MODULE_LICENSE("GPL");
* Use SG_NONE if DMA mode is enabled!
*/
* Use SG_NONE if DMA mode is enabled!
*/
-static
Scsi_Host_Template driver_template =
+static
struct scsi_host_template driver_template =
{
.proc_name = "NCR53c406a" /* proc_name */,
.name = "NCR53c406a" /* name */,
{
.proc_name = "NCR53c406a" /* proc_name */,
.name = "NCR53c406a" /* name */,
@@
-1072,9
+1065,6
@@
static Scsi_Host_Template driver_template =
.release = NCR53c406a_release,
.info = NCR53c406a_info /* info */,
.queuecommand = NCR53c406a_queue /* queuecommand */,
.release = NCR53c406a_release,
.info = NCR53c406a_info /* info */,
.queuecommand = NCR53c406a_queue /* queuecommand */,
- .eh_abort_handler = NCR53c406a_abort /* abort */,
- .eh_bus_reset_handler = NCR53c406a_bus_reset /* reset */,
- .eh_device_reset_handler = NCR53c406a_device_reset /* reset */,
.eh_host_reset_handler = NCR53c406a_host_reset /* reset */,
.bios_param = NCR53c406a_biosparm /* biosparm */,
.can_queue = 1 /* can_queue */,
.eh_host_reset_handler = NCR53c406a_host_reset /* reset */,
.bios_param = NCR53c406a_biosparm /* biosparm */,
.can_queue = 1 /* can_queue */,