Skip to content

Commit 26bace3

Browse files
committed
isci: replace sci_sas_link_rate with sas_linkrate
Drop duplicated enum definition. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent d857d9a commit 26bace3

9 files changed

Lines changed: 22 additions & 33 deletions

File tree

‎drivers/scsi/isci/core/intel_sas.h‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,6 @@ struct sas_capabilities {
179179

180180
};
181181

182-
/**
183-
* enum _SCI_SAS_LINK_RATE - This enumeration depicts the SAS specification
184-
* defined link speeds.
185-
*
186-
*
187-
*/
188-
enum sci_sas_link_rate {
189-
SCI_SAS_NO_LINK_RATE = 0,
190-
SCI_SATA_SPINUP_HOLD = 0x3,
191-
SCI_SAS_150_GB = 0x8,
192-
SCI_SAS_300_GB = 0x9,
193-
SCI_SAS_600_GB = 0xA
194-
};
195-
196182
/**
197183
* enum _SCI_SAS_TASK_ATTRIBUTE - This enumeration depicts the SAM/SAS
198184
* specification defined task attribute values for a command information

‎drivers/scsi/isci/core/scic_phy.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868

6969
#include "intel_sata.h"
7070
#include "intel_sas.h"
71+
#include <scsi/libsas.h>
7172

7273
struct scic_sds_phy;
7374
struct scic_sds_port;
@@ -93,7 +94,7 @@ struct scic_phy_properties {
9394
* This field specifies the link rate at which the phy is
9495
* currently operating.
9596
*/
96-
enum sci_sas_link_rate negotiated_link_rate;
97+
enum sas_linkrate negotiated_link_rate;
9798

9899
/**
99100
* This field indicates the protocols supported by the phy.

‎drivers/scsi/isci/core/scic_remote_device.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ enum sci_status scic_remote_device_reset_complete(
254254
*
255255
* Return the link rate at which we transfer for the supplied remote device.
256256
*/
257-
enum sci_sas_link_rate scic_remote_device_get_connection_rate(
257+
enum sas_linkrate scic_remote_device_get_connection_rate(
258258
struct scic_sds_remote_device *remote_device);
259259

260260
/**

‎drivers/scsi/isci/core/scic_sds_phy.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ static void scic_sds_phy_start_sata_link_training(
696696
*/
697697
static void scic_sds_phy_complete_link_training(
698698
struct scic_sds_phy *sci_phy,
699-
enum sci_sas_link_rate max_link_rate,
699+
enum sas_linkrate max_link_rate,
700700
u32 next_state)
701701
{
702702
sci_phy->max_negotiated_speed = max_link_rate;
@@ -808,21 +808,21 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_phy_speed_event_
808808
case SCU_EVENT_SAS_15:
809809
case SCU_EVENT_SAS_15_SSC:
810810
scic_sds_phy_complete_link_training(
811-
this_phy, SCI_SAS_150_GB, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
811+
this_phy, SAS_LINK_RATE_1_5_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
812812
);
813813
break;
814814

815815
case SCU_EVENT_SAS_30:
816816
case SCU_EVENT_SAS_30_SSC:
817817
scic_sds_phy_complete_link_training(
818-
this_phy, SCI_SAS_300_GB, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
818+
this_phy, SAS_LINK_RATE_3_0_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
819819
);
820820
break;
821821

822822
case SCU_EVENT_SAS_60:
823823
case SCU_EVENT_SAS_60_SSC:
824824
scic_sds_phy_complete_link_training(
825-
this_phy, SCI_SAS_600_GB, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
825+
this_phy, SAS_LINK_RATE_6_0_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
826826
);
827827
break;
828828

@@ -1082,7 +1082,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_han
10821082
case SCU_EVENT_SATA_15_SSC:
10831083
scic_sds_phy_complete_link_training(
10841084
this_phy,
1085-
SCI_SAS_150_GB,
1085+
SAS_LINK_RATE_1_5_GBPS,
10861086
SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF
10871087
);
10881088
break;
@@ -1091,7 +1091,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_han
10911091
case SCU_EVENT_SATA_30_SSC:
10921092
scic_sds_phy_complete_link_training(
10931093
this_phy,
1094-
SCI_SAS_300_GB,
1094+
SAS_LINK_RATE_3_0_GBPS,
10951095
SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF
10961096
);
10971097
break;
@@ -1100,7 +1100,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_han
11001100
case SCU_EVENT_SATA_60_SSC:
11011101
scic_sds_phy_complete_link_training(
11021102
this_phy,
1103-
SCI_SAS_600_GB,
1103+
SAS_LINK_RATE_6_0_GBPS,
11041104
SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF
11051105
);
11061106
break;
@@ -2439,7 +2439,7 @@ void scic_sds_phy_construct(struct scic_sds_phy *sci_phy,
24392439
sci_phy->bcn_received_while_port_unassigned = false;
24402440
sci_phy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN;
24412441
sci_phy->link_layer_registers = NULL;
2442-
sci_phy->max_negotiated_speed = SCI_SAS_NO_LINK_RATE;
2442+
sci_phy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
24432443
sci_phy->sata_timeout_timer = NULL;
24442444

24452445
/* Clear out the identification buffer data */

‎drivers/scsi/isci/core/scic_sds_phy.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "intel_sas.h"
6161
#include "scu_registers.h"
6262
#include "sci_base_state_machine.h"
63+
#include <scsi/libsas.h>
6364

6465
struct scic_sds_port;
6566
/**
@@ -243,7 +244,7 @@ struct scic_sds_phy {
243244
* This field indicates whether the phy supports 1.5 Gb/s, 3.0 Gb/s,
244245
* or 6.0 Gb/s operation.
245246
*/
246-
enum sci_sas_link_rate max_negotiated_speed;
247+
enum sas_linkrate max_negotiated_speed;
247248

248249
/**
249250
* This member specifies the protocol being utilized on this phy. This

‎drivers/scsi/isci/core/scic_sds_port.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
684684

685685
sci_port->active_phy_mask &= ~(1 << sci_phy->phy_index);
686686

687-
sci_phy->max_negotiated_speed = SCI_SAS_NO_LINK_RATE;
687+
sci_phy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
688688

689689
/* Re-assign the phy back to the LP as if it were a narrow port */
690690
writel(sci_phy->phy_index,
@@ -977,12 +977,12 @@ static void scic_sds_port_update_viit_entry(struct scic_sds_port *this_port)
977977
* This method returns the maximum negotiated speed of the slowest phy in the
978978
* port.
979979
*/
980-
enum sci_sas_link_rate scic_sds_port_get_max_allowed_speed(
980+
enum sas_linkrate scic_sds_port_get_max_allowed_speed(
981981
struct scic_sds_port *this_port)
982982
{
983-
u16 index = 0;
984-
enum sci_sas_link_rate max_allowed_speed = SCI_SAS_600_GB;
985-
struct scic_sds_phy *phy = NULL;
983+
u16 index;
984+
enum sas_linkrate max_allowed_speed = SAS_LINK_RATE_6_0_GBPS;
985+
struct scic_sds_phy *phy = NULL;
986986

987987
/*
988988
* Loop through all of the phys in this port and find the phy with the

‎drivers/scsi/isci/core/scic_sds_port.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ enum sci_status scic_sds_port_complete_io(
428428
struct scic_sds_remote_device *the_device,
429429
struct scic_sds_request *the_io_request);
430430

431-
enum sci_sas_link_rate scic_sds_port_get_max_allowed_speed(
431+
enum sas_linkrate scic_sds_port_get_max_allowed_speed(
432432
struct scic_sds_port *this_port);
433433

434434
void scic_sds_port_broadcast_change_received(

‎drivers/scsi/isci/core/scic_sds_remote_device.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ enum sci_status scic_remote_device_reset_complete(
256256
}
257257

258258

259-
enum sci_sas_link_rate scic_remote_device_get_connection_rate(
259+
enum sas_linkrate scic_remote_device_get_connection_rate(
260260
struct scic_sds_remote_device *sci_dev)
261261
{
262262
return sci_dev->connection_rate;

‎drivers/scsi/isci/core/scic_sds_remote_device.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include "intel_sas.h"
6060
#include "scu_remote_node_context.h"
6161
#include "scic_sds_remote_node_context.h"
62+
#include <scsi/libsas.h>
6263

6364
/**
6465
* enum scic_sds_remote_device_states - This enumeration depicts all the states
@@ -260,7 +261,7 @@ struct scic_sds_remote_device {
260261
* This field is the programmed connection rate for this remote device. It is
261262
* used to program the TC with the maximum allowed connection rate.
262263
*/
263-
enum sci_sas_link_rate connection_rate;
264+
enum sas_linkrate connection_rate;
264265

265266
/**
266267
* This field contains the allowed target protocols for this remote device.

0 commit comments

Comments
 (0)