aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-02-01 03:44:14 -0500
committerDan Williams <dan.j.williams@intel.com>2012-05-17 15:27:11 -0400
commitc79dd80d73017a88a2c2ae46e7d5303cba6a32e0 (patch)
tree4bf1f09df72921272e38bc0c9610374d4c1873e2 /drivers/scsi/isci
parent11cc51835af0e6fbb2da9cb012bdaaa036497b7f (diff)
isci: kill sci_phy_protocol and sci_request_protocol
Holdovers from the initial driver cleanup, replace with enum sas_protocol. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r--drivers/scsi/isci/host.c4
-rw-r--r--drivers/scsi/isci/phy.c12
-rw-r--r--drivers/scsi/isci/phy.h9
-rw-r--r--drivers/scsi/isci/port.c14
-rw-r--r--drivers/scsi/isci/request.c10
-rw-r--r--drivers/scsi/isci/request.h9
6 files changed, 21 insertions, 37 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 3822ffb71caf..83886a27e848 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -1911,7 +1911,7 @@ static void power_control_timeout(unsigned long data)
1911 ihost->power_control.phys_granted_power++; 1911 ihost->power_control.phys_granted_power++;
1912 sci_phy_consume_power_handler(iphy); 1912 sci_phy_consume_power_handler(iphy);
1913 1913
1914 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 1914 if (iphy->protocol == SAS_PROTOCOL_SSP) {
1915 u8 j; 1915 u8 j;
1916 1916
1917 for (j = 0; j < SCI_MAX_PHYS; j++) { 1917 for (j = 0; j < SCI_MAX_PHYS; j++) {
@@ -1985,7 +1985,7 @@ void sci_controller_power_control_queue_insert(struct isci_host *ihost,
1985 sizeof(current_phy->frame_rcvd.iaf.sas_addr)); 1985 sizeof(current_phy->frame_rcvd.iaf.sas_addr));
1986 1986
1987 if (current_phy->sm.current_state_id == SCI_PHY_READY && 1987 if (current_phy->sm.current_state_id == SCI_PHY_READY &&
1988 current_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS && 1988 current_phy->protocol == SAS_PROTOCOL_SSP &&
1989 other == 0) { 1989 other == 0) {
1990 sci_phy_consume_power_handler(iphy); 1990 sci_phy_consume_power_handler(iphy);
1991 break; 1991 break;
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c
index fab3586840b5..c685ab04532f 100644
--- a/drivers/scsi/isci/phy.c
+++ b/drivers/scsi/isci/phy.c
@@ -580,7 +580,7 @@ static void sci_phy_start_sas_link_training(struct isci_phy *iphy)
580 580
581 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); 581 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN);
582 582
583 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS; 583 iphy->protocol = SAS_PROTOCOL_SSP;
584} 584}
585 585
586static void sci_phy_start_sata_link_training(struct isci_phy *iphy) 586static void sci_phy_start_sata_link_training(struct isci_phy *iphy)
@@ -591,7 +591,7 @@ static void sci_phy_start_sata_link_training(struct isci_phy *iphy)
591 */ 591 */
592 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); 592 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER);
593 593
594 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; 594 iphy->protocol = SAS_PROTOCOL_SATA;
595} 595}
596 596
597/** 597/**
@@ -797,7 +797,7 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
797 */ 797 */
798 break; 798 break;
799 case SCU_EVENT_SATA_PHY_DETECTED: 799 case SCU_EVENT_SATA_PHY_DETECTED:
800 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; 800 iphy->protocol = SAS_PROTOCOL_SATA;
801 801
802 /* We have received the SATA PHY notification change state */ 802 /* We have received the SATA PHY notification change state */
803 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); 803 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN);
@@ -1215,7 +1215,7 @@ static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
1215 scu_link_layer_start_oob(iphy); 1215 scu_link_layer_start_oob(iphy);
1216 1216
1217 /* We don't know what kind of phy we are going to be just yet */ 1217 /* We don't know what kind of phy we are going to be just yet */
1218 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; 1218 iphy->protocol = SAS_PROTOCOL_NONE;
1219 iphy->bcn_received_while_port_unassigned = false; 1219 iphy->bcn_received_while_port_unassigned = false;
1220 1220
1221 if (iphy->sm.previous_state_id == SCI_PHY_READY) 1221 if (iphy->sm.previous_state_id == SCI_PHY_READY)
@@ -1250,7 +1250,7 @@ static void sci_phy_resetting_state_enter(struct sci_base_state_machine *sm)
1250 */ 1250 */
1251 sci_port_deactivate_phy(iphy->owning_port, iphy, false); 1251 sci_port_deactivate_phy(iphy->owning_port, iphy, false);
1252 1252
1253 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 1253 if (iphy->protocol == SAS_PROTOCOL_SSP) {
1254 scu_link_layer_tx_hard_reset(iphy); 1254 scu_link_layer_tx_hard_reset(iphy);
1255 } else { 1255 } else {
1256 /* The SCU does not need to have a discrete reset state so 1256 /* The SCU does not need to have a discrete reset state so
@@ -1316,7 +1316,7 @@ void sci_phy_construct(struct isci_phy *iphy,
1316 iphy->owning_port = iport; 1316 iphy->owning_port = iport;
1317 iphy->phy_index = phy_index; 1317 iphy->phy_index = phy_index;
1318 iphy->bcn_received_while_port_unassigned = false; 1318 iphy->bcn_received_while_port_unassigned = false;
1319 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; 1319 iphy->protocol = SAS_PROTOCOL_NONE;
1320 iphy->link_layer_registers = NULL; 1320 iphy->link_layer_registers = NULL;
1321 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; 1321 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
1322 1322
diff --git a/drivers/scsi/isci/phy.h b/drivers/scsi/isci/phy.h
index 0e45833ba06d..45fecfa36a98 100644
--- a/drivers/scsi/isci/phy.h
+++ b/drivers/scsi/isci/phy.h
@@ -76,13 +76,6 @@
76 */ 76 */
77#define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250 77#define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250
78 78
79enum sci_phy_protocol {
80 SCIC_SDS_PHY_PROTOCOL_UNKNOWN,
81 SCIC_SDS_PHY_PROTOCOL_SAS,
82 SCIC_SDS_PHY_PROTOCOL_SATA,
83 SCIC_SDS_MAX_PHY_PROTOCOLS
84};
85
86/** 79/**
87 * isci_phy - hba local phy infrastructure 80 * isci_phy - hba local phy infrastructure
88 * @sm: 81 * @sm:
@@ -95,7 +88,7 @@ struct isci_phy {
95 struct sci_base_state_machine sm; 88 struct sci_base_state_machine sm;
96 struct isci_port *owning_port; 89 struct isci_port *owning_port;
97 enum sas_linkrate max_negotiated_speed; 90 enum sas_linkrate max_negotiated_speed;
98 enum sci_phy_protocol protocol; 91 enum sas_protocol protocol;
99 u8 phy_index; 92 u8 phy_index;
100 bool bcn_received_while_port_unassigned; 93 bool bcn_received_while_port_unassigned;
101 bool is_in_link_training; 94 bool is_in_link_training;
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 5fada73b71ff..923579fa0292 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -184,7 +184,7 @@ static void isci_port_link_up(struct isci_host *isci_host,
184 184
185 sci_port_get_properties(iport, &properties); 185 sci_port_get_properties(iport, &properties);
186 186
187 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) { 187 if (iphy->protocol == SAS_PROTOCOL_SATA) {
188 u64 attached_sas_address; 188 u64 attached_sas_address;
189 189
190 iphy->sas_phy.oob_mode = SATA_OOB_MODE; 190 iphy->sas_phy.oob_mode = SATA_OOB_MODE;
@@ -204,7 +204,7 @@ static void isci_port_link_up(struct isci_host *isci_host,
204 204
205 memcpy(&iphy->sas_phy.attached_sas_addr, 205 memcpy(&iphy->sas_phy.attached_sas_addr,
206 &attached_sas_address, sizeof(attached_sas_address)); 206 &attached_sas_address, sizeof(attached_sas_address));
207 } else if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 207 } else if (iphy->protocol == SAS_PROTOCOL_SSP) {
208 iphy->sas_phy.oob_mode = SAS_OOB_MODE; 208 iphy->sas_phy.oob_mode = SAS_OOB_MODE;
209 iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame); 209 iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame);
210 210
@@ -517,7 +517,7 @@ void sci_port_get_attached_sas_address(struct isci_port *iport, struct sci_sas_a
517 */ 517 */
518 iphy = sci_port_get_a_connected_phy(iport); 518 iphy = sci_port_get_a_connected_phy(iport);
519 if (iphy) { 519 if (iphy) {
520 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) { 520 if (iphy->protocol != SAS_PROTOCOL_SATA) {
521 sci_phy_get_attached_sas_address(iphy, sas); 521 sci_phy_get_attached_sas_address(iphy, sas);
522 } else { 522 } else {
523 sci_phy_get_sas_address(iphy, sas); 523 sci_phy_get_sas_address(iphy, sas);
@@ -624,7 +624,7 @@ static void sci_port_activate_phy(struct isci_port *iport,
624{ 624{
625 struct isci_host *ihost = iport->owning_controller; 625 struct isci_host *ihost = iport->owning_controller;
626 626
627 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA && (flags & PF_RESUME)) 627 if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME))
628 sci_phy_resume(iphy); 628 sci_phy_resume(iphy);
629 629
630 iport->active_phy_mask |= 1 << iphy->phy_index; 630 iport->active_phy_mask |= 1 << iphy->phy_index;
@@ -751,12 +751,10 @@ static bool sci_port_is_wide(struct isci_port *iport)
751 * wide ports and direct attached phys. Since there are no wide ported SATA 751 * wide ports and direct attached phys. Since there are no wide ported SATA
752 * devices this could become an invalid port configuration. 752 * devices this could become an invalid port configuration.
753 */ 753 */
754bool sci_port_link_detected( 754bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy)
755 struct isci_port *iport,
756 struct isci_phy *iphy)
757{ 755{
758 if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) && 756 if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) &&
759 (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA)) { 757 (iphy->protocol == SAS_PROTOCOL_SATA)) {
760 if (sci_port_is_wide(iport)) { 758 if (sci_port_is_wide(iport)) {
761 sci_port_invalid_link_up(iport, iphy); 759 sci_port_invalid_link_up(iport, iphy);
762 return false; 760 return false;
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 01844ef19656..835ede848871 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -730,7 +730,7 @@ static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *i
730{ 730{
731 struct sas_task *task = isci_request_access_task(ireq); 731 struct sas_task *task = isci_request_access_task(ireq);
732 732
733 ireq->protocol = SCIC_SSP_PROTOCOL; 733 ireq->protocol = SAS_PROTOCOL_SSP;
734 734
735 scu_ssp_io_request_construct_task_context(ireq, 735 scu_ssp_io_request_construct_task_context(ireq,
736 task->data_dir, 736 task->data_dir,
@@ -763,7 +763,7 @@ static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *
763 bool copy = false; 763 bool copy = false;
764 struct sas_task *task = isci_request_access_task(ireq); 764 struct sas_task *task = isci_request_access_task(ireq);
765 765
766 ireq->protocol = SCIC_STP_PROTOCOL; 766 ireq->protocol = SAS_PROTOCOL_STP;
767 767
768 copy = (task->data_dir == DMA_NONE) ? false : true; 768 copy = (task->data_dir == DMA_NONE) ? false : true;
769 769
@@ -1070,7 +1070,7 @@ request_started_state_tc_event(struct isci_request *ireq,
1070 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS): 1070 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS):
1071 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR): 1071 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR):
1072 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR): 1072 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR):
1073 if (ireq->protocol == SCIC_STP_PROTOCOL) { 1073 if (ireq->protocol == SAS_PROTOCOL_STP) {
1074 ireq->scu_status = SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 1074 ireq->scu_status = SCU_GET_COMPLETION_TL_STATUS(completion_code) >>
1075 SCU_COMPLETION_TL_STATUS_SHIFT; 1075 SCU_COMPLETION_TL_STATUS_SHIFT;
1076 ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; 1076 ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
@@ -3169,7 +3169,7 @@ sci_general_request_construct(struct isci_host *ihost,
3169 sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT); 3169 sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT);
3170 3170
3171 ireq->target_device = idev; 3171 ireq->target_device = idev;
3172 ireq->protocol = SCIC_NO_PROTOCOL; 3172 ireq->protocol = SAS_PROTOCOL_NONE;
3173 ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX; 3173 ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX;
3174 3174
3175 ireq->sci_status = SCI_SUCCESS; 3175 ireq->sci_status = SCI_SUCCESS;
@@ -3310,7 +3310,7 @@ sci_io_request_construct_smp(struct device *dev,
3310 if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE)) 3310 if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE))
3311 return SCI_FAILURE; 3311 return SCI_FAILURE;
3312 3312
3313 ireq->protocol = SCIC_SMP_PROTOCOL; 3313 ireq->protocol = SAS_PROTOCOL_SMP;
3314 3314
3315 /* byte swap the smp request. */ 3315 /* byte swap the smp request. */
3316 3316
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h
index 057f2378452d..4961f9fbf70f 100644
--- a/drivers/scsi/isci/request.h
+++ b/drivers/scsi/isci/request.h
@@ -77,13 +77,6 @@ enum isci_request_status {
77 dead = 0x07 77 dead = 0x07
78}; 78};
79 79
80enum sci_request_protocol {
81 SCIC_NO_PROTOCOL,
82 SCIC_SMP_PROTOCOL,
83 SCIC_SSP_PROTOCOL,
84 SCIC_STP_PROTOCOL
85}; /* XXX remove me, use sas_task.{dev|task_proto} instead */;
86
87/** 80/**
88 * isci_stp_request - extra request infrastructure to handle pio/atapi protocol 81 * isci_stp_request - extra request infrastructure to handle pio/atapi protocol
89 * @pio_len - number of bytes requested at PIO setup 82 * @pio_len - number of bytes requested at PIO setup
@@ -140,7 +133,7 @@ struct isci_request {
140 struct isci_host *owning_controller; 133 struct isci_host *owning_controller;
141 struct isci_remote_device *target_device; 134 struct isci_remote_device *target_device;
142 u16 io_tag; 135 u16 io_tag;
143 enum sci_request_protocol protocol; 136 enum sas_protocol protocol;
144 u32 scu_status; /* hardware result */ 137 u32 scu_status; /* hardware result */
145 u32 sci_status; /* upper layer disposition */ 138 u32 sci_status; /* upper layer disposition */
146 u32 post_context; 139 u32 post_context;