#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/module.h>
#include <linux/major.h>
#include <linux/blkdev.h>
#include <linux/stat.h>
#include <asm/irq.h>
#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
+#include <scsi/scsi_host.h>
#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
int i;
/* setup sync data */
- for ( i = 0; i < NUMBER(data->Sync); i++ ) {
+ for ( i = 0; i < ARRAY_SIZE(data->Sync); i++ ) {
data->Sync[i] = tmp_sync;
}
}
unsigned int base = SCpnt->device->host->io_port;
nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
char *buf = data->MsgBuffer;
- int len = MIN(MSGBUF_SIZE, data->MsgLen);
+ int len = min(MSGBUF_SIZE, data->MsgLen);
int ptr;
int ret;
continue;
}
- res = MIN(res, SCpnt->SCp.this_residual);
+ res = min(res, SCpnt->SCp.this_residual);
switch (data->TransferMode) {
case MODE_IO32:
continue;
}
- res = MIN(SCpnt->SCp.this_residual, WFIFO_CRIT);
+ res = min(SCpnt->SCp.this_residual, WFIFO_CRIT);
//nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, res);
switch (data->TransferMode) {
spin_unlock_irqrestore(&(data->Lock), flags);
SPRINTF("SDTR status\n");
- for(id = 0; id < NUMBER(data->Sync); id++) {
+ for(id = 0; id < ARRAY_SIZE(data->Sync); id++) {
SPRINTF("id %d: ", id);
}
- thislength = MIN(thislength, length);
+ thislength = min(thislength, length);
*start = buffer + offset;
return thislength;
nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host);
for (dev = host->host_queue; dev != NULL; dev = dev->next) {
- unsigned long arg[2], id;
- kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg);
- id = (arg[0] & 0x0f) + ((arg[0] >> 4) & 0xf0) +
- ((arg[0] >> 8) & 0xf00) + ((arg[0] >> 12) & 0xf000);
+ unsigned long id;
+ id = (dev->id & 0x0f) + ((dev->lun & 0x0f) << 4) +
+ ((dev->channel & 0x0f) << 8) +
+ ((dev->host->host_no & 0x0f) << 12);
node = &info->node[info->ndev];
node->minor = 0;
switch (dev->type) {