diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-05-06 17:36:38 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:04:47 -0700 |
commit | 4b33981ade7cf723f3f32809e34192376c9a10f8 (patch) | |
tree | 576eda3b06d27e9911203bfbf2e5818ce63cac08 /drivers/scsi/isci/phy.h | |
parent | a98a7426bc91700ac8613701daf8470efe2ad2d2 (diff) | |
download | blackbird-op-linux-4b33981ade7cf723f3f32809e34192376c9a10f8.tar.gz blackbird-op-linux-4b33981ade7cf723f3f32809e34192376c9a10f8.zip |
isci: unify phy data structures
Make scic_sds_phy a member of isci_phy and merge their lifetimes which
means removing the phy table from scic_sds_controller in favor of the
one at that isci_host level.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/phy.h')
-rw-r--r-- | drivers/scsi/isci/phy.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/scsi/isci/phy.h b/drivers/scsi/isci/phy.h index 21f6050eadbe..93ec2d4a9c30 100644 --- a/drivers/scsi/isci/phy.h +++ b/drivers/scsi/isci/phy.h @@ -54,24 +54,17 @@ */ -#if !defined(_ISCI_PHY_H_) +#ifndef _ISCI_PHY_H_ #define _ISCI_PHY_H_ -#include "port.h" -#include "host.h" #include <scsi/sas.h> #include <scsi/libsas.h> - - -/** - * struct isci_phy - This class implements the ISCI specific representation of - * the phy object. - * - * - */ +#include "scic_sds_phy.h" +#include "port.h" +#include "host.h" struct isci_phy { - struct scic_sds_phy *sci_phy_handle; + struct scic_sds_phy sci; struct asd_sas_phy sas_phy; struct isci_port *isci_port; u8 sas_addr[SAS_ADDR_SIZE]; @@ -82,17 +75,21 @@ struct isci_phy { } frame_rcvd; }; -#define to_isci_phy(p) \ - container_of(p, struct isci_phy, sas_phy); +static inline struct isci_phy *to_isci_phy(struct asd_sas_phy *sas_phy) +{ + struct isci_phy *iphy = container_of(sas_phy, typeof(*iphy), sas_phy); + + return iphy; +} + +static inline struct isci_phy *sci_phy_to_iphy(struct scic_sds_phy *sci_phy) +{ + struct isci_phy *iphy = container_of(sci_phy, typeof(*iphy), sci); -void isci_phy_init( - struct isci_phy *phy, - struct isci_host *isci_host, - int index); + return iphy; +} -int isci_phy_control( - struct asd_sas_phy *phy, - enum phy_func func, - void *buf); +void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index); +int isci_phy_control(struct asd_sas_phy *phy, enum phy_func func, void *buf); #endif /* !defined(_ISCI_PHY_H_) */ |