#include "scsi.h"
#include <scsi/scsi_host.h>
-#include "fd_mcs.h"
#define DRIVER_VERSION "v0.2 by ZP Gu<zpg@castle.net>"
#define DEBUG 0 /* Enable debugging output */
#define ENABLE_PARITY 1 /* Enable SCSI Parity */
-#define DO_DETECT 0 /* Do device detection here (see scsi.c) */
/* END OF USER DEFINABLE OPTIONS */
#if DEBUG
#define EVERY_ACCESS 0 /* Write a line on every scsi access */
#define ERRORS_ONLY 1 /* Only write a line if there is an error */
-#define DEBUG_DETECT 1 /* Debug fd_mcs_detect() */
#define DEBUG_MESSAGES 1 /* Debug MESSAGE IN phase */
#define DEBUG_ABORT 1 /* Debug abort() routine */
#define DEBUG_RESET 1 /* Debug reset() routine */
#else
#define EVERY_ACCESS 0 /* LEAVE THESE ALONE--CHANGE THE ONES ABOVE */
#define ERRORS_ONLY 0
-#define DEBUG_DETECT 0
#define DEBUG_MESSAGES 0
#define DEBUG_ABORT 0
#define DEBUG_RESET 0
FIFO_COUNT = user_fifo_count ? user_fifo_count : fd_mcs_adapters[loop].fifo_count;
FIFO_Size = user_fifo_size ? user_fifo_size : fd_mcs_adapters[loop].fifo_size;
+/* FIXME: Do we need to keep this bit of code inside NOT_USED around at all? */
#ifdef NOT_USED
/* *************************************************** */
/* Try to toggle 32-bit mode. This only
outb(0, SCSI_Mode_Cntl_port);
outb(PARITY_MASK, TMC_Cntl_port);
/* done reset */
-
-#if DO_DETECT
- /* scan devices attached */
- {
- const int buflen = 255;
- int i, j, retcode;
- Scsi_Cmnd SCinit;
- unsigned char do_inquiry[] = { INQUIRY, 0, 0, 0, buflen, 0 };
- unsigned char do_request_sense[] = { REQUEST_SENSE,
- 0, 0, 0, buflen, 0
- };
- unsigned char do_read_capacity[] = { READ_CAPACITY,
- 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- unsigned char buf[buflen];
-
- SCinit.request_buffer = SCinit.buffer = buf;
- SCinit.request_bufflen = SCinit.bufflen = sizeof(buf) - 1;
- SCinit.use_sg = 0;
- SCinit.lun = 0;
- SCinit.host = shpnt;
-
- printk("fd_mcs: detection routine scanning for devices:\n");
- for (i = 0; i < 8; i++) {
- if (i == shpnt->this_id) /* Skip host adapter */
- continue;
- SCinit.target = i;
- memcpy(SCinit.cmnd, do_request_sense, sizeof(do_request_sense));
- retcode = fd_mcs_command(&SCinit);
- if (!retcode) {
- memcpy(SCinit.cmnd, do_inquiry, sizeof(do_inquiry));
- retcode = fd_mcs_command(&SCinit);
- if (!retcode) {
- printk(" SCSI ID %d: ", i);
- for (j = 8; j < (buf[4] < 32 ? buf[4] : 32); j++)
- printk("%c", buf[j] >= 20 ? buf[j] : ' ');
- memcpy(SCinit.cmnd, do_read_capacity, sizeof(do_read_capacity));
- retcode = fd_mcs_command(&SCinit);
- if (!retcode) {
- unsigned long blocks, size, capacity;
-
- blocks = (buf[0] << 24) | (buf[1] << 16)
- | (buf[2] << 8) | buf[3];
- size = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
- capacity = +(+(blocks / 1024L) * +(size * 10L)) / 1024L;
-
- printk("%lu MB (%lu byte blocks)\n", ((capacity + 5L) / 10L), size);
- }
- }
- }
- }
- }
-#endif
}
}