Commit c79dd80d authored by Dan Williams's avatar Dan Williams

isci: kill sci_phy_protocol and sci_request_protocol

Holdovers from the initial driver cleanup, replace with enum sas_protocol.
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 11cc5183
...@@ -1911,7 +1911,7 @@ static void power_control_timeout(unsigned long data) ...@@ -1911,7 +1911,7 @@ static void power_control_timeout(unsigned long data)
ihost->power_control.phys_granted_power++; ihost->power_control.phys_granted_power++;
sci_phy_consume_power_handler(iphy); sci_phy_consume_power_handler(iphy);
if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { if (iphy->protocol == SAS_PROTOCOL_SSP) {
u8 j; u8 j;
for (j = 0; j < SCI_MAX_PHYS; j++) { for (j = 0; j < SCI_MAX_PHYS; j++) {
...@@ -1985,7 +1985,7 @@ void sci_controller_power_control_queue_insert(struct isci_host *ihost, ...@@ -1985,7 +1985,7 @@ void sci_controller_power_control_queue_insert(struct isci_host *ihost,
sizeof(current_phy->frame_rcvd.iaf.sas_addr)); sizeof(current_phy->frame_rcvd.iaf.sas_addr));
if (current_phy->sm.current_state_id == SCI_PHY_READY && if (current_phy->sm.current_state_id == SCI_PHY_READY &&
current_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS && current_phy->protocol == SAS_PROTOCOL_SSP &&
other == 0) { other == 0) {
sci_phy_consume_power_handler(iphy); sci_phy_consume_power_handler(iphy);
break; break;
......
...@@ -580,7 +580,7 @@ static void sci_phy_start_sas_link_training(struct isci_phy *iphy) ...@@ -580,7 +580,7 @@ static void sci_phy_start_sas_link_training(struct isci_phy *iphy)
sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN);
iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS; iphy->protocol = SAS_PROTOCOL_SSP;
} }
static void sci_phy_start_sata_link_training(struct isci_phy *iphy) static 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,7 +591,7 @@ static void sci_phy_start_sata_link_training(struct isci_phy *iphy)
*/ */
sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER);
iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; iphy->protocol = SAS_PROTOCOL_SATA;
} }
/** /**
...@@ -797,7 +797,7 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code) ...@@ -797,7 +797,7 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
*/ */
break; break;
case SCU_EVENT_SATA_PHY_DETECTED: case SCU_EVENT_SATA_PHY_DETECTED:
iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; iphy->protocol = SAS_PROTOCOL_SATA;
/* We have received the SATA PHY notification change state */ /* We have received the SATA PHY notification change state */
sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); 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,7 +1215,7 @@ static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
scu_link_layer_start_oob(iphy); scu_link_layer_start_oob(iphy);
/* We don't know what kind of phy we are going to be just yet */ /* We don't know what kind of phy we are going to be just yet */
iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; iphy->protocol = SAS_PROTOCOL_NONE;
iphy->bcn_received_while_port_unassigned = false; iphy->bcn_received_while_port_unassigned = false;
if (iphy->sm.previous_state_id == SCI_PHY_READY) 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,7 +1250,7 @@ static void sci_phy_resetting_state_enter(struct sci_base_state_machine *sm)
*/ */
sci_port_deactivate_phy(iphy->owning_port, iphy, false); sci_port_deactivate_phy(iphy->owning_port, iphy, false);
if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { if (iphy->protocol == SAS_PROTOCOL_SSP) {
scu_link_layer_tx_hard_reset(iphy); scu_link_layer_tx_hard_reset(iphy);
} else { } else {
/* The SCU does not need to have a discrete reset state so /* 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,7 +1316,7 @@ void sci_phy_construct(struct isci_phy *iphy,
iphy->owning_port = iport; iphy->owning_port = iport;
iphy->phy_index = phy_index; iphy->phy_index = phy_index;
iphy->bcn_received_while_port_unassigned = false; iphy->bcn_received_while_port_unassigned = false;
iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; iphy->protocol = SAS_PROTOCOL_NONE;
iphy->link_layer_registers = NULL; iphy->link_layer_registers = NULL;
iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
......
...@@ -76,13 +76,6 @@ ...@@ -76,13 +76,6 @@
*/ */
#define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250 #define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250
enum sci_phy_protocol {
SCIC_SDS_PHY_PROTOCOL_UNKNOWN,
SCIC_SDS_PHY_PROTOCOL_SAS,
SCIC_SDS_PHY_PROTOCOL_SATA,
SCIC_SDS_MAX_PHY_PROTOCOLS
};
/** /**
* isci_phy - hba local phy infrastructure * isci_phy - hba local phy infrastructure
* @sm: * @sm:
...@@ -95,7 +88,7 @@ struct isci_phy { ...@@ -95,7 +88,7 @@ struct isci_phy {
struct sci_base_state_machine sm; struct sci_base_state_machine sm;
struct isci_port *owning_port; struct isci_port *owning_port;
enum sas_linkrate max_negotiated_speed; enum sas_linkrate max_negotiated_speed;
enum sci_phy_protocol protocol; enum sas_protocol protocol;
u8 phy_index; u8 phy_index;
bool bcn_received_while_port_unassigned; bool bcn_received_while_port_unassigned;
bool is_in_link_training; bool is_in_link_training;
......
...@@ -184,7 +184,7 @@ static void isci_port_link_up(struct isci_host *isci_host, ...@@ -184,7 +184,7 @@ static void isci_port_link_up(struct isci_host *isci_host,
sci_port_get_properties(iport, &properties); sci_port_get_properties(iport, &properties);
if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) { if (iphy->protocol == SAS_PROTOCOL_SATA) {
u64 attached_sas_address; u64 attached_sas_address;
iphy->sas_phy.oob_mode = SATA_OOB_MODE; iphy->sas_phy.oob_mode = SATA_OOB_MODE;
...@@ -204,7 +204,7 @@ static void isci_port_link_up(struct isci_host *isci_host, ...@@ -204,7 +204,7 @@ static void isci_port_link_up(struct isci_host *isci_host,
memcpy(&iphy->sas_phy.attached_sas_addr, memcpy(&iphy->sas_phy.attached_sas_addr,
&attached_sas_address, sizeof(attached_sas_address)); &attached_sas_address, sizeof(attached_sas_address));
} else if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { } else if (iphy->protocol == SAS_PROTOCOL_SSP) {
iphy->sas_phy.oob_mode = SAS_OOB_MODE; iphy->sas_phy.oob_mode = SAS_OOB_MODE;
iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame); iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame);
...@@ -517,7 +517,7 @@ void sci_port_get_attached_sas_address(struct isci_port *iport, struct sci_sas_a ...@@ -517,7 +517,7 @@ void sci_port_get_attached_sas_address(struct isci_port *iport, struct sci_sas_a
*/ */
iphy = sci_port_get_a_connected_phy(iport); iphy = sci_port_get_a_connected_phy(iport);
if (iphy) { if (iphy) {
if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) { if (iphy->protocol != SAS_PROTOCOL_SATA) {
sci_phy_get_attached_sas_address(iphy, sas); sci_phy_get_attached_sas_address(iphy, sas);
} else { } else {
sci_phy_get_sas_address(iphy, sas); sci_phy_get_sas_address(iphy, sas);
...@@ -624,7 +624,7 @@ static void sci_port_activate_phy(struct isci_port *iport, ...@@ -624,7 +624,7 @@ static void sci_port_activate_phy(struct isci_port *iport,
{ {
struct isci_host *ihost = iport->owning_controller; struct isci_host *ihost = iport->owning_controller;
if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA && (flags & PF_RESUME)) if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME))
sci_phy_resume(iphy); sci_phy_resume(iphy);
iport->active_phy_mask |= 1 << iphy->phy_index; iport->active_phy_mask |= 1 << iphy->phy_index;
...@@ -751,12 +751,10 @@ static bool sci_port_is_wide(struct isci_port *iport) ...@@ -751,12 +751,10 @@ static bool sci_port_is_wide(struct isci_port *iport)
* wide ports and direct attached phys. Since there are no wide ported SATA * wide ports and direct attached phys. Since there are no wide ported SATA
* devices this could become an invalid port configuration. * devices this could become an invalid port configuration.
*/ */
bool sci_port_link_detected( bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy)
struct isci_port *iport,
struct isci_phy *iphy)
{ {
if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) && if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) &&
(iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA)) { (iphy->protocol == SAS_PROTOCOL_SATA)) {
if (sci_port_is_wide(iport)) { if (sci_port_is_wide(iport)) {
sci_port_invalid_link_up(iport, iphy); sci_port_invalid_link_up(iport, iphy);
return false; return false;
......
...@@ -730,7 +730,7 @@ static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *i ...@@ -730,7 +730,7 @@ static enum sci_status sci_io_request_construct_basic_ssp(struct isci_request *i
{ {
struct sas_task *task = isci_request_access_task(ireq); struct sas_task *task = isci_request_access_task(ireq);
ireq->protocol = SCIC_SSP_PROTOCOL; ireq->protocol = SAS_PROTOCOL_SSP;
scu_ssp_io_request_construct_task_context(ireq, scu_ssp_io_request_construct_task_context(ireq,
task->data_dir, task->data_dir,
...@@ -763,7 +763,7 @@ static enum sci_status sci_io_request_construct_basic_sata(struct isci_request * ...@@ -763,7 +763,7 @@ static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *
bool copy = false; bool copy = false;
struct sas_task *task = isci_request_access_task(ireq); struct sas_task *task = isci_request_access_task(ireq);
ireq->protocol = SCIC_STP_PROTOCOL; ireq->protocol = SAS_PROTOCOL_STP;
copy = (task->data_dir == DMA_NONE) ? false : true; copy = (task->data_dir == DMA_NONE) ? false : true;
...@@ -1070,7 +1070,7 @@ request_started_state_tc_event(struct isci_request *ireq, ...@@ -1070,7 +1070,7 @@ request_started_state_tc_event(struct isci_request *ireq,
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS): case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS):
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR): case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR):
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR): case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR):
if (ireq->protocol == SCIC_STP_PROTOCOL) { if (ireq->protocol == SAS_PROTOCOL_STP) {
ireq->scu_status = SCU_GET_COMPLETION_TL_STATUS(completion_code) >> ireq->scu_status = SCU_GET_COMPLETION_TL_STATUS(completion_code) >>
SCU_COMPLETION_TL_STATUS_SHIFT; SCU_COMPLETION_TL_STATUS_SHIFT;
ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
...@@ -3169,7 +3169,7 @@ sci_general_request_construct(struct isci_host *ihost, ...@@ -3169,7 +3169,7 @@ sci_general_request_construct(struct isci_host *ihost,
sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT); sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT);
ireq->target_device = idev; ireq->target_device = idev;
ireq->protocol = SCIC_NO_PROTOCOL; ireq->protocol = SAS_PROTOCOL_NONE;
ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX; ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX;
ireq->sci_status = SCI_SUCCESS; ireq->sci_status = SCI_SUCCESS;
...@@ -3310,7 +3310,7 @@ sci_io_request_construct_smp(struct device *dev, ...@@ -3310,7 +3310,7 @@ sci_io_request_construct_smp(struct device *dev,
if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE)) if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE))
return SCI_FAILURE; return SCI_FAILURE;
ireq->protocol = SCIC_SMP_PROTOCOL; ireq->protocol = SAS_PROTOCOL_SMP;
/* byte swap the smp request. */ /* byte swap the smp request. */
......
...@@ -77,13 +77,6 @@ enum isci_request_status { ...@@ -77,13 +77,6 @@ enum isci_request_status {
dead = 0x07 dead = 0x07
}; };
enum sci_request_protocol {
SCIC_NO_PROTOCOL,
SCIC_SMP_PROTOCOL,
SCIC_SSP_PROTOCOL,
SCIC_STP_PROTOCOL
}; /* XXX remove me, use sas_task.{dev|task_proto} instead */;
/** /**
* isci_stp_request - extra request infrastructure to handle pio/atapi protocol * isci_stp_request - extra request infrastructure to handle pio/atapi protocol
* @pio_len - number of bytes requested at PIO setup * @pio_len - number of bytes requested at PIO setup
...@@ -140,7 +133,7 @@ struct isci_request { ...@@ -140,7 +133,7 @@ struct isci_request {
struct isci_host *owning_controller; struct isci_host *owning_controller;
struct isci_remote_device *target_device; struct isci_remote_device *target_device;
u16 io_tag; u16 io_tag;
enum sci_request_protocol protocol; enum sas_protocol protocol;
u32 scu_status; /* hardware result */ u32 scu_status; /* hardware result */
u32 sci_status; /* upper layer disposition */ u32 sci_status; /* upper layer disposition */
u32 post_context; u32 post_context;
......
...@@ -103,6 +103,7 @@ enum sas_dev_type { ...@@ -103,6 +103,7 @@ enum sas_dev_type {
}; };
enum sas_protocol { enum sas_protocol {
SAS_PROTOCOL_NONE = 0,
SAS_PROTOCOL_SATA = 0x01, SAS_PROTOCOL_SATA = 0x01,
SAS_PROTOCOL_SMP = 0x02, SAS_PROTOCOL_SMP = 0x02,
SAS_PROTOCOL_STP = 0x04, SAS_PROTOCOL_STP = 0x04,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment