VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / scsi / pcmcia / nsp_cs.c
index 52c8ed2..363d793 100644 (file)
@@ -38,7 +38,6 @@
 #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>
@@ -47,7 +46,7 @@
 #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>
@@ -315,7 +314,7 @@ static void nsphw_init_sync(nsp_hw_data *data)
        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;
        }
 }
@@ -600,7 +599,7 @@ static int nsp_xfer(Scsi_Cmnd *SCpnt, int phase)
        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;
 
@@ -774,7 +773,7 @@ static void nsp_pio_read(Scsi_Cmnd *SCpnt)
                        continue;
                }
 
-               res = MIN(res, SCpnt->SCp.this_residual);
+               res = min(res, SCpnt->SCp.this_residual);
 
                switch (data->TransferMode) {
                case MODE_IO32:
@@ -868,7 +867,7 @@ static void nsp_pio_write(Scsi_Cmnd *SCpnt)
                        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) {
@@ -1490,7 +1489,7 @@ nsp_proc_info(
        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);
 
@@ -1534,7 +1533,7 @@ nsp_proc_info(
         }
 
 
-       thislength = MIN(thislength, length);
+       thislength = min(thislength, length);
        *start = buffer + offset;
 
        return thislength;
@@ -1937,10 +1936,10 @@ static void nsp_cs_config(dev_link_t *link)
        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) {