mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: linux-ide@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] libata: add ->proto_mask
Date: Sat, 14 Jul 2007 04:16:34 -0400	[thread overview]
Message-ID: <20070714081633.GA27006@havoc.gtf.org> (raw)
In-Reply-To: <20070714081526.GA26878@havoc.gtf.org>


commit c7baac44f3a02b895873cce48c6e426ddbea06b9
Author: Jeff Garzik <jeff@garzik.org>
Date:   Sat Jul 14 03:27:11 2007 -0400

    [libata] Introduce per-port taskfile protocol masks
    
    One ATA_PMASK_$name bitmapped value exists for each ATA_PROT_$name
    value.
    
    ->proto_mask member added to ata_port and ata_port_info for holding
    this data.
    
    Signed-off-by: Jeff Garzik <jeff@garzik.org>

 drivers/ata/libata-core.c |    3 +++
 drivers/ata/libata-scsi.c |    1 +
 include/linux/ata.h       |   20 ++++++++++++++++++++
 include/linux/libata.h    |    7 +++++++
 4 files changed, 31 insertions(+)

c7baac44f3a02b895873cce48c6e426ddbea06b9
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 88e2dd0..5cffca8 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6007,6 +6007,7 @@ void ata_dev_init(struct ata_device *dev)
 	dev->pio_mask = UINT_MAX;
 	dev->mwdma_mask = UINT_MAX;
 	dev->udma_mask = UINT_MAX;
+	dev->proto_mask = UINT_MAX;
 }
 
 /**
@@ -6211,6 +6212,8 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
 		ap->pio_mask = pi->pio_mask;
 		ap->mwdma_mask = pi->mwdma_mask;
 		ap->udma_mask = pi->udma_mask;
+		ap->proto_mask = pi->proto_mask;
+
 		ap->flags |= pi->flags;
 		ap->ops = pi->port_ops;
 
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index cfde22d..f6da0cb 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3234,6 +3234,7 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
 	ap->pio_mask = port_info->pio_mask;
 	ap->mwdma_mask = port_info->mwdma_mask;
 	ap->udma_mask = port_info->udma_mask;
+	ap->proto_mask = port_info->proto_mask;
 	ap->flags |= port_info->flags;
 	ap->ops = port_info->port_ops;
 	ap->cbl = ATA_CBL_SATA;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index b5a2016..c5c4780 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -283,6 +283,26 @@ enum ata_tf_protocols {
 	ATA_PROT_ATAPI_DMA,	/* packet command with special DMA sauce */
 };
 
+#define DEF(x) \
+	ATA_PMASK_##x = (1 << ATA_PROT_##x)
+enum ata_tf_proto_masks {
+	DEF(NODATA),
+	DEF(PIO),
+	DEF(DMA),
+	DEF(NCQ),
+	DEF(ATAPI),
+	DEF(ATAPI_NODATA),
+	DEF(ATAPI_DMA),
+};
+#undef DEF
+
+enum ata_standard_proto_masks {
+	ATA_PMASK_SFF		= ATA_PMASK_NODATA | ATA_PMASK_PIO |
+				  ATA_PMASK_ATAPI | ATA_PMASK_ATAPI_NODATA,
+	ATA_PMASK_SFF_DMA	= ATA_PMASK_SFF |
+				  ATA_PMASK_DMA | ATA_PMASK_ATAPI_DMA,
+};
+
 enum ata_ioctls {
 	ATA_IOC_GET_IO32	= 0x309,
 	ATA_IOC_SET_IO32	= 0x324,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 47cd2a1..2f9174c 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -457,6 +457,7 @@ struct ata_device {
 	unsigned int		pio_mask;
 	unsigned int		mwdma_mask;
 	unsigned int		udma_mask;
+	unsigned int		proto_mask;
 
 	/* for CHS addressing */
 	u16			cylinders;	/* Number of cylinders */
@@ -524,9 +525,12 @@ struct ata_port {
 
 	u8			ctl;	/* cache of ATA control register */
 	u8			last_ctl;	/* Cache last written value */
+
 	unsigned int		pio_mask;
 	unsigned int		mwdma_mask;
 	unsigned int		udma_mask;
+	unsigned int		proto_mask;
+
 	unsigned int		cbl;	/* cable type; ATA_CBL_xxx */
 	unsigned int		hw_sata_spd_limit;
 	unsigned int		sata_spd_limit;	/* SATA PHY speed limit */
@@ -638,9 +642,12 @@ struct ata_port_operations {
 struct ata_port_info {
 	struct scsi_host_template	*sht;
 	unsigned long		flags;
+
 	unsigned long		pio_mask;
 	unsigned long		mwdma_mask;
 	unsigned long		udma_mask;
+	unsigned long		proto_mask;
+
 	const struct ata_port_operations *port_ops;
 	irq_handler_t		irq_handler;
 	void 			*private_data;

  reply	other threads:[~2007-07-14  8:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14  8:15 [PATCH 0/3] libata: add taskfile protocol ->proto_mask info member Jeff Garzik
2007-07-14  8:16 ` Jeff Garzik [this message]
2007-07-14  8:17 ` [PATCH 2/3] libata: use ->proto_mask in drivers Jeff Garzik
2007-07-14  8:56   ` Alan Cox
2007-07-14  8:18 ` [PATCH 3/3] libata: replace ATA_FLAG_{NCQ,NO_ATAPI} using ->proto_mask Jeff Garzik

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=20070714081633.GA27006@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®