[SCSI] scsi_transport_fc: fix missing kernel-doc
[safe/jmp/linux-2.6] / drivers / scsi / initio.c
index 01bf018..89a5948 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 1994-1998 Initio Corporation
  * Copyright (c) 1998 Bas Vermeulen <bvermeul@blackstar.xs4all.nl>
  * Copyright (c) 2004 Christoph Hellwig <hch@lst.de>
- * Copyright (c) 2007 Red Hat <alan@redhat.com>
+ * Copyright (c) 2007 Red Hat
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -823,7 +823,7 @@ static void initio_append_busy_scb(struct initio_host * host, struct scsi_ctrl_b
 {
 
 #if DEBUG_QUEUE
-       printk("append busy SCB %o; ", scbp);
+       printk("append busy SCB %p; ", scbp);
 #endif
        if (scbp->tagmsg)
                host->act_tags[scbp->target]++;
@@ -2581,8 +2581,8 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
        /* Map the sense buffer into bus memory */
        dma_addr = dma_map_single(&host->pci_dev->dev, cmnd->sense_buffer,
                                  SENSE_SIZE, DMA_FROM_DEVICE);
-       cblk->senseptr = cpu_to_le32((u32)dma_addr);
-       cblk->senselen = cpu_to_le32(SENSE_SIZE);
+       cblk->senseptr = (u32)dma_addr;
+       cblk->senselen = SENSE_SIZE;
        cmnd->SCp.ptr = (char *)(unsigned long)dma_addr;
        cblk->cdblen = cmnd->cmd_len;
 
@@ -2590,7 +2590,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
        cblk->hastat = 0;
        cblk->tastat = 0;
        /* Command the command */
-       memcpy(&cblk->cdb[0], &cmnd->cmnd, cmnd->cmd_len);
+       memcpy(cblk->cdb, cmnd->cmnd, cmnd->cmd_len);
 
        /* Set up tags */
        if (cmnd->device->tagged_supported) {   /* Tag Support                  */
@@ -2606,16 +2606,18 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
                dma_addr = dma_map_single(&host->pci_dev->dev, &cblk->sglist[0],
                                          sizeof(struct sg_entry) * TOTAL_SG_ENTRY,
                                          DMA_BIDIRECTIONAL);
-               cblk->bufptr = cpu_to_le32((u32)dma_addr);
+               cblk->bufptr = (u32)dma_addr;
                cmnd->SCp.dma_handle = dma_addr;
 
+               cblk->sglen = nseg;
 
                cblk->flags |= SCF_SG;  /* Turn on SG list flag       */
                total_len = 0;
                sg = &cblk->sglist[0];
                scsi_for_each_sg(cmnd, sglist, cblk->sglen, i) {
                        sg->data = cpu_to_le32((u32)sg_dma_address(sglist));
-                       total_len += sg->len = cpu_to_le32((u32)sg_dma_len(sglist));
+                       sg->len = cpu_to_le32((u32)sg_dma_len(sglist));
+                       total_len += sg_dma_len(sglist);
                        ++sg;
                }
 
@@ -2832,7 +2834,6 @@ static struct scsi_host_template initio_template = {
        .sg_tablesize           = SG_ALL,
        .cmd_per_lun            = 1,
        .use_clustering         = ENABLE_CLUSTERING,
-       .use_sg_chaining        = ENABLE_SG_CHAINING,
 };
 
 static int initio_probe_one(struct pci_dev *pdev,
@@ -2855,7 +2856,7 @@ static int initio_probe_one(struct pci_dev *pdev,
                reg = 0;
        bios_seg = (bios_seg << 8) + ((u16) ((reg & 0xFF00) >> 8));
 
-       if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
                printk(KERN_WARNING  "i91u: Could not set 32 bit DMA mask\n");
                error = -ENODEV;
                goto out_disable_device;
@@ -2869,6 +2870,7 @@ static int initio_probe_one(struct pci_dev *pdev,
        host = (struct initio_host *)shost->hostdata;
        memset(host, 0, sizeof(struct initio_host));
        host->addr = pci_resource_start(pdev, 0);
+       host->bios_addr = bios_seg;
 
        if (!request_region(host->addr, 256, "i91u")) {
                printk(KERN_WARNING "initio: I/O port range 0x%x is busy.\n", host->addr);
@@ -2895,6 +2897,8 @@ static int initio_probe_one(struct pci_dev *pdev,
 
        host->pci_dev = pdev;
 
+       host->semaph = 1;
+       spin_lock_init(&host->semaph_lock);
        host->num_scbs = num_scb;
        host->scb = scb;
        host->next_pending = scb;
@@ -2911,7 +2915,7 @@ static int initio_probe_one(struct pci_dev *pdev,
        host->last_avail = prev;
        spin_lock_init(&host->avail_lock);
 
-       initio_init(host, phys_to_virt(bios_seg << 4));
+       initio_init(host, phys_to_virt(((u32)bios_seg << 4)));
 
        host->jsstatus0 = 0;