aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/phy.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-05-06 20:36:38 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:47 -0400
commit4b33981ade7cf723f3f32809e34192376c9a10f8 (patch)
tree576eda3b06d27e9911203bfbf2e5818ce63cac08 /drivers/scsi/isci/phy.h
parenta98a7426bc91700ac8613701daf8470efe2ad2d2 (diff)
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.h41
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 @@
54 */ 54 */
55 55
56 56
57#if !defined(_ISCI_PHY_H_) 57#ifndef _ISCI_PHY_H_
58#define _ISCI_PHY_H_ 58#define _ISCI_PHY_H_
59 59
60#include "port.h"
61#include "host.h"
62#include <scsi/sas.h> 60#include <scsi/sas.h>
63#include <scsi/libsas.h> 61#include <scsi/libsas.h>
64 62#include "scic_sds_phy.h"
65 63#include "port.h"
66/** 64#include "host.h"
67 * struct isci_phy - This class implements the ISCI specific representation of
68 * the phy object.
69 *
70 *
71 */
72 65
73struct isci_phy { 66struct isci_phy {
74 struct scic_sds_phy *sci_phy_handle; 67 struct scic_sds_phy sci;
75 struct asd_sas_phy sas_phy; 68 struct asd_sas_phy sas_phy;
76 struct isci_port *isci_port; 69 struct isci_port *isci_port;
77 u8 sas_addr[SAS_ADDR_SIZE]; 70 u8 sas_addr[SAS_ADDR_SIZE];
@@ -82,17 +75,21 @@ struct isci_phy {
82 } frame_rcvd; 75 } frame_rcvd;
83}; 76};
84 77
85#define to_isci_phy(p) \ 78static inline struct isci_phy *to_isci_phy(struct asd_sas_phy *sas_phy)
86 container_of(p, struct isci_phy, sas_phy); 79{
80 struct isci_phy *iphy = container_of(sas_phy, typeof(*iphy), sas_phy);
81
82 return iphy;
83}
84
85static inline struct isci_phy *sci_phy_to_iphy(struct scic_sds_phy *sci_phy)
86{
87 struct isci_phy *iphy = container_of(sci_phy, typeof(*iphy), sci);
87 88
88void isci_phy_init( 89 return iphy;
89 struct isci_phy *phy, 90}
90 struct isci_host *isci_host,
91 int index);
92 91
93int isci_phy_control( 92void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index);
94 struct asd_sas_phy *phy, 93int isci_phy_control(struct asd_sas_phy *phy, enum phy_func func, void *buf);
95 enum phy_func func,
96 void *buf);
97 94
98#endif /* !defined(_ISCI_PHY_H_) */ 95#endif /* !defined(_ISCI_PHY_H_) */