From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: Alexis Bruemmer <alexisb@us.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/2] Add SATA support to libsas
Date: Tue, 22 Aug 2006 12:26:45 -0500 [thread overview]
Message-ID: <1156267605.19615.4.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <44DBE943.4080303@us.ibm.com>
On Thu, 2006-08-10 at 19:19 -0700, Darrick J. Wong wrote:
> +static inline void sas_mark_dev_sata(struct domain_device *dev)
> +{
> + dev->rphy->identify = dev->port->phy->identify;
> + dev->rphy->identify.initiator_port_protocols =
> SAS_PROTOCOL_SATA;
> + dev->rphy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
> + dev->rphy->identify.device_type = SAS_END_DEVICE;
> + memcpy(&dev->rphy->identify.sas_address, dev->sas_addr,
> SAS_ADDR_SIZE);
> +}
Actually, this is wrong: you can't memcpy from dev->sas_addr to
identify.sas_addr the former is a big endian u8[8] and the latter is a
u64. However, the function is unnecessary anyway. We already have a
sas_fill_in_rphy that does all of this.
James
Index: BUILD-2.6/drivers/scsi/libsas/sas_discover.c
===================================================================
--- BUILD-2.6.orig/drivers/scsi/libsas/sas_discover.c 2006-08-21 21:30:38.000000000 -0500
+++ BUILD-2.6/drivers/scsi/libsas/sas_discover.c 2006-08-21 21:49:22.000000000 -0500
@@ -398,15 +398,6 @@
spin_unlock_irqrestore(&port->phy_list_lock, flags);
}
-static inline void sas_mark_dev_sata(struct domain_device *dev)
-{
- dev->rphy->identify = dev->port->phy->identify;
- dev->rphy->identify.initiator_port_protocols = SAS_PROTOCOL_SATA;
- dev->rphy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
- dev->rphy->identify.device_type = SAS_END_DEVICE;
- memcpy(&dev->rphy->identify.sas_address, dev->sas_addr, SAS_ADDR_SIZE);
-}
-
#define ATA_IDENTIFY_DEV 0xEC
#define ATA_IDENTIFY_PACKET_DEV 0xA1
#define ATA_SET_FEATURES 0xEF
@@ -490,7 +481,7 @@
sas_satl_register_dev(dev);
*/
- sas_mark_dev_sata(dev);
+ sas_fill_in_rphy(dev, dev->rphy);
res = sas_rphy_add(dev->rphy);
if (res)
next prev parent reply other threads:[~2006-08-22 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-11 2:19 [PATCH 1/2] Add SATA support to libsas Darrick J. Wong
2006-08-11 8:52 ` Jeff Garzik
2006-08-24 22:18 ` James Bottomley
2006-08-22 17:26 ` James Bottomley [this message]
2006-08-25 19:43 ` Konrad Rzeszutek
2006-08-25 20:21 ` Adrian Bunk
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=1156267605.19615.4.camel@mulgrave.il.steeleye.com \
--to=james.bottomley@hansenpartnership.com \
--cc=alexisb@us.ibm.com \
--cc=djwong@us.ibm.com \
--cc=linux-kernel@vger.kernel.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.