[SCSI] bfa: fix test in bfad_os_fc_host_init()
[safe/jmp/linux-2.6] / drivers / scsi / sd_dif.c
index c9b4107..88da977 100644 (file)
@@ -320,15 +320,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp)
                dif = 0; dix = 1;
        }
 
-       if (type) {
-               if (dif)
-                       sd_printk(KERN_NOTICE, sdkp,
-                                 "Enabling DIF Type %d protection\n", type);
-               else
-                       sd_printk(KERN_NOTICE, sdkp,
-                                 "Disabling DIF Type %d protection\n", type);
-       }
-
        if (!dix)
                return;
 
@@ -360,58 +351,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp)
 }
 
 /*
- * DIF DMA operation magic decoder ring.
- */
-void sd_dif_op(struct scsi_cmnd *scmd, unsigned int dif, unsigned int dix, unsigned int type)
-{
-       int csum_convert, prot_op;
-
-       prot_op = 0;
-
-       /* Convert checksum? */
-       if (scsi_host_get_guard(scmd->device->host) != SHOST_DIX_GUARD_CRC)
-               csum_convert = 1;
-       else
-               csum_convert = 0;
-
-       switch (scmd->cmnd[0]) {
-       case READ_10:
-       case READ_12:
-       case READ_16:
-               if (dif && dix)
-                       if (csum_convert)
-                               prot_op = SCSI_PROT_READ_CONVERT;
-                       else
-                               prot_op = SCSI_PROT_READ_PASS;
-               else if (dif && !dix)
-                       prot_op = SCSI_PROT_READ_STRIP;
-               else if (!dif && dix)
-                       prot_op = SCSI_PROT_READ_INSERT;
-
-               break;
-
-       case WRITE_10:
-       case WRITE_12:
-       case WRITE_16:
-               if (dif && dix)
-                       if (csum_convert)
-                               prot_op = SCSI_PROT_WRITE_CONVERT;
-                       else
-                               prot_op = SCSI_PROT_WRITE_PASS;
-               else if (dif && !dix)
-                       prot_op = SCSI_PROT_WRITE_INSERT;
-               else if (!dif && dix)
-                       prot_op = SCSI_PROT_WRITE_STRIP;
-
-               break;
-       }
-
-       scsi_set_prot_op(scmd, prot_op);
-       if (dif)
-               scsi_set_prot_type(scmd, type);
-}
-
-/*
  * The virtual start sector is the one that was originally submitted
  * by the block layer. Due to partitioning, MD/DM cloning, etc. the
  * actual physical start sector is likely to be different.  Remap
@@ -503,7 +442,7 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int good_bytes)
        sector_sz = scmd->device->sector_size;
        sectors = good_bytes / sector_sz;
 
-       phys = scmd->request->sector & 0xffffffff;
+       phys = blk_rq_pos(scmd->request) & 0xffffffff;
        if (sector_sz == 4096)
                phys >>= 3;