提交 89a7301f 编写于 作者: D Dan Williams

isci: retire scic_sds_ and scic_ prefixes

The distinction between scic_sds_ scic_ and sci_ are no longer relevant
so just unify the prefixes on sci_.  The distinction between isci_ and
sci_ is historically significant, and useful for comparing the old
'core' to the current Linux driver. 'sci_' represents the former core as
well as the routines that are closer to the hardware and protocol than
their 'isci_' brethren. sci == sas controller interface.

Also unwind the 'sds1' out of the parameter structs.
Reported-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 d9dcb4ba
此差异已折叠。
...@@ -69,12 +69,12 @@ struct scu_task_context; ...@@ -69,12 +69,12 @@ struct scu_task_context;
/** /**
* struct scic_power_control - * struct sci_power_control -
* *
* This structure defines the fields for managing power control for direct * This structure defines the fields for managing power control for direct
* attached disk devices. * attached disk devices.
*/ */
struct scic_power_control { struct sci_power_control {
/** /**
* This field is set when the power control timer is running and cleared when * This field is set when the power control timer is running and cleared when
* it is not. * it is not.
...@@ -99,18 +99,18 @@ struct scic_power_control { ...@@ -99,18 +99,18 @@ struct scic_power_control {
/** /**
* This field is an array of phys that we are waiting on. The phys are direct * This field is an array of phys that we are waiting on. The phys are direct
* mapped into requesters via struct scic_sds_phy.phy_index * mapped into requesters via struct sci_phy.phy_index
*/ */
struct isci_phy *requesters[SCI_MAX_PHYS]; struct isci_phy *requesters[SCI_MAX_PHYS];
}; };
struct scic_sds_port_configuration_agent; struct sci_port_configuration_agent;
typedef void (*port_config_fn)(struct isci_host *, typedef void (*port_config_fn)(struct isci_host *,
struct scic_sds_port_configuration_agent *, struct sci_port_configuration_agent *,
struct isci_port *, struct isci_phy *); struct isci_port *, struct isci_phy *);
struct scic_sds_port_configuration_agent { struct sci_port_configuration_agent {
u16 phy_configured_mask; u16 phy_configured_mask;
u16 phy_ready_mask; u16 phy_ready_mask;
struct { struct {
...@@ -149,13 +149,13 @@ struct isci_host { ...@@ -149,13 +149,13 @@ struct isci_host {
/* XXX can we time this externally */ /* XXX can we time this externally */
struct sci_timer timer; struct sci_timer timer;
/* XXX drop reference module params directly */ /* XXX drop reference module params directly */
union scic_user_parameters user_parameters; struct sci_user_parameters user_parameters;
/* XXX no need to be a union */ /* XXX no need to be a union */
union scic_oem_parameters oem_parameters; struct sci_oem_params oem_parameters;
struct scic_sds_port_configuration_agent port_agent; struct sci_port_configuration_agent port_agent;
struct isci_remote_device *device_table[SCI_MAX_REMOTE_DEVICES]; struct isci_remote_device *device_table[SCI_MAX_REMOTE_DEVICES];
struct scic_remote_node_table available_remote_nodes; struct sci_remote_node_table available_remote_nodes;
struct scic_power_control power_control; struct sci_power_control power_control;
u8 io_request_sequence[SCI_MAX_IO_REQUESTS]; u8 io_request_sequence[SCI_MAX_IO_REQUESTS];
struct scu_task_context *task_context_table; struct scu_task_context *task_context_table;
dma_addr_t task_context_dma; dma_addr_t task_context_dma;
...@@ -165,7 +165,7 @@ struct isci_host { ...@@ -165,7 +165,7 @@ struct isci_host {
u32 logical_port_entries; u32 logical_port_entries;
u32 remote_node_entries; u32 remote_node_entries;
u32 task_context_entries; u32 task_context_entries;
struct scic_sds_unsolicited_frame_control uf_control; struct sci_unsolicited_frame_control uf_control;
/* phy startup */ /* phy startup */
struct sci_timer phy_timer; struct sci_timer phy_timer;
...@@ -206,10 +206,10 @@ struct isci_host { ...@@ -206,10 +206,10 @@ struct isci_host {
}; };
/** /**
* enum scic_sds_controller_states - This enumeration depicts all the states * enum sci_controller_states - This enumeration depicts all the states
* for the common controller state machine. * for the common controller state machine.
*/ */
enum scic_sds_controller_states { enum sci_controller_states {
/** /**
* Simply the initial state for the base controller state machine. * Simply the initial state for the base controller state machine.
*/ */
...@@ -360,14 +360,14 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev) ...@@ -360,14 +360,14 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev)
} }
/** /**
* scic_sds_controller_get_protocol_engine_group() - * sci_controller_get_protocol_engine_group() -
* *
* This macro returns the protocol engine group for this controller object. * This macro returns the protocol engine group for this controller object.
* Presently we only support protocol engine group 0 so just return that * Presently we only support protocol engine group 0 so just return that
*/ */
#define scic_sds_controller_get_protocol_engine_group(controller) 0 #define sci_controller_get_protocol_engine_group(controller) 0
/* see scic_controller_io_tag_allocate|free for how seq and tci are built */ /* see sci_controller_io_tag_allocate|free for how seq and tci are built */
#define ISCI_TAG(seq, tci) (((u16) (seq)) << 12 | tci) #define ISCI_TAG(seq, tci) (((u16) (seq)) << 12 | tci)
/* these are returned by the hardware, so sanitize them */ /* these are returned by the hardware, so sanitize them */
...@@ -375,7 +375,7 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev) ...@@ -375,7 +375,7 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev)
#define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1)) #define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1))
/* expander attached sata devices require 3 rnc slots */ /* expander attached sata devices require 3 rnc slots */
static inline int scic_sds_remote_device_node_count(struct isci_remote_device *idev) static inline int sci_remote_device_node_count(struct isci_remote_device *idev)
{ {
struct domain_device *dev = idev->domain_dev; struct domain_device *dev = idev->domain_dev;
...@@ -386,23 +386,23 @@ static inline int scic_sds_remote_device_node_count(struct isci_remote_device *i ...@@ -386,23 +386,23 @@ static inline int scic_sds_remote_device_node_count(struct isci_remote_device *i
} }
/** /**
* scic_sds_controller_set_invalid_phy() - * sci_controller_set_invalid_phy() -
* *
* This macro will set the bit in the invalid phy mask for this controller * This macro will set the bit in the invalid phy mask for this controller
* object. This is used to control messages reported for invalid link up * object. This is used to control messages reported for invalid link up
* notifications. * notifications.
*/ */
#define scic_sds_controller_set_invalid_phy(controller, phy) \ #define sci_controller_set_invalid_phy(controller, phy) \
((controller)->invalid_phy_mask |= (1 << (phy)->phy_index)) ((controller)->invalid_phy_mask |= (1 << (phy)->phy_index))
/** /**
* scic_sds_controller_clear_invalid_phy() - * sci_controller_clear_invalid_phy() -
* *
* This macro will clear the bit in the invalid phy mask for this controller * This macro will clear the bit in the invalid phy mask for this controller
* object. This is used to control messages reported for invalid link up * object. This is used to control messages reported for invalid link up
* notifications. * notifications.
*/ */
#define scic_sds_controller_clear_invalid_phy(controller, phy) \ #define sci_controller_clear_invalid_phy(controller, phy) \
((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index)) ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))
static inline struct device *sciphy_to_dev(struct isci_phy *iphy) static inline struct device *sciphy_to_dev(struct isci_phy *iphy)
...@@ -460,56 +460,53 @@ static inline bool is_c0(void) ...@@ -460,56 +460,53 @@ static inline bool is_c0(void)
return isci_si_rev > ISCI_SI_REVB0; return isci_si_rev > ISCI_SI_REVB0;
} }
void scic_sds_controller_post_request(struct isci_host *ihost, void sci_controller_post_request(struct isci_host *ihost,
u32 request); u32 request);
void scic_sds_controller_release_frame(struct isci_host *ihost, void sci_controller_release_frame(struct isci_host *ihost,
u32 frame_index); u32 frame_index);
void scic_sds_controller_copy_sata_response(void *response_buffer, void sci_controller_copy_sata_response(void *response_buffer,
void *frame_header, void *frame_header,
void *frame_buffer); void *frame_buffer);
enum sci_status scic_sds_controller_allocate_remote_node_context(struct isci_host *ihost, enum sci_status sci_controller_allocate_remote_node_context(struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
u16 *node_id); u16 *node_id);
void scic_sds_controller_free_remote_node_context( void sci_controller_free_remote_node_context(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
u16 node_id); u16 node_id);
union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
struct isci_host *ihost,
u16 node_id);
struct isci_request *scic_request_by_tag(struct isci_host *ihost, struct isci_request *sci_request_by_tag(struct isci_host *ihost,
u16 io_tag); u16 io_tag);
void scic_sds_controller_power_control_queue_insert( void sci_controller_power_control_queue_insert(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_controller_power_control_queue_remove( void sci_controller_power_control_queue_remove(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_controller_link_up( void sci_controller_link_up(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_controller_link_down( void sci_controller_link_down(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_controller_remote_device_stopped( void sci_controller_remote_device_stopped(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev); struct isci_remote_device *idev);
void scic_sds_controller_copy_task_context( void sci_controller_copy_task_context(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_request *ireq); struct isci_request *ireq);
void scic_sds_controller_register_setup(struct isci_host *ihost); void sci_controller_register_setup(struct isci_host *ihost);
enum sci_status scic_controller_continue_io(struct isci_request *ireq); enum sci_status sci_controller_continue_io(struct isci_request *ireq);
int isci_host_scan_finished(struct Scsi_Host *, unsigned long); int isci_host_scan_finished(struct Scsi_Host *, unsigned long);
void isci_host_scan_start(struct Scsi_Host *); void isci_host_scan_start(struct Scsi_Host *);
u16 isci_alloc_tag(struct isci_host *ihost); u16 isci_alloc_tag(struct isci_host *ihost);
...@@ -536,33 +533,33 @@ void isci_host_remote_device_start_complete( ...@@ -536,33 +533,33 @@ void isci_host_remote_device_start_complete(
struct isci_remote_device *, struct isci_remote_device *,
enum sci_status); enum sci_status);
void scic_controller_disable_interrupts( void sci_controller_disable_interrupts(
struct isci_host *ihost); struct isci_host *ihost);
enum sci_status scic_controller_start_io( enum sci_status sci_controller_start_io(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sci_task_status scic_controller_start_task( enum sci_task_status sci_controller_start_task(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sci_status scic_controller_terminate_request( enum sci_status sci_controller_terminate_request(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sci_status scic_controller_complete_io( enum sci_status sci_controller_complete_io(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
void scic_sds_port_configuration_agent_construct( void sci_port_configuration_agent_construct(
struct scic_sds_port_configuration_agent *port_agent); struct sci_port_configuration_agent *port_agent);
enum sci_status scic_sds_port_configuration_agent_initialize( enum sci_status sci_port_configuration_agent_initialize(
struct isci_host *ihost, struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent); struct sci_port_configuration_agent *port_agent);
#endif #endif
...@@ -484,7 +484,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic ...@@ -484,7 +484,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
orom = isci_request_oprom(pdev); orom = isci_request_oprom(pdev);
for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) { for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) {
if (scic_oem_parameters_validate(&orom->ctrl[i])) { if (sci_oem_parameters_validate(&orom->ctrl[i])) {
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
"[%d]: invalid oem parameters detected, falling back to firmware\n", i); "[%d]: invalid oem parameters detected, falling back to firmware\n", i);
devm_kfree(&pdev->dev, orom); devm_kfree(&pdev->dev, orom);
...@@ -554,7 +554,7 @@ static void __devexit isci_pci_remove(struct pci_dev *pdev) ...@@ -554,7 +554,7 @@ static void __devexit isci_pci_remove(struct pci_dev *pdev)
for_each_isci_host(i, ihost, pdev) { for_each_isci_host(i, ihost, pdev) {
isci_unregister(ihost); isci_unregister(ihost);
isci_host_deinit(ihost); isci_host_deinit(ihost);
scic_controller_disable_interrupts(ihost); sci_controller_disable_interrupts(ihost);
} }
} }
......
...@@ -304,7 +304,7 @@ enum sci_status { ...@@ -304,7 +304,7 @@ enum sci_status {
* This member indicates that the operation failed, the failure is * This member indicates that the operation failed, the failure is
* controller implementation specific, and the response data associated * controller implementation specific, and the response data associated
* with the request is not valid. You can query for the controller * with the request is not valid. You can query for the controller
* specific error information via scic_controller_get_request_status() * specific error information via sci_controller_get_request_status()
*/ */
SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
...@@ -395,7 +395,7 @@ enum sci_status { ...@@ -395,7 +395,7 @@ enum sci_status {
/** /**
* This value indicates that an unsupported PCI device ID has been * This value indicates that an unsupported PCI device ID has been
* specified. This indicates that attempts to invoke * specified. This indicates that attempts to invoke
* scic_library_allocate_controller() will fail. * sci_library_allocate_controller() will fail.
*/ */
SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
...@@ -493,7 +493,7 @@ irqreturn_t isci_error_isr(int vec, void *data); ...@@ -493,7 +493,7 @@ irqreturn_t isci_error_isr(int vec, void *data);
/* /*
* Each timer is associated with a cancellation flag that is set when * Each timer is associated with a cancellation flag that is set when
* del_timer() is called and checked in the timer callback function. This * del_timer() is called and checked in the timer callback function. This
* is needed since del_timer_sync() cannot be called with scic_lock held. * is needed since del_timer_sync() cannot be called with sci_lock held.
* For deinit however, del_timer_sync() is used without holding the lock. * For deinit however, del_timer_sync() is used without holding the lock.
*/ */
struct sci_timer { struct sci_timer {
......
此差异已折叠。
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
*/ */
#define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250 #define SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT 250
enum scic_sds_phy_protocol { enum sci_phy_protocol {
SCIC_SDS_PHY_PROTOCOL_UNKNOWN, SCIC_SDS_PHY_PROTOCOL_UNKNOWN,
SCIC_SDS_PHY_PROTOCOL_SAS, SCIC_SDS_PHY_PROTOCOL_SAS,
SCIC_SDS_PHY_PROTOCOL_SATA, SCIC_SDS_PHY_PROTOCOL_SATA,
...@@ -95,7 +95,7 @@ struct isci_phy { ...@@ -95,7 +95,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 scic_sds_phy_protocol protocol; enum sci_phy_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;
...@@ -118,7 +118,7 @@ static inline struct isci_phy *to_iphy(struct asd_sas_phy *sas_phy) ...@@ -118,7 +118,7 @@ static inline struct isci_phy *to_iphy(struct asd_sas_phy *sas_phy)
return iphy; return iphy;
} }
struct scic_phy_cap { struct sci_phy_cap {
union { union {
struct { struct {
/* /*
...@@ -147,7 +147,7 @@ struct scic_phy_cap { ...@@ -147,7 +147,7 @@ struct scic_phy_cap {
} __packed; } __packed;
/* this data structure reflects the link layer transmit identification reg */ /* this data structure reflects the link layer transmit identification reg */
struct scic_phy_proto { struct sci_phy_proto {
union { union {
struct { struct {
u16 _r_a:1; u16 _r_a:1;
...@@ -167,12 +167,12 @@ struct scic_phy_proto { ...@@ -167,12 +167,12 @@ struct scic_phy_proto {
/** /**
* struct scic_phy_properties - This structure defines the properties common to * struct sci_phy_properties - This structure defines the properties common to
* all phys that can be retrieved. * all phys that can be retrieved.
* *
* *
*/ */
struct scic_phy_properties { struct sci_phy_properties {
/** /**
* This field specifies the port that currently contains the * This field specifies the port that currently contains the
* supplied phy. This field may be set to NULL * supplied phy. This field may be set to NULL
...@@ -194,12 +194,12 @@ struct scic_phy_properties { ...@@ -194,12 +194,12 @@ struct scic_phy_properties {
}; };
/** /**
* struct scic_sas_phy_properties - This structure defines the properties, * struct sci_sas_phy_properties - This structure defines the properties,
* specific to a SAS phy, that can be retrieved. * specific to a SAS phy, that can be retrieved.
* *
* *
*/ */
struct scic_sas_phy_properties { struct sci_sas_phy_properties {
/** /**
* This field delineates the Identify Address Frame received * This field delineates the Identify Address Frame received
* from the remote end point. * from the remote end point.
...@@ -210,17 +210,17 @@ struct scic_sas_phy_properties { ...@@ -210,17 +210,17 @@ struct scic_sas_phy_properties {
* This field delineates the Phy capabilities structure received * This field delineates the Phy capabilities structure received
* from the remote end point. * from the remote end point.
*/ */
struct scic_phy_cap rcvd_cap; struct sci_phy_cap rcvd_cap;
}; };
/** /**
* struct scic_sata_phy_properties - This structure defines the properties, * struct sci_sata_phy_properties - This structure defines the properties,
* specific to a SATA phy, that can be retrieved. * specific to a SATA phy, that can be retrieved.
* *
* *
*/ */
struct scic_sata_phy_properties { struct sci_sata_phy_properties {
/** /**
* This field delineates the signature FIS received from the * This field delineates the signature FIS received from the
* attached target. * attached target.
...@@ -236,12 +236,12 @@ struct scic_sata_phy_properties { ...@@ -236,12 +236,12 @@ struct scic_sata_phy_properties {
}; };
/** /**
* enum scic_phy_counter_id - This enumeration depicts the various pieces of * enum sci_phy_counter_id - This enumeration depicts the various pieces of
* optional information that can be retrieved for a specific phy. * optional information that can be retrieved for a specific phy.
* *
* *
*/ */
enum scic_phy_counter_id { enum sci_phy_counter_id {
/** /**
* This PHY information field tracks the number of frames received. * This PHY information field tracks the number of frames received.
*/ */
...@@ -344,7 +344,7 @@ enum scic_phy_counter_id { ...@@ -344,7 +344,7 @@ enum scic_phy_counter_id {
SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
}; };
enum scic_sds_phy_states { enum sci_phy_states {
/** /**
* Simply the initial state for the base domain state machine. * Simply the initial state for the base domain state machine.
*/ */
...@@ -441,77 +441,77 @@ enum scic_sds_phy_states { ...@@ -441,77 +441,77 @@ enum scic_sds_phy_states {
}; };
/** /**
* scic_sds_phy_get_index() - * sci_phy_get_index() -
* *
* This macro returns the phy index for the specified phy * This macro returns the phy index for the specified phy
*/ */
#define scic_sds_phy_get_index(phy) \ #define sci_phy_get_index(phy) \
((phy)->phy_index) ((phy)->phy_index)
/** /**
* scic_sds_phy_get_controller() - This macro returns the controller for this * sci_phy_get_controller() - This macro returns the controller for this
* phy * phy
* *
* *
*/ */
#define scic_sds_phy_get_controller(phy) \ #define sci_phy_get_controller(phy) \
(scic_sds_port_get_controller((phy)->owning_port)) (sci_port_get_controller((phy)->owning_port))
void scic_sds_phy_construct( void sci_phy_construct(
struct isci_phy *iphy, struct isci_phy *iphy,
struct isci_port *iport, struct isci_port *iport,
u8 phy_index); u8 phy_index);
struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy); struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy);
void scic_sds_phy_set_port( void sci_phy_set_port(
struct isci_phy *iphy, struct isci_phy *iphy,
struct isci_port *iport); struct isci_port *iport);
enum sci_status scic_sds_phy_initialize( enum sci_status sci_phy_initialize(
struct isci_phy *iphy, struct isci_phy *iphy,
struct scu_transport_layer_registers __iomem *transport_layer_registers, struct scu_transport_layer_registers __iomem *transport_layer_registers,
struct scu_link_layer_registers __iomem *link_layer_registers); struct scu_link_layer_registers __iomem *link_layer_registers);
enum sci_status scic_sds_phy_start( enum sci_status sci_phy_start(
struct isci_phy *iphy); struct isci_phy *iphy);
enum sci_status scic_sds_phy_stop( enum sci_status sci_phy_stop(
struct isci_phy *iphy); struct isci_phy *iphy);
enum sci_status scic_sds_phy_reset( enum sci_status sci_phy_reset(
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_phy_resume( void sci_phy_resume(
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_phy_setup_transport( void sci_phy_setup_transport(
struct isci_phy *iphy, struct isci_phy *iphy,
u32 device_id); u32 device_id);
enum sci_status scic_sds_phy_event_handler( enum sci_status sci_phy_event_handler(
struct isci_phy *iphy, struct isci_phy *iphy,
u32 event_code); u32 event_code);
enum sci_status scic_sds_phy_frame_handler( enum sci_status sci_phy_frame_handler(
struct isci_phy *iphy, struct isci_phy *iphy,
u32 frame_index); u32 frame_index);
enum sci_status scic_sds_phy_consume_power_handler( enum sci_status sci_phy_consume_power_handler(
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_phy_get_sas_address( void sci_phy_get_sas_address(
struct isci_phy *iphy, struct isci_phy *iphy,
struct sci_sas_address *sas_address); struct sci_sas_address *sas_address);
void scic_sds_phy_get_attached_sas_address( void sci_phy_get_attached_sas_address(
struct isci_phy *iphy, struct isci_phy *iphy,
struct sci_sas_address *sas_address); struct sci_sas_address *sas_address);
struct scic_phy_proto; struct sci_phy_proto;
void scic_sds_phy_get_protocols( void sci_phy_get_protocols(
struct isci_phy *iphy, struct isci_phy *iphy,
struct scic_phy_proto *protocols); struct sci_phy_proto *protocols);
enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy); enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy);
struct isci_host; struct isci_host;
......
此差异已折叠。
...@@ -123,7 +123,7 @@ struct isci_port { ...@@ -123,7 +123,7 @@ struct isci_port {
struct scu_viit_entry __iomem *viit_registers; struct scu_viit_entry __iomem *viit_registers;
}; };
enum scic_port_not_ready_reason_code { enum sci_port_not_ready_reason_code {
SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS, SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED, SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION, SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION,
...@@ -132,25 +132,25 @@ enum scic_port_not_ready_reason_code { ...@@ -132,25 +132,25 @@ enum scic_port_not_ready_reason_code {
SCIC_PORT_NOT_READY_REASON_CODE_MAX SCIC_PORT_NOT_READY_REASON_CODE_MAX
}; };
struct scic_port_end_point_properties { struct sci_port_end_point_properties {
struct sci_sas_address sas_address; struct sci_sas_address sas_address;
struct scic_phy_proto protocols; struct sci_phy_proto protocols;
}; };
struct scic_port_properties { struct sci_port_properties {
u32 index; u32 index;
struct scic_port_end_point_properties local; struct sci_port_end_point_properties local;
struct scic_port_end_point_properties remote; struct sci_port_end_point_properties remote;
u32 phy_mask; u32 phy_mask;
}; };
/** /**
* enum scic_sds_port_states - This enumeration depicts all the states for the * enum sci_port_states - This enumeration depicts all the states for the
* common port state machine. * common port state machine.
* *
* *
*/ */
enum scic_sds_port_states { enum sci_port_states {
/** /**
* This state indicates that the port has successfully been stopped. * This state indicates that the port has successfully been stopped.
* In this state no new IO operations are permitted. * In this state no new IO operations are permitted.
...@@ -211,23 +211,23 @@ enum scic_sds_port_states { ...@@ -211,23 +211,23 @@ enum scic_sds_port_states {
}; };
/** /**
* scic_sds_port_get_controller() - * sci_port_get_controller() -
* *
* Helper macro to get the owning controller of this port * Helper macro to get the owning controller of this port
*/ */
#define scic_sds_port_get_controller(this_port) \ #define sci_port_get_controller(this_port) \
((this_port)->owning_controller) ((this_port)->owning_controller)
/** /**
* scic_sds_port_get_index() - * sci_port_get_index() -
* *
* This macro returns the physical port index for this port object * This macro returns the physical port index for this port object
*/ */
#define scic_sds_port_get_index(this_port) \ #define sci_port_get_index(this_port) \
((this_port)->physical_port_index) ((this_port)->physical_port_index)
static inline void scic_sds_port_decrement_request_count(struct isci_port *iport) static inline void sci_port_decrement_request_count(struct isci_port *iport)
{ {
if (WARN_ONCE(iport->started_request_count == 0, if (WARN_ONCE(iport->started_request_count == 0,
"%s: tried to decrement started_request_count past 0!?", "%s: tried to decrement started_request_count past 0!?",
...@@ -237,79 +237,73 @@ static inline void scic_sds_port_decrement_request_count(struct isci_port *iport ...@@ -237,79 +237,73 @@ static inline void scic_sds_port_decrement_request_count(struct isci_port *iport
iport->started_request_count--; iport->started_request_count--;
} }
#define scic_sds_port_active_phy(port, phy) \ #define sci_port_active_phy(port, phy) \
(((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0) (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0)
void scic_sds_port_construct( void sci_port_construct(
struct isci_port *iport, struct isci_port *iport,
u8 port_index, u8 port_index,
struct isci_host *ihost); struct isci_host *ihost);
enum sci_status scic_sds_port_initialize( enum sci_status sci_port_start(struct isci_port *iport);
struct isci_port *iport, enum sci_status sci_port_stop(struct isci_port *iport);
void __iomem *port_task_scheduler_registers,
void __iomem *port_configuration_regsiter,
void __iomem *viit_registers);
enum sci_status scic_sds_port_start(struct isci_port *iport);
enum sci_status scic_sds_port_stop(struct isci_port *iport);
enum sci_status scic_sds_port_add_phy( enum sci_status sci_port_add_phy(
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
enum sci_status scic_sds_port_remove_phy( enum sci_status sci_port_remove_phy(
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
void scic_sds_port_setup_transports( void sci_port_setup_transports(
struct isci_port *iport, struct isci_port *iport,
u32 device_id); u32 device_id);
void isci_port_bcn_enable(struct isci_host *, struct isci_port *); void isci_port_bcn_enable(struct isci_host *, struct isci_port *);
void scic_sds_port_deactivate_phy( void sci_port_deactivate_phy(
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy, struct isci_phy *iphy,
bool do_notify_user); bool do_notify_user);
bool scic_sds_port_link_detected( bool sci_port_link_detected(
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
enum sci_status scic_sds_port_link_up(struct isci_port *iport, enum sci_status sci_port_link_up(struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
enum sci_status scic_sds_port_link_down(struct isci_port *iport, enum sci_status sci_port_link_down(struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
struct isci_request; struct isci_request;
struct isci_remote_device; struct isci_remote_device;
enum sci_status scic_sds_port_start_io( enum sci_status sci_port_start_io(
struct isci_port *iport, struct isci_port *iport,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sci_status scic_sds_port_complete_io( enum sci_status sci_port_complete_io(
struct isci_port *iport, struct isci_port *iport,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sas_linkrate scic_sds_port_get_max_allowed_speed( enum sas_linkrate sci_port_get_max_allowed_speed(
struct isci_port *iport); struct isci_port *iport);
void scic_sds_port_broadcast_change_received( void sci_port_broadcast_change_received(
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy); struct isci_phy *iphy);
bool scic_sds_port_is_valid_phy_assignment( bool sci_port_is_valid_phy_assignment(
struct isci_port *iport, struct isci_port *iport,
u32 phy_index); u32 phy_index);
void scic_sds_port_get_sas_address( void sci_port_get_sas_address(
struct isci_port *iport, struct isci_port *iport,
struct sci_sas_address *sas_address); struct sci_sas_address *sas_address);
void scic_sds_port_get_attached_sas_address( void sci_port_get_attached_sas_address(
struct isci_port *iport, struct isci_port *iport,
struct sci_sas_address *sas_address); struct sci_sas_address *sas_address);
......
...@@ -112,7 +112,7 @@ static s32 sci_sas_address_compare( ...@@ -112,7 +112,7 @@ static s32 sci_sas_address_compare(
* port. port address if the port can be found to match the phy. * port. port address if the port can be found to match the phy.
* NULL if there is no matching port for the phy. * NULL if there is no matching port for the phy.
*/ */
static struct isci_port *scic_sds_port_configuration_agent_find_port( static struct isci_port *sci_port_configuration_agent_find_port(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_phy *iphy) struct isci_phy *iphy)
{ {
...@@ -127,14 +127,14 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port( ...@@ -127,14 +127,14 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port(
* more phys match the sent and received SAS address as this phy in which * more phys match the sent and received SAS address as this phy in which
* case it should participate in the same port. * case it should participate in the same port.
*/ */
scic_sds_phy_get_sas_address(iphy, &phy_sas_address); sci_phy_get_sas_address(iphy, &phy_sas_address);
scic_sds_phy_get_attached_sas_address(iphy, &phy_attached_device_address); sci_phy_get_attached_sas_address(iphy, &phy_attached_device_address);
for (i = 0; i < ihost->logical_port_entries; i++) { for (i = 0; i < ihost->logical_port_entries; i++) {
struct isci_port *iport = &ihost->ports[i]; struct isci_port *iport = &ihost->ports[i];
scic_sds_port_get_sas_address(iport, &port_sas_address); sci_port_get_sas_address(iport, &port_sas_address);
scic_sds_port_get_attached_sas_address(iport, &port_attached_device_address); sci_port_get_attached_sas_address(iport, &port_attached_device_address);
if (sci_sas_address_compare(port_sas_address, phy_sas_address) == 0 && if (sci_sas_address_compare(port_sas_address, phy_sas_address) == 0 &&
sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0) sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0)
...@@ -156,9 +156,9 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port( ...@@ -156,9 +156,9 @@ static struct isci_port *scic_sds_port_configuration_agent_find_port(
* this port configuration agent. SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION * this port configuration agent. SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION
* the port configuration is not valid for this port configuration agent. * the port configuration is not valid for this port configuration agent.
*/ */
static enum sci_status scic_sds_port_configuration_agent_validate_ports( static enum sci_status sci_port_configuration_agent_validate_ports(
struct isci_host *ihost, struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent) struct sci_port_configuration_agent *port_agent)
{ {
struct sci_sas_address first_address; struct sci_sas_address first_address;
struct sci_sas_address second_address; struct sci_sas_address second_address;
...@@ -194,8 +194,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports( ...@@ -194,8 +194,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports(
* PE0 and PE3 can never have the same SAS Address unless they * PE0 and PE3 can never have the same SAS Address unless they
* are part of the same x4 wide port and we have already checked * are part of the same x4 wide port and we have already checked
* for this condition. */ * for this condition. */
scic_sds_phy_get_sas_address(&ihost->phys[0], &first_address); sci_phy_get_sas_address(&ihost->phys[0], &first_address);
scic_sds_phy_get_sas_address(&ihost->phys[3], &second_address); sci_phy_get_sas_address(&ihost->phys[3], &second_address);
if (sci_sas_address_compare(first_address, second_address) == 0) { if (sci_sas_address_compare(first_address, second_address) == 0) {
return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION;
...@@ -207,8 +207,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports( ...@@ -207,8 +207,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports(
* part of the same port. */ * part of the same port. */
if (port_agent->phy_valid_port_range[0].min_index == 0 && if (port_agent->phy_valid_port_range[0].min_index == 0 &&
port_agent->phy_valid_port_range[1].min_index == 1) { port_agent->phy_valid_port_range[1].min_index == 1) {
scic_sds_phy_get_sas_address(&ihost->phys[0], &first_address); sci_phy_get_sas_address(&ihost->phys[0], &first_address);
scic_sds_phy_get_sas_address(&ihost->phys[2], &second_address); sci_phy_get_sas_address(&ihost->phys[2], &second_address);
if (sci_sas_address_compare(first_address, second_address) == 0) { if (sci_sas_address_compare(first_address, second_address) == 0) {
return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION;
...@@ -221,8 +221,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports( ...@@ -221,8 +221,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports(
* part of the same port. */ * part of the same port. */
if (port_agent->phy_valid_port_range[2].min_index == 2 && if (port_agent->phy_valid_port_range[2].min_index == 2 &&
port_agent->phy_valid_port_range[3].min_index == 3) { port_agent->phy_valid_port_range[3].min_index == 3) {
scic_sds_phy_get_sas_address(&ihost->phys[1], &first_address); sci_phy_get_sas_address(&ihost->phys[1], &first_address);
scic_sds_phy_get_sas_address(&ihost->phys[3], &second_address); sci_phy_get_sas_address(&ihost->phys[3], &second_address);
if (sci_sas_address_compare(first_address, second_address) == 0) { if (sci_sas_address_compare(first_address, second_address) == 0) {
return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION; return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION;
...@@ -239,8 +239,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports( ...@@ -239,8 +239,8 @@ static enum sci_status scic_sds_port_configuration_agent_validate_ports(
/* verify all of the phys in the same port are using the same SAS address */ /* verify all of the phys in the same port are using the same SAS address */
static enum sci_status static enum sci_status
scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, sci_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent) struct sci_port_configuration_agent *port_agent)
{ {
u32 phy_mask; u32 phy_mask;
u32 assigned_phy_mask; u32 assigned_phy_mask;
...@@ -254,7 +254,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -254,7 +254,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
sas_address.low = 0; sas_address.low = 0;
for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) { for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) {
phy_mask = ihost->oem_parameters.sds1.ports[port_index].phy_mask; phy_mask = ihost->oem_parameters.ports[port_index].phy_mask;
if (!phy_mask) if (!phy_mask)
continue; continue;
...@@ -269,7 +269,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -269,7 +269,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
for (phy_index = 0; phy_index < SCI_MAX_PHYS; phy_index++) { for (phy_index = 0; phy_index < SCI_MAX_PHYS; phy_index++) {
if ((phy_mask & (1 << phy_index)) == 0) if ((phy_mask & (1 << phy_index)) == 0)
continue; continue;
scic_sds_phy_get_sas_address(&ihost->phys[phy_index], sci_phy_get_sas_address(&ihost->phys[phy_index],
&sas_address); &sas_address);
/* /*
...@@ -294,7 +294,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -294,7 +294,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
while (phy_index < SCI_MAX_PHYS) { while (phy_index < SCI_MAX_PHYS) {
if ((phy_mask & (1 << phy_index)) == 0) if ((phy_mask & (1 << phy_index)) == 0)
continue; continue;
scic_sds_phy_get_sas_address(&ihost->phys[phy_index], sci_phy_get_sas_address(&ihost->phys[phy_index],
&phy_assigned_address); &phy_assigned_address);
if (sci_sas_address_compare(sas_address, phy_assigned_address) != 0) { if (sci_sas_address_compare(sas_address, phy_assigned_address) != 0) {
...@@ -307,7 +307,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -307,7 +307,7 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
port_agent->phy_valid_port_range[phy_index].min_index = port_index; port_agent->phy_valid_port_range[phy_index].min_index = port_index;
port_agent->phy_valid_port_range[phy_index].max_index = phy_index; port_agent->phy_valid_port_range[phy_index].max_index = phy_index;
scic_sds_port_add_phy(&ihost->ports[port_index], sci_port_add_phy(&ihost->ports[port_index],
&ihost->phys[phy_index]); &ihost->phys[phy_index]);
assigned_phy_mask |= (1 << phy_index); assigned_phy_mask |= (1 << phy_index);
...@@ -316,14 +316,14 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -316,14 +316,14 @@ scic_sds_mpc_agent_validate_phy_configuration(struct isci_host *ihost,
phy_index++; phy_index++;
} }
return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent); return sci_port_configuration_agent_validate_ports(ihost, port_agent);
} }
static void mpc_agent_timeout(unsigned long data) static void mpc_agent_timeout(unsigned long data)
{ {
u8 index; u8 index;
struct sci_timer *tmr = (struct sci_timer *)data; struct sci_timer *tmr = (struct sci_timer *)data;
struct scic_sds_port_configuration_agent *port_agent; struct sci_port_configuration_agent *port_agent;
struct isci_host *ihost; struct isci_host *ihost;
unsigned long flags; unsigned long flags;
u16 configure_phy_mask; u16 configure_phy_mask;
...@@ -355,8 +355,8 @@ static void mpc_agent_timeout(unsigned long data) ...@@ -355,8 +355,8 @@ static void mpc_agent_timeout(unsigned long data)
spin_unlock_irqrestore(&ihost->scic_lock, flags); spin_unlock_irqrestore(&ihost->scic_lock, flags);
} }
static void scic_sds_mpc_agent_link_up(struct isci_host *ihost, static void sci_mpc_agent_link_up(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent, struct sci_port_configuration_agent *port_agent,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy) struct isci_phy *iphy)
{ {
...@@ -367,10 +367,10 @@ static void scic_sds_mpc_agent_link_up(struct isci_host *ihost, ...@@ -367,10 +367,10 @@ static void scic_sds_mpc_agent_link_up(struct isci_host *ihost,
if (!iport) if (!iport)
return; return;
port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(iphy)); port_agent->phy_ready_mask |= (1 << sci_phy_get_index(iphy));
scic_sds_port_link_up(iport, iphy); sci_port_link_up(iport, iphy);
if ((iport->active_phy_mask & (1 << scic_sds_phy_get_index(iphy)))) if ((iport->active_phy_mask & (1 << sci_phy_get_index(iphy))))
port_agent->phy_configured_mask |= (1 << scic_sds_phy_get_index(iphy)); port_agent->phy_configured_mask |= (1 << sci_phy_get_index(iphy));
} }
/** /**
...@@ -390,9 +390,9 @@ static void scic_sds_mpc_agent_link_up(struct isci_host *ihost, ...@@ -390,9 +390,9 @@ static void scic_sds_mpc_agent_link_up(struct isci_host *ihost,
* not associated with a port there is no action taken. Is it possible to get a * not associated with a port there is no action taken. Is it possible to get a
* link down notification from a phy that has no assocoated port? * link down notification from a phy that has no assocoated port?
*/ */
static void scic_sds_mpc_agent_link_down( static void sci_mpc_agent_link_down(
struct isci_host *ihost, struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent, struct sci_port_configuration_agent *port_agent,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy) struct isci_phy *iphy)
{ {
...@@ -405,9 +405,9 @@ static void scic_sds_mpc_agent_link_down( ...@@ -405,9 +405,9 @@ static void scic_sds_mpc_agent_link_down(
* state. * state.
*/ */
port_agent->phy_ready_mask &= port_agent->phy_ready_mask &=
~(1 << scic_sds_phy_get_index(iphy)); ~(1 << sci_phy_get_index(iphy));
port_agent->phy_configured_mask &= port_agent->phy_configured_mask &=
~(1 << scic_sds_phy_get_index(iphy)); ~(1 << sci_phy_get_index(iphy));
/* /*
* Check to see if there are more phys waiting to be * Check to see if there are more phys waiting to be
...@@ -424,7 +424,7 @@ static void scic_sds_mpc_agent_link_down( ...@@ -424,7 +424,7 @@ static void scic_sds_mpc_agent_link_down(
SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT); SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT);
} }
scic_sds_port_link_down(iport, iphy); sci_port_link_down(iport, iphy);
} }
} }
...@@ -432,8 +432,8 @@ static void scic_sds_mpc_agent_link_down( ...@@ -432,8 +432,8 @@ static void scic_sds_mpc_agent_link_down(
* configuration mode. * configuration mode.
*/ */
static enum sci_status static enum sci_status
scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost, sci_apc_agent_validate_phy_configuration(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent) struct sci_port_configuration_agent *port_agent)
{ {
u8 phy_index; u8 phy_index;
u8 port_index; u8 port_index;
...@@ -446,11 +446,11 @@ scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -446,11 +446,11 @@ scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost,
port_index = phy_index; port_index = phy_index;
/* Get the assigned SAS Address for the first PHY on the controller. */ /* Get the assigned SAS Address for the first PHY on the controller. */
scic_sds_phy_get_sas_address(&ihost->phys[phy_index], sci_phy_get_sas_address(&ihost->phys[phy_index],
&sas_address); &sas_address);
while (++phy_index < SCI_MAX_PHYS) { while (++phy_index < SCI_MAX_PHYS) {
scic_sds_phy_get_sas_address(&ihost->phys[phy_index], sci_phy_get_sas_address(&ihost->phys[phy_index],
&phy_assigned_address); &phy_assigned_address);
/* Verify each of the SAS address are all the same for every PHY */ /* Verify each of the SAS address are all the same for every PHY */
...@@ -465,11 +465,11 @@ scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost, ...@@ -465,11 +465,11 @@ scic_sds_apc_agent_validate_phy_configuration(struct isci_host *ihost,
} }
} }
return scic_sds_port_configuration_agent_validate_ports(ihost, port_agent); return sci_port_configuration_agent_validate_ports(ihost, port_agent);
} }
static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, static void sci_apc_agent_configure_ports(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent, struct sci_port_configuration_agent *port_agent,
struct isci_phy *iphy, struct isci_phy *iphy,
bool start_timer) bool start_timer)
{ {
...@@ -478,10 +478,10 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, ...@@ -478,10 +478,10 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
struct isci_port *iport; struct isci_port *iport;
enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY; enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY;
iport = scic_sds_port_configuration_agent_find_port(ihost, iphy); iport = sci_port_configuration_agent_find_port(ihost, iphy);
if (iport) { if (iport) {
if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index))
apc_activity = SCIC_SDS_APC_ADD_PHY; apc_activity = SCIC_SDS_APC_ADD_PHY;
else else
apc_activity = SCIC_SDS_APC_SKIP_PHY; apc_activity = SCIC_SDS_APC_SKIP_PHY;
...@@ -499,7 +499,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, ...@@ -499,7 +499,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
iport = &ihost->ports[port_index]; iport = &ihost->ports[port_index];
/* First we must make sure that this PHY can be added to this Port. */ /* First we must make sure that this PHY can be added to this Port. */
if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) { if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) {
/* /*
* Port contains a PHY with a greater PHY ID than the current * Port contains a PHY with a greater PHY ID than the current
* PHY that has gone link up. This phy can not be part of any * PHY that has gone link up. This phy can not be part of any
...@@ -559,7 +559,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, ...@@ -559,7 +559,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
switch (apc_activity) { switch (apc_activity) {
case SCIC_SDS_APC_ADD_PHY: case SCIC_SDS_APC_ADD_PHY:
status = scic_sds_port_add_phy(iport, iphy); status = sci_port_add_phy(iport, iphy);
if (status == SCI_SUCCESS) { if (status == SCI_SUCCESS) {
port_agent->phy_configured_mask |= (1 << iphy->phy_index); port_agent->phy_configured_mask |= (1 << iphy->phy_index);
...@@ -588,7 +588,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, ...@@ -588,7 +588,7 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
} }
/** /**
* scic_sds_apc_agent_link_up - handle apc link up events * sci_apc_agent_link_up - handle apc link up events
* @scic: This is the controller object that receives the link up * @scic: This is the controller object that receives the link up
* notification. * notification.
* @sci_port: This is the port object associated with the phy. If the is no * @sci_port: This is the port object associated with the phy. If the is no
...@@ -599,8 +599,8 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost, ...@@ -599,8 +599,8 @@ static void scic_sds_apc_agent_configure_ports(struct isci_host *ihost,
* notifications. Is it possible to get a link down notification from a phy * notifications. Is it possible to get a link down notification from a phy
* that has no assocoated port? * that has no assocoated port?
*/ */
static void scic_sds_apc_agent_link_up(struct isci_host *ihost, static void sci_apc_agent_link_up(struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent, struct sci_port_configuration_agent *port_agent,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy) struct isci_phy *iphy)
{ {
...@@ -609,7 +609,7 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost, ...@@ -609,7 +609,7 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost,
if (!iport) { if (!iport) {
/* the phy is not the part of this port */ /* the phy is not the part of this port */
port_agent->phy_ready_mask |= 1 << phy_index; port_agent->phy_ready_mask |= 1 << phy_index;
scic_sds_apc_agent_configure_ports(ihost, port_agent, iphy, true); sci_apc_agent_configure_ports(ihost, port_agent, iphy, true);
} else { } else {
/* the phy is already the part of the port */ /* the phy is already the part of the port */
u32 port_state = iport->sm.current_state_id; u32 port_state = iport->sm.current_state_id;
...@@ -620,7 +620,7 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost, ...@@ -620,7 +620,7 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost,
*/ */
BUG_ON(port_state != SCI_PORT_RESETTING); BUG_ON(port_state != SCI_PORT_RESETTING);
port_agent->phy_ready_mask |= 1 << phy_index; port_agent->phy_ready_mask |= 1 << phy_index;
scic_sds_port_link_up(iport, iphy); sci_port_link_up(iport, iphy);
} }
} }
...@@ -637,20 +637,20 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost, ...@@ -637,20 +637,20 @@ static void scic_sds_apc_agent_link_up(struct isci_host *ihost,
* possible to get a link down notification from a phy that has no assocoated * possible to get a link down notification from a phy that has no assocoated
* port? * port?
*/ */
static void scic_sds_apc_agent_link_down( static void sci_apc_agent_link_down(
struct isci_host *ihost, struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent, struct sci_port_configuration_agent *port_agent,
struct isci_port *iport, struct isci_port *iport,
struct isci_phy *iphy) struct isci_phy *iphy)
{ {
port_agent->phy_ready_mask &= ~(1 << scic_sds_phy_get_index(iphy)); port_agent->phy_ready_mask &= ~(1 << sci_phy_get_index(iphy));
if (!iport) if (!iport)
return; return;
if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) { if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) {
enum sci_status status; enum sci_status status;
status = scic_sds_port_remove_phy(iport, iphy); status = sci_port_remove_phy(iport, iphy);
if (status == SCI_SUCCESS) if (status == SCI_SUCCESS)
port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); port_agent->phy_configured_mask &= ~(1 << iphy->phy_index);
...@@ -662,7 +662,7 @@ static void apc_agent_timeout(unsigned long data) ...@@ -662,7 +662,7 @@ static void apc_agent_timeout(unsigned long data)
{ {
u32 index; u32 index;
struct sci_timer *tmr = (struct sci_timer *)data; struct sci_timer *tmr = (struct sci_timer *)data;
struct scic_sds_port_configuration_agent *port_agent; struct sci_port_configuration_agent *port_agent;
struct isci_host *ihost; struct isci_host *ihost;
unsigned long flags; unsigned long flags;
u16 configure_phy_mask; u16 configure_phy_mask;
...@@ -686,7 +686,7 @@ static void apc_agent_timeout(unsigned long data) ...@@ -686,7 +686,7 @@ static void apc_agent_timeout(unsigned long data)
if ((configure_phy_mask & (1 << index)) == 0) if ((configure_phy_mask & (1 << index)) == 0)
continue; continue;
scic_sds_apc_agent_configure_ports(ihost, port_agent, sci_apc_agent_configure_ports(ihost, port_agent,
&ihost->phys[index], false); &ihost->phys[index], false);
} }
...@@ -706,8 +706,8 @@ static void apc_agent_timeout(unsigned long data) ...@@ -706,8 +706,8 @@ static void apc_agent_timeout(unsigned long data)
* call is universal for both manual port configuration and automatic port * call is universal for both manual port configuration and automatic port
* configuration modes. * configuration modes.
*/ */
void scic_sds_port_configuration_agent_construct( void sci_port_configuration_agent_construct(
struct scic_sds_port_configuration_agent *port_agent) struct sci_port_configuration_agent *port_agent)
{ {
u32 index; u32 index;
...@@ -725,29 +725,29 @@ void scic_sds_port_configuration_agent_construct( ...@@ -725,29 +725,29 @@ void scic_sds_port_configuration_agent_construct(
} }
} }
enum sci_status scic_sds_port_configuration_agent_initialize( enum sci_status sci_port_configuration_agent_initialize(
struct isci_host *ihost, struct isci_host *ihost,
struct scic_sds_port_configuration_agent *port_agent) struct sci_port_configuration_agent *port_agent)
{ {
enum sci_status status; enum sci_status status;
enum scic_port_configuration_mode mode; enum sci_port_configuration_mode mode;
mode = ihost->oem_parameters.sds1.controller.mode_type; mode = ihost->oem_parameters.controller.mode_type;
if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) { if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
status = scic_sds_mpc_agent_validate_phy_configuration( status = sci_mpc_agent_validate_phy_configuration(
ihost, port_agent); ihost, port_agent);
port_agent->link_up_handler = scic_sds_mpc_agent_link_up; port_agent->link_up_handler = sci_mpc_agent_link_up;
port_agent->link_down_handler = scic_sds_mpc_agent_link_down; port_agent->link_down_handler = sci_mpc_agent_link_down;
sci_init_timer(&port_agent->timer, mpc_agent_timeout); sci_init_timer(&port_agent->timer, mpc_agent_timeout);
} else { } else {
status = scic_sds_apc_agent_validate_phy_configuration( status = sci_apc_agent_validate_phy_configuration(
ihost, port_agent); ihost, port_agent);
port_agent->link_up_handler = scic_sds_apc_agent_link_up; port_agent->link_up_handler = sci_apc_agent_link_up;
port_agent->link_down_handler = scic_sds_apc_agent_link_down; port_agent->link_down_handler = sci_apc_agent_link_down;
sci_init_timer(&port_agent->timer, apc_agent_timeout); sci_init_timer(&port_agent->timer, apc_agent_timeout);
} }
......
...@@ -111,25 +111,15 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev) ...@@ -111,25 +111,15 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev)
return rom; return rom;
} }
/** enum sci_status isci_parse_oem_parameters(struct sci_oem_params *oem,
* isci_parse_oem_parameters() - This method will take OEM parameters
* from the module init parameters and copy them to oem_params. This will
* only copy values that are not set to the module parameter default values
* @oem_parameters: This parameter specifies the controller default OEM
* parameters. It is expected that this has been initialized to the default
* parameters for the controller
*
*
*/
enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params,
struct isci_orom *orom, int scu_index) struct isci_orom *orom, int scu_index)
{ {
/* check for valid inputs */ /* check for valid inputs */
if (scu_index < 0 || scu_index >= SCI_MAX_CONTROLLERS || if (scu_index < 0 || scu_index >= SCI_MAX_CONTROLLERS ||
scu_index > orom->hdr.num_elements || !oem_params) scu_index > orom->hdr.num_elements || !oem)
return -EINVAL; return -EINVAL;
oem_params->sds1 = orom->ctrl[scu_index]; *oem = orom->ctrl[scu_index];
return 0; return 0;
} }
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#define SCIC_SDS_PARM_MAX_SPEED SCIC_SDS_PARM_GEN3_SPEED #define SCIC_SDS_PARM_MAX_SPEED SCIC_SDS_PARM_GEN3_SPEED
/* parameters that can be set by module parameters */ /* parameters that can be set by module parameters */
struct scic_sds_user_parameters { struct sci_user_parameters {
struct sci_phy_user_params { struct sci_phy_user_params {
/** /**
* This field specifies the NOTIFY (ENABLE SPIN UP) primitive * This field specifies the NOTIFY (ENABLE SPIN UP) primitive
...@@ -147,30 +147,16 @@ struct scic_sds_user_parameters { ...@@ -147,30 +147,16 @@ struct scic_sds_user_parameters {
}; };
/* XXX kill this union */
union scic_user_parameters {
/**
* This field specifies the user parameters specific to the
* Storage Controller Unit (SCU) Driver Standard (SDS) version
* 1.
*/
struct scic_sds_user_parameters sds1;
};
#define SCIC_SDS_PARM_PHY_MASK_MIN 0x0 #define SCIC_SDS_PARM_PHY_MASK_MIN 0x0
#define SCIC_SDS_PARM_PHY_MASK_MAX 0xF #define SCIC_SDS_PARM_PHY_MASK_MAX 0xF
#define MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT 4 #define MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT 4
struct scic_sds_oem_params; struct sci_oem_params;
int scic_oem_parameters_validate(struct scic_sds_oem_params *oem); int sci_oem_parameters_validate(struct sci_oem_params *oem);
union scic_oem_parameters;
void scic_oem_parameters_get(struct isci_host *ihost,
union scic_oem_parameters *oem);
struct isci_orom; struct isci_orom;
struct isci_orom *isci_request_oprom(struct pci_dev *pdev); struct isci_orom *isci_request_oprom(struct pci_dev *pdev);
enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem, enum sci_status isci_parse_oem_parameters(struct sci_oem_params *oem,
struct isci_orom *orom, int scu_index); struct isci_orom *orom, int scu_index);
struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmware *fw); struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmware *fw);
struct isci_orom *isci_get_efi_var(struct pci_dev *pdev); struct isci_orom *isci_get_efi_var(struct pci_dev *pdev);
...@@ -214,7 +200,7 @@ struct isci_oem_hdr { ...@@ -214,7 +200,7 @@ struct isci_oem_hdr {
* A PORT_PHY mask that assigns just a single PHY to a port and no other PHYs * A PORT_PHY mask that assigns just a single PHY to a port and no other PHYs
* being assigned is sufficient to declare manual PORT configuration. * being assigned is sufficient to declare manual PORT configuration.
*/ */
enum scic_port_configuration_mode { enum sci_port_configuration_mode {
SCIC_PORT_MANUAL_CONFIGURATION_MODE = 0, SCIC_PORT_MANUAL_CONFIGURATION_MODE = 0,
SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE = 1 SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE = 1
}; };
...@@ -230,7 +216,7 @@ struct sci_bios_oem_param_block_hdr { ...@@ -230,7 +216,7 @@ struct sci_bios_oem_param_block_hdr {
uint8_t reserved[8]; uint8_t reserved[8];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct scic_sds_oem_params { struct sci_oem_params {
struct { struct {
uint8_t mode_type; uint8_t mode_type;
uint8_t max_concurrent_dev_spin_up; uint8_t max_concurrent_dev_spin_up;
...@@ -255,19 +241,9 @@ struct scic_sds_oem_params { ...@@ -255,19 +241,9 @@ struct scic_sds_oem_params {
} phys[SCI_MAX_PHYS]; } phys[SCI_MAX_PHYS];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* XXX kill this union */
union scic_oem_parameters {
/**
* This field specifies the OEM parameters specific to the
* Storage Controller Unit (SCU) Driver Standard (SDS) version
* 1.
*/
struct scic_sds_oem_params sds1;
};
struct isci_orom { struct isci_orom {
struct sci_bios_oem_param_block_hdr hdr; struct sci_bios_oem_param_block_hdr hdr;
struct scic_sds_oem_params ctrl[SCI_MAX_CONTROLLERS]; struct sci_oem_params ctrl[SCI_MAX_CONTROLLERS];
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif #endif
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -116,7 +116,7 @@ void isci_sata_set_ncq_tag( ...@@ -116,7 +116,7 @@ void isci_sata_set_ncq_tag(
struct isci_request *request = task->lldd_task; struct isci_request *request = task->lldd_task;
register_fis->sector_count = qc->tag << 3; register_fis->sector_count = qc->tag << 3;
scic_stp_io_request_set_ncq_tag(request, qc->tag); sci_stp_io_request_set_ncq_tag(request, qc->tag);
} }
/** /**
...@@ -187,7 +187,7 @@ enum sci_status isci_sata_management_task_request_build(struct isci_request *ire ...@@ -187,7 +187,7 @@ enum sci_status isci_sata_management_task_request_build(struct isci_request *ire
/* core builds the protocol specific request /* core builds the protocol specific request
* based on the h2d fis. * based on the h2d fis.
*/ */
status = scic_task_request_construct_sata(ireq); status = sci_task_request_construct_sata(ireq);
return status; return status;
} }
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册