Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] mpt2sas: Add a module parameter that permits overriding protection capabilities

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>

authored by

Martin K. Petersen and committed by
James Bottomley
5e95e731 9b5cd132

+13 -2
+13 -2
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 123 123 module_param(disable_discovery, int, 0); 124 124 MODULE_PARM_DESC(disable_discovery, " disable discovery "); 125 125 126 + /* permit overriding the host protection capabilities mask (EEDP/T10 PI) */ 127 + static int prot_mask = 0; 128 + module_param(prot_mask, int, 0); 129 + MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=7 "); 130 + 126 131 /** 127 132 * struct sense_info - common structure for obtaining sense keys 128 133 * @skey: sense key ··· 8093 8088 goto out_add_shost_fail; 8094 8089 } 8095 8090 8096 - scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION 8097 - | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION); 8091 + /* register EEDP capabilities with SCSI layer */ 8092 + if (prot_mask) 8093 + scsi_host_set_prot(shost, prot_mask); 8094 + else 8095 + scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION 8096 + | SHOST_DIF_TYPE2_PROTECTION 8097 + | SHOST_DIF_TYPE3_PROTECTION); 8098 + 8098 8099 scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); 8099 8100 8100 8101 /* event thread */