All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Higdon <jeremy@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] add spi attributes to qla1280
Date: Wed, 11 Aug 2004 22:29:24 -0700	[thread overview]
Message-ID: <20040812052924.GA33167@sgi.com> (raw)
In-Reply-To: <20040811232225.A1192@infradead.org>

On Wed, Aug 11, 2004 at 11:22:25PM +0100, Christoph Hellwig wrote:
> On Wed, Aug 11, 2004 at 03:16:36PM -0700, Jeremy Higdon wrote:
> > 
> > So I'll submit a patch to 2.6.8-rc4-mm1 then, if that's okay.
> 
> Sounds good.  While you're at it can you also fix the compilation
> error when the driver is compiled for port I/O instead of normal
> mmio (e.g. SGI ViswW), you broke that with your readb_relaxed changes.

Okay.  Here is the new rendition, based on 2.6.8-rc4-mm1, with the
fix for port I/O.  For sync period and offset, it seems that the
isp1040 is the same as the isp1280.

Thanks,

jeremy


Signed-off-by: Jeremy Higdon <jeremy@sgi.com>


diff -ur -X /home/jeremy/dontdiff linux-2.6.8-rc4/drivers/scsi/Kconfig linux-2.6.8-rc4.new/drivers/scsi/Kconfig
--- linux-2.6.8-rc4/drivers/scsi/Kconfig	2004-08-11 22:22:41.000000000 -0700
+++ linux-2.6.8-rc4.new/drivers/scsi/Kconfig	2004-08-11 17:41:57.000000000 -0700
@@ -1276,6 +1276,7 @@
 config SCSI_QLOGIC_1280
 	tristate "Qlogic QLA 1280 SCSI support"
 	depends on PCI && SCSI
+	select SCSI_SPI_ATTRS
 	help
 	  Say Y if you have a QLogic ISP1x80/1x160 SCSI host adapter.
 
diff -ur -X /home/jeremy/dontdiff linux-2.6.8-rc4/drivers/scsi/qla1280.c linux-2.6.8-rc4.new/drivers/scsi/qla1280.c
--- linux-2.6.8-rc4/drivers/scsi/qla1280.c	2004-08-11 22:22:41.000000000 -0700
+++ linux-2.6.8-rc4.new/drivers/scsi/qla1280.c	2004-08-11 17:47:13.000000000 -0700
@@ -356,6 +356,8 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_tcq.h>
+#include <scsi/scsi_transport.h>
+#include <scsi/scsi_transport_spi.h>
 #include "scsi.h"
 #else
 #include <linux/blk.h>
@@ -1490,6 +1492,15 @@
 		status = qla1280_set_target_parameters(ha, bus, target);
 	qla1280_get_target_parameters(ha, device);
 	spin_unlock_irqrestore(HOST_LOCK, flags);
+
+	spi_period(device) = nv->bus[bus].target[target].sync_period;
+	if (IS_ISP1x160(ha))
+		spi_offset(device) = nv->bus[bus].target[target].flags.
+			flags1x160.sync_offset;
+	else
+		spi_offset(device) = nv->bus[bus].target[target].flags.
+			flags1x80.sync_offset;
+
 	return status;
 }
 
@@ -4681,6 +4692,12 @@
 };
 #endif
 
+static struct scsi_transport_template *qla1280_transport_template;
+static struct spi_function_template qla1280_transport_functions = {
+	.show_period = 1,
+	.show_offset = 1,
+};
+
 static int __devinit
 qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -4769,6 +4786,7 @@
 	host->max_id = MAX_TARGETS;
 	host->max_sectors = 1024;
 	host->unique_id = host->host_no;
+	host->transportt = qla1280_transport_template;
 
 #if LINUX_VERSION_CODE < 0x020545
 	host->select_queue_depths = qla1280_select_queue_depth;
@@ -4910,6 +4928,10 @@
 		return -EINVAL;
 	}
 
+	qla1280_transport_template = spi_attach_transport(&qla1280_transport_functions);
+	if (!qla1280_transport_template)
+		return -ENODEV;
+
 #ifdef MODULE
 	/*
 	 * If we are called as a module, the qla1280 pointer may not be null
@@ -4934,6 +4956,7 @@
 qla1280_exit(void)
 {
 	pci_unregister_driver(&qla1280_pci_driver);
+	spi_release_transport(qla1280_transport_template);
 }
 
 module_init(qla1280_init);
diff -ur -X /home/jeremy/dontdiff linux-2.6.8-rc4/drivers/scsi/qla1280.h linux-2.6.8-rc4.new/drivers/scsi/qla1280.h
--- linux-2.6.8-rc4/drivers/scsi/qla1280.h	2004-08-11 22:22:41.000000000 -0700
+++ linux-2.6.8-rc4.new/drivers/scsi/qla1280.h	2004-08-11 17:39:31.000000000 -0700
@@ -62,6 +62,7 @@
 #define WRT_REG_WORD(addr, data)	writew(data, addr)
 #else				/* MEMORY_MAPPED_IO */
 #define RD_REG_WORD(addr)		inw((unsigned long)addr)
+#define RD_REG_WORD_dmasync(addr)	inw((unsigned long)addr)
 #define WRT_REG_WORD(addr, data)	outw(data, (unsigned long)addr)
 #endif				/* MEMORY_MAPPED_IO */
 

  reply	other threads:[~2004-08-12  5:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-10 23:05 [PATCH] add spi attributes to qla1280 Jeremy Higdon
2004-08-11  6:31 ` Jes Sorensen
2004-08-11  7:11 ` Christoph Hellwig
2004-08-11 21:56   ` Jeremy Higdon
2004-08-11 22:05     ` Christoph Hellwig
2004-08-11 22:16       ` Jeremy Higdon
2004-08-11 22:22         ` Christoph Hellwig
2004-08-12  5:29           ` Jeremy Higdon [this message]
2004-08-12  9:08             ` Christoph Hellwig

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=20040812052924.GA33167@sgi.com \
    --to=jeremy@sgi.com \
    --cc=hch@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.