staging: Add framebuffer driver for XGI chipsets
[safe/jmp/linux-2.6] / drivers / scsi / eata_pio.c
index 73260e5..60886c1 100644 (file)
@@ -14,8 +14,8 @@
  *             neuffer@goofy.zdv.uni-mainz.de               *
  *             a.arnold@kfa-juelich.de                      * 
  *                                                          *
- *  Updated 2002 by Alan Cox <alan@redhat.com> for Linux    *
- *  2.5.x and the newer locking and error handling          *
+ *  Updated 2002 by Alan Cox <alan@lxorguk.ukuu.org.uk> for *
+ *   Linux 2.5.x and the newer locking and error handling   *
  *                                                          *
  *  This program is free software; you can redistribute it  *
  *  and/or modify it under the terms of the GNU General     *
@@ -50,7 +50,6 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
@@ -172,7 +171,7 @@ static void IncStat(struct scsi_pointer *SCp, unsigned int Increment)
                        SCp->Status = 0;
                else {
                        SCp->buffer++;
-                       SCp->ptr = page_address(SCp->buffer->page) + SCp->buffer->offset;
+                       SCp->ptr = sg_virt(SCp->buffer);
                        SCp->this_residual = SCp->buffer->length;
                }
        }
@@ -369,13 +368,12 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
        cp = &hd->ccb[y];
 
        memset(cp, 0, sizeof(struct eata_ccb));
-       memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
 
        cp->status = USED;      /* claim free slot */
 
        DBG(DBG_QUEUE, scmd_printk(KERN_DEBUG, cmd,
                "eata_pio_queue pid %ld, y %d\n",
-               cmd->pid, y));
+               cmd->serial_number, y));
 
        cmd->scsi_done = (void *) done;
 
@@ -385,7 +383,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
                cp->DataIn = 0; /* Input mode  */
 
        cp->Interpret = (cmd->device->id == hd->hostid);
-       cp->cp_datalen = cpu_to_be32(cmd->request_bufflen);
+       cp->cp_datalen = cpu_to_be32(scsi_bufflen(cmd));
        cp->Auto_Req_Sen = 0;
        cp->cp_reqDMA = 0;
        cp->reqlen = 0;
@@ -402,15 +400,15 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
        cp->cmd = cmd;
        cmd->host_scribble = (char *) &hd->ccb[y];
 
-       if (cmd->use_sg == 0) {
+       if (!scsi_bufflen(cmd)) {
                cmd->SCp.buffers_residual = 1;
-               cmd->SCp.ptr = cmd->request_buffer;
-               cmd->SCp.this_residual = cmd->request_bufflen;
+               cmd->SCp.ptr = NULL;
+               cmd->SCp.this_residual = 0;
                cmd->SCp.buffer = NULL;
        } else {
-               cmd->SCp.buffer = cmd->request_buffer;
-               cmd->SCp.buffers_residual = cmd->use_sg;
-               cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
+               cmd->SCp.buffer = scsi_sglist(cmd);
+               cmd->SCp.buffers_residual = scsi_sg_count(cmd);
+               cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
                cmd->SCp.this_residual = cmd->SCp.buffer->length;
        }
        cmd->SCp.Status = (cmd->SCp.this_residual != 0);        /* TRUE as long as bytes 
@@ -420,7 +418,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
                cmd->result = DID_BUS_BUSY << 16;
                scmd_printk(KERN_NOTICE, cmd,
                        "eata_pio_queue pid %ld, HBA busy, "
-                       "returning DID_BUS_BUSY, done.\n", cmd->pid);
+                       "returning DID_BUS_BUSY, done.\n", cmd->serial_number);
                done(cmd);
                cp->status = FREE;
                return 0;
@@ -435,7 +433,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
 
        DBG(DBG_QUEUE, scmd_printk(KERN_DEBUG, cmd,
                "Queued base %#.4lx pid: %ld "
-               "slot %d irq %d\n", sh->base, cmd->pid, y, sh->irq));
+               "slot %d irq %d\n", sh->base, cmd->serial_number, y, sh->irq));
 
        return 0;
 }
@@ -446,7 +444,7 @@ static int eata_pio_abort(struct scsi_cmnd *cmd)
 
        DBG(DBG_ABNORM, scmd_printk(KERN_WARNING, cmd,
                "eata_pio_abort called pid: %ld\n",
-               cmd->pid));
+               cmd->serial_number));
 
        while (inb(cmd->device->host->base + HA_RAUXSTAT) & HA_ABUSY)
                if (--loop == 0) {
@@ -482,7 +480,7 @@ static int eata_pio_host_reset(struct scsi_cmnd *cmd)
 
        DBG(DBG_ABNORM, scmd_printk(KERN_WARNING, cmd,
                "eata_pio_reset called pid:%ld\n",
-               cmd->pid));
+               cmd->serial_number));
 
        spin_lock_irq(host->host_lock);
 
@@ -501,7 +499,7 @@ static int eata_pio_host_reset(struct scsi_cmnd *cmd)
 
                sp = HD(cmd)->ccb[x].cmd;
                HD(cmd)->ccb[x].status = RESET;
-               printk(KERN_WARNING "eata_pio_reset: slot %d in reset, pid %ld.\n", x, sp->pid);
+               printk(KERN_WARNING "eata_pio_reset: slot %d in reset, pid %ld.\n", x, sp->serial_number);
 
                if (sp == NULL)
                        panic("eata_pio_reset: slot %d, sp==NULL.\n", x);
@@ -816,8 +814,6 @@ static int register_pio_HBA(long base, struct get_conf *gc, struct pci_dev *pdev
        else
                hd->primary = 1;
 
-       sh->unchecked_isa_dma = 0;      /* We can only do PIO */
-
        hd->next = NULL;        /* build a linked list of all HBAs */
        hd->prev = last_HBA;
        if (hd->prev != NULL)