]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[SCSI] mpt2sas: Add a module parameter that permits overriding protection capabilities
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 28 Aug 2012 18:29:37 +0000 (14:29 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 18 Sep 2012 09:39:04 +0000 (10:39 +0100)
Add a parameter that allows the host protection capabilities mask to be
provided at module load time.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: "Sreekanth Reddy" <Sreekanth.reddy@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_scsih.c

index bfda0ecd960dc230de8ed281db5e19b8a8aecbc2..96f4d1f1cf5e15367cb9d7e81b78684c427576c2 100644 (file)
@@ -123,6 +123,11 @@ static int disable_discovery = -1;
 module_param(disable_discovery, int, 0);
 MODULE_PARM_DESC(disable_discovery, " disable discovery ");
 
+/* permit overriding the host protection capabilities mask (EEDP/T10 PI) */
+static int prot_mask = 0;
+module_param(prot_mask, int, 0);
+MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=7 ");
+
 /**
  * struct sense_info - common structure for obtaining sense keys
  * @skey: sense key
@@ -8088,8 +8093,14 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto out_add_shost_fail;
        }
 
-       scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
-           | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION);
+       /* register EEDP capabilities with SCSI layer */
+       if (prot_mask)
+               scsi_host_set_prot(shost, prot_mask);
+       else
+               scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
+                                  | SHOST_DIF_TYPE2_PROTECTION
+                                  | SHOST_DIF_TYPE3_PROTECTION);
+
        scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
 
        /* event thread */