aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/phy.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-30 20:38:32 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:52 -0400
commitd9dcb4ba791de2a06b19ac47cd61601cf3d4e208 (patch)
tree4b818b5b14c078703c034489c92e74975be6c06f /drivers/scsi/isci/phy.c
parent78a6f06e0e82125787d7aa308fe28c2c8381540c (diff)
isci: unify isci_host and scic_sds_controller
Remove the distinction between these two implementations and unify on isci_host (local instances named ihost). Hmmm, we had two 'oem_parameters' instances, one was unused... nice. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/phy.c')
-rw-r--r--drivers/scsi/isci/phy.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c
index fd0e9734e5d0..ca96b5ad0d52 100644
--- a/drivers/scsi/isci/phy.c
+++ b/drivers/scsi/isci/phy.c
@@ -112,13 +112,13 @@ static enum sci_status
112scic_sds_phy_link_layer_initialization(struct isci_phy *iphy, 112scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
113 struct scu_link_layer_registers __iomem *link_layer_registers) 113 struct scu_link_layer_registers __iomem *link_layer_registers)
114{ 114{
115 struct scic_sds_controller *scic = 115 struct isci_host *ihost =
116 iphy->owning_port->owning_controller; 116 iphy->owning_port->owning_controller;
117 int phy_idx = iphy->phy_index; 117 int phy_idx = iphy->phy_index;
118 struct sci_phy_user_params *phy_user = 118 struct sci_phy_user_params *phy_user =
119 &scic->user_parameters.sds1.phys[phy_idx]; 119 &ihost->user_parameters.sds1.phys[phy_idx];
120 struct sci_phy_oem_params *phy_oem = 120 struct sci_phy_oem_params *phy_oem =
121 &scic->oem_parameters.sds1.phys[phy_idx]; 121 &ihost->oem_parameters.sds1.phys[phy_idx];
122 u32 phy_configuration; 122 u32 phy_configuration;
123 struct scic_phy_cap phy_cap; 123 struct scic_phy_cap phy_cap;
124 u32 parity_check = 0; 124 u32 parity_check = 0;
@@ -169,7 +169,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
169 phy_cap.gen3_no_ssc = 1; 169 phy_cap.gen3_no_ssc = 1;
170 phy_cap.gen2_no_ssc = 1; 170 phy_cap.gen2_no_ssc = 1;
171 phy_cap.gen1_no_ssc = 1; 171 phy_cap.gen1_no_ssc = 1;
172 if (scic->oem_parameters.sds1.controller.do_enable_ssc == true) { 172 if (ihost->oem_parameters.sds1.controller.do_enable_ssc == true) {
173 phy_cap.gen3_ssc = 1; 173 phy_cap.gen3_ssc = 1;
174 phy_cap.gen2_ssc = 1; 174 phy_cap.gen2_ssc = 1;
175 phy_cap.gen1_ssc = 1; 175 phy_cap.gen1_ssc = 1;
@@ -216,7 +216,7 @@ scic_sds_phy_link_layer_initialization(struct isci_phy *iphy,
216 &iphy->link_layer_registers->afe_lookup_table_control); 216 &iphy->link_layer_registers->afe_lookup_table_control);
217 217
218 llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT, 218 llctl = SCU_SAS_LLCTL_GEN_VAL(NO_OUTBOUND_TASK_TIMEOUT,
219 (u8)scic->user_parameters.sds1.no_outbound_task_timeout); 219 (u8)ihost->user_parameters.sds1.no_outbound_task_timeout);
220 220
221 switch(phy_user->max_speed_generation) { 221 switch(phy_user->max_speed_generation) {
222 case SCIC_SDS_PARM_GEN3_SPEED: 222 case SCIC_SDS_PARM_GEN3_SPEED:
@@ -255,7 +255,7 @@ static void phy_sata_timeout(unsigned long data)
255{ 255{
256 struct sci_timer *tmr = (struct sci_timer *)data; 256 struct sci_timer *tmr = (struct sci_timer *)data;
257 struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer); 257 struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer);
258 struct isci_host *ihost = scic_to_ihost(iphy->owning_port->owning_controller); 258 struct isci_host *ihost = iphy->owning_port->owning_controller;
259 unsigned long flags; 259 unsigned long flags;
260 260
261 spin_lock_irqsave(&ihost->scic_lock, flags); 261 spin_lock_irqsave(&ihost->scic_lock, flags);
@@ -890,7 +890,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
890 u32 frame_index) 890 u32 frame_index)
891{ 891{
892 enum scic_sds_phy_states state = iphy->sm.current_state_id; 892 enum scic_sds_phy_states state = iphy->sm.current_state_id;
893 struct scic_sds_controller *scic = iphy->owning_port->owning_controller; 893 struct isci_host *ihost = iphy->owning_port->owning_controller;
894 enum sci_status result; 894 enum sci_status result;
895 unsigned long flags; 895 unsigned long flags;
896 896
@@ -899,7 +899,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
899 u32 *frame_words; 899 u32 *frame_words;
900 struct sas_identify_frame iaf; 900 struct sas_identify_frame iaf;
901 901
902 result = scic_sds_unsolicited_frame_control_get_header(&scic->uf_control, 902 result = scic_sds_unsolicited_frame_control_get_header(&ihost->uf_control,
903 frame_index, 903 frame_index,
904 (void **)&frame_words); 904 (void **)&frame_words);
905 905
@@ -933,7 +933,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
933 "unexpected frame id %x\n", 933 "unexpected frame id %x\n",
934 __func__, frame_index); 934 __func__, frame_index);
935 935
936 scic_sds_controller_release_frame(scic, frame_index); 936 scic_sds_controller_release_frame(ihost, frame_index);
937 return result; 937 return result;
938 } 938 }
939 case SCI_PHY_SUB_AWAIT_SIG_FIS_UF: { 939 case SCI_PHY_SUB_AWAIT_SIG_FIS_UF: {
@@ -950,7 +950,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
950 950
951 if ((frame_header->fis_type == FIS_REGD2H) && 951 if ((frame_header->fis_type == FIS_REGD2H) &&
952 !(frame_header->status & ATA_BUSY)) { 952 !(frame_header->status & ATA_BUSY)) {
953 scic_sds_unsolicited_frame_control_get_buffer(&scic->uf_control, 953 scic_sds_unsolicited_frame_control_get_buffer(&ihost->uf_control,
954 frame_index, 954 frame_index,
955 (void **)&fis_frame_data); 955 (void **)&fis_frame_data);
956 956
@@ -971,7 +971,7 @@ enum sci_status scic_sds_phy_frame_handler(struct isci_phy *iphy,
971 __func__, frame_index); 971 __func__, frame_index);
972 972
973 /* Regardless of the result we are done with this frame with it */ 973 /* Regardless of the result we are done with this frame with it */
974 scic_sds_controller_release_frame(scic, frame_index); 974 scic_sds_controller_release_frame(ihost, frame_index);
975 975
976 return result; 976 return result;
977 } 977 }
@@ -994,33 +994,33 @@ static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_state_m
994static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm) 994static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm)
995{ 995{
996 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 996 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
997 struct scic_sds_controller *scic = iphy->owning_port->owning_controller; 997 struct isci_host *ihost = iphy->owning_port->owning_controller;
998 998
999 scic_sds_controller_power_control_queue_insert(scic, iphy); 999 scic_sds_controller_power_control_queue_insert(ihost, iphy);
1000} 1000}
1001 1001
1002static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm) 1002static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm)
1003{ 1003{
1004 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1004 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1005 struct scic_sds_controller *scic = iphy->owning_port->owning_controller; 1005 struct isci_host *ihost = iphy->owning_port->owning_controller;
1006 1006
1007 scic_sds_controller_power_control_queue_remove(scic, iphy); 1007 scic_sds_controller_power_control_queue_remove(ihost, iphy);
1008} 1008}
1009 1009
1010static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm) 1010static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm)
1011{ 1011{
1012 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1012 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1013 struct scic_sds_controller *scic = iphy->owning_port->owning_controller; 1013 struct isci_host *ihost = iphy->owning_port->owning_controller;
1014 1014
1015 scic_sds_controller_power_control_queue_insert(scic, iphy); 1015 scic_sds_controller_power_control_queue_insert(ihost, iphy);
1016} 1016}
1017 1017
1018static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm) 1018static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm)
1019{ 1019{
1020 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); 1020 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
1021 struct scic_sds_controller *scic = iphy->owning_port->owning_controller; 1021 struct isci_host *ihost = iphy->owning_port->owning_controller;
1022 1022
1023 scic_sds_controller_power_control_queue_remove(scic, iphy); 1023 scic_sds_controller_power_control_queue_remove(ihost, iphy);
1024} 1024}
1025 1025
1026static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm) 1026static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm)
@@ -1313,7 +1313,7 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index)
1313 u64 sci_sas_addr; 1313 u64 sci_sas_addr;
1314 __be64 sas_addr; 1314 __be64 sas_addr;
1315 1315
1316 scic_oem_parameters_get(&ihost->sci, &oem); 1316 scic_oem_parameters_get(ihost, &oem);
1317 sci_sas_addr = oem.sds1.phys[index].sas_address.high; 1317 sci_sas_addr = oem.sds1.phys[index].sas_address.high;
1318 sci_sas_addr <<= 32; 1318 sci_sas_addr <<= 32;
1319 sci_sas_addr |= oem.sds1.phys[index].sas_address.low; 1319 sci_sas_addr |= oem.sds1.phys[index].sas_address.low;