Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+22 -37
+2 -2
drivers/scsi/isci/host.c
··· 1911 1911 ihost->power_control.phys_granted_power++; 1912 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 1915 u8 j; 1916 1916 1917 1917 for (j = 0; j < SCI_MAX_PHYS; j++) { ··· 1985 1985 sizeof(current_phy->frame_rcvd.iaf.sas_addr)); 1986 1986 1987 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 1989 other == 0) { 1990 1990 sci_phy_consume_power_handler(iphy); 1991 1991 break;
+6 -6
drivers/scsi/isci/phy.c
··· 580 580 581 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 586 586 static void sci_phy_start_sata_link_training(struct isci_phy *iphy) ··· 591 591 */ 592 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 797 */ 798 798 break; 799 799 case SCU_EVENT_SATA_PHY_DETECTED: 800 - iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; 800 + iphy->protocol = SAS_PROTOCOL_SATA; 801 801 802 802 /* We have received the SATA PHY notification change state */ 803 803 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); ··· 1215 1215 scu_link_layer_start_oob(iphy); 1216 1216 1217 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 1219 iphy->bcn_received_while_port_unassigned = false; 1220 1220 1221 1221 if (iphy->sm.previous_state_id == SCI_PHY_READY) ··· 1250 1250 */ 1251 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 1254 scu_link_layer_tx_hard_reset(iphy); 1255 1255 } else { 1256 1256 /* The SCU does not need to have a discrete reset state so ··· 1316 1316 iphy->owning_port = iport; 1317 1317 iphy->phy_index = phy_index; 1318 1318 iphy->bcn_received_while_port_unassigned = false; 1319 - iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; 1319 + iphy->protocol = SAS_PROTOCOL_NONE; 1320 1320 iphy->link_layer_registers = NULL; 1321 1321 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; 1322 1322
+1 -8
drivers/scsi/isci/phy.h
··· 76 76 */ 77 77 #define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250 78 78 79 - enum 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 80 * isci_phy - hba local phy infrastructure 88 81 * @sm: ··· 88 95 struct sci_base_state_machine sm; 89 96 struct isci_port *owning_port; 90 97 enum sas_linkrate max_negotiated_speed; 91 - enum sci_phy_protocol protocol; 98 + enum sas_protocol protocol; 92 99 u8 phy_index; 93 100 bool bcn_received_while_port_unassigned; 94 101 bool is_in_link_training;
+6 -8
drivers/scsi/isci/port.c
··· 184 184 185 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 188 u64 attached_sas_address; 189 189 190 190 iphy->sas_phy.oob_mode = SATA_OOB_MODE; ··· 204 204 205 205 memcpy(&iphy->sas_phy.attached_sas_addr, 206 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 208 iphy->sas_phy.oob_mode = SAS_OOB_MODE; 209 209 iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame); 210 210 ··· 517 517 */ 518 518 iphy = sci_port_get_a_connected_phy(iport); 519 519 if (iphy) { 520 - if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) { 520 + if (iphy->protocol != SAS_PROTOCOL_SATA) { 521 521 sci_phy_get_attached_sas_address(iphy, sas); 522 522 } else { 523 523 sci_phy_get_sas_address(iphy, sas); ··· 624 624 { 625 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 628 sci_phy_resume(iphy); 629 629 630 630 iport->active_phy_mask |= 1 << iphy->phy_index; ··· 751 751 * wide ports and direct attached phys. Since there are no wide ported SATA 752 752 * devices this could become an invalid port configuration. 753 753 */ 754 - bool sci_port_link_detected( 755 - struct isci_port *iport, 756 - struct isci_phy *iphy) 754 + bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy) 757 755 { 758 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 758 if (sci_port_is_wide(iport)) { 761 759 sci_port_invalid_link_up(iport, iphy); 762 760 return false;
+5 -5
drivers/scsi/isci/request.c
··· 730 730 { 731 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 735 scu_ssp_io_request_construct_task_context(ireq, 736 736 task->data_dir, ··· 763 763 bool copy = false; 764 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 768 copy = (task->data_dir == DMA_NONE) ? false : true; 769 769 ··· 1070 1070 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS): 1071 1071 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR): 1072 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 1074 ireq->scu_status = SCU_GET_COMPLETION_TL_STATUS(completion_code) >> 1075 1075 SCU_COMPLETION_TL_STATUS_SHIFT; 1076 1076 ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; ··· 3169 3169 sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT); 3170 3170 3171 3171 ireq->target_device = idev; 3172 - ireq->protocol = SCIC_NO_PROTOCOL; 3172 + ireq->protocol = SAS_PROTOCOL_NONE; 3173 3173 ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX; 3174 3174 3175 3175 ireq->sci_status = SCI_SUCCESS; ··· 3310 3310 if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE)) 3311 3311 return SCI_FAILURE; 3312 3312 3313 - ireq->protocol = SCIC_SMP_PROTOCOL; 3313 + ireq->protocol = SAS_PROTOCOL_SMP; 3314 3314 3315 3315 /* byte swap the smp request. */ 3316 3316
+1 -8
drivers/scsi/isci/request.h
··· 77 77 dead = 0x07 78 78 }; 79 79 80 - enum 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 81 * isci_stp_request - extra request infrastructure to handle pio/atapi protocol 89 82 * @pio_len - number of bytes requested at PIO setup ··· 133 140 struct isci_host *owning_controller; 134 141 struct isci_remote_device *target_device; 135 142 u16 io_tag; 136 - enum sci_request_protocol protocol; 143 + enum sas_protocol protocol; 137 144 u32 scu_status; /* hardware result */ 138 145 u32 sci_status; /* upper layer disposition */ 139 146 u32 post_context;
+1
include/scsi/sas.h
··· 103 103 }; 104 104 105 105 enum sas_protocol { 106 + SAS_PROTOCOL_NONE = 0, 106 107 SAS_PROTOCOL_SATA = 0x01, 107 108 SAS_PROTOCOL_SMP = 0x02, 108 109 SAS_PROTOCOL_STP = 0x04,