Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH] update the 53c700 use of transport attributes
Date: 12 Mar 2004 16:09:53 -0500	[thread overview]
Message-ID: <1079125796.1877.39.camel@mulgrave> (raw)

This patch just brings it up to date with the previous transport
attribute patch, moving it to the model where it sets the min/max of the
attribute if asked for something outside its range.  It also only makes
period and offset visible (it doesn't care about any of the others).

James

===== drivers/scsi/53c700.c 1.47 vs edited =====
--- 1.47/drivers/scsi/53c700.c	Sun Mar  7 17:44:25 2004
+++ edited/drivers/scsi/53c700.c	Fri Mar 12 12:52:13 2004
@@ -1998,9 +2002,12 @@
 	struct NCR_700_Host_Parameters *hostdata = 
 		(struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
 	
-	if(!hostdata->fast || period < hostdata->min_period)
+	if(!hostdata->fast)
 		return;
 
+	if(period < hostdata->min_period)
+		period = hostdata->min_period;
+
 	spi_period(SDp) = period;
 	NCR_700_clear_flag(SDp, NCR_700_DEV_NEGOTIATED_SYNC);
 	NCR_700_clear_flag(SDp, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION);
@@ -2012,12 +2019,15 @@
 {
 	struct NCR_700_Host_Parameters *hostdata = 
 		(struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
+	int max_offset = hostdata->chip710
+		? NCR_710_MAX_OFFSET : NCR_700_MAX_OFFSET;
 	
-	if(!hostdata->fast ||
-	   offset > (hostdata->chip710
-		     ? NCR_710_MAX_OFFSET : NCR_700_MAX_OFFSET))
+	if(!hostdata->fast)
 		return;
 
+	if(offset > max_offset)
+		offset = max_offset;
+
 	/* if we're currently async, make sure the period is reasonable */
 	if(spi_offset(SDp) == 0 && (spi_period(SDp) < hostdata->min_period ||
 				    spi_period(SDp) > 0xff))
@@ -2107,8 +2119,10 @@
 EXPORT_SYMBOL(NCR_700_intr);
 
 static struct spi_function_template NCR_700_transport_functions =  {
-	.set_period = NCR_700_set_period,
-	.set_offset = NCR_700_set_offset,
+	.set_period	= NCR_700_set_period,
+	.show_period	= 1,
+	.set_offset	= NCR_700_set_offset,
+	.show_offset	= 1,
 };
 
 static int __init NCR_700_init(void)


                 reply	other threads:[~2004-03-12 21:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1079125796.1877.39.camel@mulgrave \
    --to=james.bottomley@steeleye.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