Skip to content

Commit

Permalink
isci: kill sci_phy_protocol and sci_request_protocol
Browse files Browse the repository at this point in the history
Holdovers from the initial driver cleanup, replace with enum sas_protocol.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed May 17, 2012
1 parent 11cc518 commit c79dd80
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 37 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/isci/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ static void power_control_timeout(unsigned long data)
ihost->power_control.phys_granted_power++;
sci_phy_consume_power_handler(iphy);

if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) {
if (iphy->protocol == SAS_PROTOCOL_SSP) {
u8 j;

for (j = 0; j < SCI_MAX_PHYS; j++) {
Expand Down Expand Up @@ -1985,7 +1985,7 @@ void sci_controller_power_control_queue_insert(struct isci_host *ihost,
sizeof(current_phy->frame_rcvd.iaf.sas_addr));

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) {
sci_phy_consume_power_handler(iphy);
break;
Expand Down
12 changes: 6 additions & 6 deletions drivers/scsi/isci/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS;
iphy->protocol = SAS_PROTOCOL_SSP;
}

static void sci_phy_start_sata_link_training(struct isci_phy *iphy)
Expand All @@ -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);

iphy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA;
iphy->protocol = SAS_PROTOCOL_SATA;
}

/**
Expand Down Expand Up @@ -797,7 +797,7 @@ enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code)
*/
break;
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 */
sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN);
Expand Down Expand Up @@ -1215,7 +1215,7 @@ static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
scu_link_layer_start_oob(iphy);

/* 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;

if (iphy->sm.previous_state_id == SCI_PHY_READY)
Expand Down Expand Up @@ -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);

if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) {
if (iphy->protocol == SAS_PROTOCOL_SSP) {
scu_link_layer_tx_hard_reset(iphy);
} else {
/* The SCU does not need to have a discrete reset state so
Expand Down Expand Up @@ -1316,7 +1316,7 @@ void sci_phy_construct(struct isci_phy *iphy,
iphy->owning_port = iport;
iphy->phy_index = phy_index;
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->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;

Expand Down
9 changes: 1 addition & 8 deletions drivers/scsi/isci/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@
*/
#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
* @sm:
Expand All @@ -95,7 +88,7 @@ struct isci_phy {
struct sci_base_state_machine sm;
struct isci_port *owning_port;
enum sas_linkrate max_negotiated_speed;
enum sci_phy_protocol protocol;
enum sas_protocol protocol;
u8 phy_index;
bool bcn_received_while_port_unassigned;
bool is_in_link_training;
Expand Down
14 changes: 6 additions & 8 deletions drivers/scsi/isci/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void isci_port_link_up(struct isci_host *isci_host,

sci_port_get_properties(iport, &properties);

if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) {
if (iphy->protocol == SAS_PROTOCOL_SATA) {
u64 attached_sas_address;

iphy->sas_phy.oob_mode = SATA_OOB_MODE;
Expand All @@ -204,7 +204,7 @@ static void isci_port_link_up(struct isci_host *isci_host,

memcpy(&iphy->sas_phy.attached_sas_addr,
&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.frame_rcvd_size = sizeof(struct sas_identify_frame);

Expand Down Expand Up @@ -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);
if (iphy) {
if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) {
if (iphy->protocol != SAS_PROTOCOL_SATA) {
sci_phy_get_attached_sas_address(iphy, sas);
} else {
sci_phy_get_sas_address(iphy, sas);
Expand Down Expand Up @@ -624,7 +624,7 @@ static void sci_port_activate_phy(struct isci_port *iport,
{
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);

iport->active_phy_mask |= 1 << iphy->phy_index;
Expand Down Expand Up @@ -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
* devices this could become an invalid port configuration.
*/
bool sci_port_link_detected(
struct isci_port *iport,
struct isci_phy *iphy)
bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy)
{
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)) {
sci_port_invalid_link_up(iport, iphy);
return false;
Expand Down
10 changes: 5 additions & 5 deletions drivers/scsi/isci/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

ireq->protocol = SCIC_SSP_PROTOCOL;
ireq->protocol = SAS_PROTOCOL_SSP;

scu_ssp_io_request_construct_task_context(ireq,
task->data_dir,
Expand Down Expand Up @@ -763,7 +763,7 @@ static enum sci_status sci_io_request_construct_basic_sata(struct isci_request *
bool copy = false;
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;

Expand Down Expand Up @@ -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_REG_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) >>
SCU_COMPLETION_TL_STATUS_SHIFT;
ireq->sci_status = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
Expand Down Expand Up @@ -3169,7 +3169,7 @@ sci_general_request_construct(struct isci_host *ihost,
sci_init_sm(&ireq->sm, sci_request_state_table, SCI_REQ_INIT);

ireq->target_device = idev;
ireq->protocol = SCIC_NO_PROTOCOL;
ireq->protocol = SAS_PROTOCOL_NONE;
ireq->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX;

ireq->sci_status = SCI_SUCCESS;
Expand Down Expand Up @@ -3310,7 +3310,7 @@ sci_io_request_construct_smp(struct device *dev,
if (!dma_map_sg(dev, sg, 1, DMA_TO_DEVICE))
return SCI_FAILURE;

ireq->protocol = SCIC_SMP_PROTOCOL;
ireq->protocol = SAS_PROTOCOL_SMP;

/* byte swap the smp request. */

Expand Down
9 changes: 1 addition & 8 deletions drivers/scsi/isci/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ enum isci_request_status {
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
* @pio_len - number of bytes requested at PIO setup
Expand Down Expand Up @@ -140,7 +133,7 @@ struct isci_request {
struct isci_host *owning_controller;
struct isci_remote_device *target_device;
u16 io_tag;
enum sci_request_protocol protocol;
enum sas_protocol protocol;
u32 scu_status; /* hardware result */
u32 sci_status; /* upper layer disposition */
u32 post_context;
Expand Down
1 change: 1 addition & 0 deletions include/scsi/sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ enum sas_dev_type {
};

enum sas_protocol {
SAS_PROTOCOL_NONE = 0,
SAS_PROTOCOL_SATA = 0x01,
SAS_PROTOCOL_SMP = 0x02,
SAS_PROTOCOL_STP = 0x04,
Expand Down

0 comments on commit c79dd80

Please sign in to comment.