aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/phy.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-28 18:05:53 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:52 -0400
commit852809559e4680ba4768262a6c3d21454fcd460e (patch)
treea67170a9dd2a4c9f15d215f4b96e890cdb53a7e7 /drivers/scsi/isci/phy.h
parent5076a1a97e2fa61c847a5fdd4b1991faf7716da6 (diff)
isci: unify isci_phy and scic_sds_phy
They are one in the same object so remove the distinction. The near duplicate fields (owning_port, and isci_port) will be cleaned up after the scic_sds_port isci_port unification. 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.h112
1 files changed, 25 insertions, 87 deletions
diff --git a/drivers/scsi/isci/phy.h b/drivers/scsi/isci/phy.h
index 97ebee16f4b3..345fbeacb5cf 100644
--- a/drivers/scsi/isci/phy.h
+++ b/drivers/scsi/isci/phy.h
@@ -84,102 +84,40 @@ enum scic_sds_phy_protocol {
84}; 84};
85 85
86/** 86/**
87 * struct scic_sds_phy - This structure contains or references all of the data 87 * isci_phy - hba local phy infrastructure
88 * necessary to represent the core phy object and SCU harware protocol 88 * @sm:
89 * engine. 89 * @protocol: attached device protocol
90 * 90 * @phy_index: physical index relative to the controller (0-3)
91 * 91 * @bcn_received_while_port_unassigned: bcn to report after port association
92 * @sata_timer: timeout SATA signature FIS arrival
92 */ 93 */
93struct scic_sds_phy { 94struct isci_phy {
94 /**
95 * This field contains the information for the base phy state machine.
96 */
97 struct sci_base_state_machine sm; 95 struct sci_base_state_machine sm;
98
99 /**
100 * This field specifies the port object that owns/contains this phy.
101 */
102 struct scic_sds_port *owning_port; 96 struct scic_sds_port *owning_port;
103
104 /**
105 * This field indicates whether the phy supports 1.5 Gb/s, 3.0 Gb/s,
106 * or 6.0 Gb/s operation.
107 */
108 enum sas_linkrate max_negotiated_speed; 97 enum sas_linkrate max_negotiated_speed;
109
110 /**
111 * This member specifies the protocol being utilized on this phy. This
112 * field contains a legitamite value once the PHY has link trained with
113 * a remote phy.
114 */
115 enum scic_sds_phy_protocol protocol; 98 enum scic_sds_phy_protocol protocol;
116
117 /**
118 * This field specifies the index with which this phy is associated (0-3).
119 */
120 u8 phy_index; 99 u8 phy_index;
121
122 /**
123 * This member indicates if this particular PHY has received a BCN while
124 * it had no port assignement. This BCN will be reported once the phy is
125 * assigned to a port.
126 */
127 bool bcn_received_while_port_unassigned; 100 bool bcn_received_while_port_unassigned;
128
129 /**
130 * This field indicates if this PHY is currently in the process of
131 * link training (i.e. it has started OOB, but has yet to perform
132 * IAF exchange/Signature FIS reception).
133 */
134 bool is_in_link_training; 101 bool is_in_link_training;
135 102 struct sci_timer sata_timer;
136 /**
137 * Timer to detect when a signature FIS timeout has occurred. The
138 * signature FIS is the first FIS sent by an attached SATA device
139 * after OOB/SN.
140 */
141 struct sci_timer sata_timer;
142
143 /**
144 * This field is the pointer to the transport layer register for the SCU
145 * hardware.
146 */
147 struct scu_transport_layer_registers __iomem *transport_layer_registers; 103 struct scu_transport_layer_registers __iomem *transport_layer_registers;
148
149 /**
150 * This field points to the link layer register set within the SCU.
151 */
152 struct scu_link_layer_registers __iomem *link_layer_registers; 104 struct scu_link_layer_registers __iomem *link_layer_registers;
153
154};
155
156
157struct isci_phy {
158 struct scic_sds_phy sci;
159 struct asd_sas_phy sas_phy; 105 struct asd_sas_phy sas_phy;
160 struct isci_port *isci_port; 106 struct isci_port *isci_port;
161 u8 sas_addr[SAS_ADDR_SIZE]; 107 u8 sas_addr[SAS_ADDR_SIZE];
162
163 union { 108 union {
164 struct sas_identify_frame iaf; 109 struct sas_identify_frame iaf;
165 struct dev_to_host_fis fis; 110 struct dev_to_host_fis fis;
166 } frame_rcvd; 111 } frame_rcvd;
167}; 112};
168 113
169static inline struct isci_phy *to_isci_phy(struct asd_sas_phy *sas_phy) 114static inline struct isci_phy *to_iphy(struct asd_sas_phy *sas_phy)
170{ 115{
171 struct isci_phy *iphy = container_of(sas_phy, typeof(*iphy), sas_phy); 116 struct isci_phy *iphy = container_of(sas_phy, typeof(*iphy), sas_phy);
172 117
173 return iphy; 118 return iphy;
174} 119}
175 120
176static inline struct isci_phy *sci_phy_to_iphy(struct scic_sds_phy *sci_phy)
177{
178 struct isci_phy *iphy = container_of(sci_phy, typeof(*iphy), sci);
179
180 return iphy;
181}
182
183struct scic_phy_cap { 121struct scic_phy_cap {
184 union { 122 union {
185 struct { 123 struct {
@@ -520,61 +458,61 @@ enum scic_sds_phy_states {
520 (scic_sds_port_get_controller((phy)->owning_port)) 458 (scic_sds_port_get_controller((phy)->owning_port))
521 459
522void scic_sds_phy_construct( 460void scic_sds_phy_construct(
523 struct scic_sds_phy *this_phy, 461 struct isci_phy *iphy,
524 struct scic_sds_port *owning_port, 462 struct scic_sds_port *owning_port,
525 u8 phy_index); 463 u8 phy_index);
526 464
527struct scic_sds_port *phy_get_non_dummy_port(struct scic_sds_phy *sci_phy); 465struct scic_sds_port *phy_get_non_dummy_port(struct isci_phy *iphy);
528 466
529void scic_sds_phy_set_port( 467void scic_sds_phy_set_port(
530 struct scic_sds_phy *this_phy, 468 struct isci_phy *iphy,
531 struct scic_sds_port *owning_port); 469 struct scic_sds_port *owning_port);
532 470
533enum sci_status scic_sds_phy_initialize( 471enum sci_status scic_sds_phy_initialize(
534 struct scic_sds_phy *this_phy, 472 struct isci_phy *iphy,
535 struct scu_transport_layer_registers __iomem *transport_layer_registers, 473 struct scu_transport_layer_registers __iomem *transport_layer_registers,
536 struct scu_link_layer_registers __iomem *link_layer_registers); 474 struct scu_link_layer_registers __iomem *link_layer_registers);
537 475
538enum sci_status scic_sds_phy_start( 476enum sci_status scic_sds_phy_start(
539 struct scic_sds_phy *this_phy); 477 struct isci_phy *iphy);
540 478
541enum sci_status scic_sds_phy_stop( 479enum sci_status scic_sds_phy_stop(
542 struct scic_sds_phy *this_phy); 480 struct isci_phy *iphy);
543 481
544enum sci_status scic_sds_phy_reset( 482enum sci_status scic_sds_phy_reset(
545 struct scic_sds_phy *this_phy); 483 struct isci_phy *iphy);
546 484
547void scic_sds_phy_resume( 485void scic_sds_phy_resume(
548 struct scic_sds_phy *this_phy); 486 struct isci_phy *iphy);
549 487
550void scic_sds_phy_setup_transport( 488void scic_sds_phy_setup_transport(
551 struct scic_sds_phy *this_phy, 489 struct isci_phy *iphy,
552 u32 device_id); 490 u32 device_id);
553 491
554enum sci_status scic_sds_phy_event_handler( 492enum sci_status scic_sds_phy_event_handler(
555 struct scic_sds_phy *this_phy, 493 struct isci_phy *iphy,
556 u32 event_code); 494 u32 event_code);
557 495
558enum sci_status scic_sds_phy_frame_handler( 496enum sci_status scic_sds_phy_frame_handler(
559 struct scic_sds_phy *this_phy, 497 struct isci_phy *iphy,
560 u32 frame_index); 498 u32 frame_index);
561 499
562enum sci_status scic_sds_phy_consume_power_handler( 500enum sci_status scic_sds_phy_consume_power_handler(
563 struct scic_sds_phy *this_phy); 501 struct isci_phy *iphy);
564 502
565void scic_sds_phy_get_sas_address( 503void scic_sds_phy_get_sas_address(
566 struct scic_sds_phy *this_phy, 504 struct isci_phy *iphy,
567 struct sci_sas_address *sas_address); 505 struct sci_sas_address *sas_address);
568 506
569void scic_sds_phy_get_attached_sas_address( 507void scic_sds_phy_get_attached_sas_address(
570 struct scic_sds_phy *this_phy, 508 struct isci_phy *iphy,
571 struct sci_sas_address *sas_address); 509 struct sci_sas_address *sas_address);
572 510
573struct scic_phy_proto; 511struct scic_phy_proto;
574void scic_sds_phy_get_protocols( 512void scic_sds_phy_get_protocols(
575 struct scic_sds_phy *sci_phy, 513 struct isci_phy *iphy,
576 struct scic_phy_proto *protocols); 514 struct scic_phy_proto *protocols);
577enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy); 515enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy);
578 516
579struct isci_host; 517struct isci_host;
580void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index); 518void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index);