From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@hansenpartnership.com,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Nagalakshmi.Nandigama@lsi.com, Eric.Moore@lsi.com
Subject: [PATCH 2/3] mpt2sas: Add a module parameter that permits overriding protection capabilities
Date: Mon, 20 Feb 2012 20:36:23 -0500 [thread overview]
Message-ID: <1329788184-6477-3-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <1329788184-6477-1-git-send-email-martin.petersen@oracle.com>
From: "Martin K. Petersen" <martin.petersen@oracle.com>
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>
Cc: Nagalakshmi.Nandigama@lsi.com
Cc: Eric.Moore@lsi.com
---
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 9085d3e..f398300 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -119,6 +119,11 @@ module_param(diag_buffer_enable, int, 0);
MODULE_PARM_DESC(diag_buffer_enable, " post diag buffers "
"(TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)");
+/* 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
@@ -8007,8 +8012,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 */
--
1.7.8.3.21.gab8a7
next prev parent reply other threads:[~2012-02-21 1:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 1:36 [SCSI] mpt2sas T10 DIF fixes Martin K. Petersen
2012-02-21 1:36 ` [PATCH 1/3] mpt2sas: Return the correct sense key for DIF errors Martin K. Petersen
2012-02-21 1:36 ` Martin K. Petersen [this message]
2012-02-21 1:36 ` [PATCH 3/3] mpt2sas: Do not check DIF for unwritten blocks Martin K. Petersen
2012-08-09 8:14 ` [SCSI] mpt2sas T10 DIF fixes Ankit Jain
2012-08-17 16:00 ` Martin K. Petersen
2012-08-19 14:49 ` Pasi Kärkkäinen
2012-08-19 15:18 ` Martin K. Petersen
2012-08-19 15:30 ` Pasi Kärkkäinen
2012-08-19 16:38 ` Martin K. Petersen
2012-08-19 20:19 ` Pasi Kärkkäinen
2012-08-20 10:48 ` Pasi Kärkkäinen
2012-08-20 11:06 ` Pasi Kärkkäinen
2012-08-21 0:43 ` Martin K. Petersen
2012-08-21 6:13 ` Pasi Kärkkäinen
2012-08-21 0:40 ` Martin K. Petersen
2012-08-21 6:12 ` Pasi Kärkkäinen
2012-08-21 15:50 ` Jiang, Dave
2012-08-22 18:36 ` Martin K. Petersen
2012-10-01 9:17 ` Pasi Kärkkäinen
2012-10-02 22:24 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329788184-6477-3-git-send-email-martin.petersen@oracle.com \
--to=martin.petersen@oracle.com \
--cc=Eric.Moore@lsi.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=Nagalakshmi.Nandigama@lsi.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).