Commit 85280955 authored by Dan Williams's avatar Dan Williams

isci: unify isci_phy and scic_sds_phy

They are one in the same object so remove the distinction.  The near
duplicate fields (owning_port, and isci_port) will be cleaned up
after the scic_sds_port isci_port unification.
Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5076a1a9
This diff is collapsed.
......@@ -101,14 +101,14 @@ struct scic_power_control {
* 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
*/
struct scic_sds_phy *requesters[SCI_MAX_PHYS];
struct isci_phy *requesters[SCI_MAX_PHYS];
};
struct scic_sds_port_configuration_agent;
typedef void (*port_config_fn)(struct scic_sds_controller *,
struct scic_sds_port_configuration_agent *,
struct scic_sds_port *, struct scic_sds_phy *);
struct scic_sds_port *, struct isci_phy *);
struct scic_sds_port_configuration_agent {
u16 phy_configured_mask;
......@@ -523,9 +523,8 @@ static inline struct device *scic_to_dev(struct scic_sds_controller *scic)
return &scic_to_ihost(scic)->pdev->dev;
}
static inline struct device *sciphy_to_dev(struct scic_sds_phy *sci_phy)
static inline struct device *sciphy_to_dev(struct isci_phy *iphy)
{
struct isci_phy *iphy = sci_phy_to_iphy(sci_phy);
if (!iphy || !iphy->isci_port || !iphy->isci_port->isci_host)
return NULL;
......@@ -606,21 +605,21 @@ struct isci_request *scic_request_by_tag(struct scic_sds_controller *scic,
void scic_sds_controller_power_control_queue_insert(
struct scic_sds_controller *scic,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
void scic_sds_controller_power_control_queue_remove(
struct scic_sds_controller *scic,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
void scic_sds_controller_link_up(
struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
void scic_sds_controller_link_down(
struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
void scic_sds_controller_remote_device_stopped(
struct scic_sds_controller *scic,
......@@ -651,7 +650,7 @@ void isci_host_deinit(
void isci_host_port_link_up(
struct isci_host *,
struct scic_sds_port *,
struct scic_sds_phy *);
struct isci_phy *);
int isci_host_dev_found(struct domain_device *);
void isci_host_remote_device_start_complete(
......
This diff is collapsed.
......@@ -84,102 +84,40 @@ enum scic_sds_phy_protocol {
};
/**
* struct scic_sds_phy - This structure contains or references all of the data
* necessary to represent the core phy object and SCU harware protocol
* engine.
*
*
* isci_phy - hba local phy infrastructure
* @sm:
* @protocol: attached device protocol
* @phy_index: physical index relative to the controller (0-3)
* @bcn_received_while_port_unassigned: bcn to report after port association
* @sata_timer: timeout SATA signature FIS arrival
*/
struct scic_sds_phy {
/**
* This field contains the information for the base phy state machine.
*/
struct isci_phy {
struct sci_base_state_machine sm;
/**
* This field specifies the port object that owns/contains this phy.
*/
struct scic_sds_port *owning_port;
/**
* This field indicates whether the phy supports 1.5 Gb/s, 3.0 Gb/s,
* or 6.0 Gb/s operation.
*/
enum sas_linkrate max_negotiated_speed;
/**
* This member specifies the protocol being utilized on this phy. This
* field contains a legitamite value once the PHY has link trained with
* a remote phy.
*/
enum scic_sds_phy_protocol protocol;
/**
* This field specifies the index with which this phy is associated (0-3).
*/
u8 phy_index;
/**
* This member indicates if this particular PHY has received a BCN while
* it had no port assignement. This BCN will be reported once the phy is
* assigned to a port.
*/
bool bcn_received_while_port_unassigned;
/**
* This field indicates if this PHY is currently in the process of
* link training (i.e. it has started OOB, but has yet to perform
* IAF exchange/Signature FIS reception).
*/
bool is_in_link_training;
/**
* Timer to detect when a signature FIS timeout has occurred. The
* signature FIS is the first FIS sent by an attached SATA device
* after OOB/SN.
*/
struct sci_timer sata_timer;
/**
* This field is the pointer to the transport layer register for the SCU
* hardware.
*/
struct sci_timer sata_timer;
struct scu_transport_layer_registers __iomem *transport_layer_registers;
/**
* This field points to the link layer register set within the SCU.
*/
struct scu_link_layer_registers __iomem *link_layer_registers;
};
struct isci_phy {
struct scic_sds_phy sci;
struct asd_sas_phy sas_phy;
struct isci_port *isci_port;
u8 sas_addr[SAS_ADDR_SIZE];
union {
struct sas_identify_frame iaf;
struct dev_to_host_fis fis;
} frame_rcvd;
};
static inline struct isci_phy *to_isci_phy(struct asd_sas_phy *sas_phy)
static inline struct isci_phy *to_iphy(struct asd_sas_phy *sas_phy)
{
struct isci_phy *iphy = container_of(sas_phy, typeof(*iphy), sas_phy);
return iphy;
}
static inline struct isci_phy *sci_phy_to_iphy(struct scic_sds_phy *sci_phy)
{
struct isci_phy *iphy = container_of(sci_phy, typeof(*iphy), sci);
return iphy;
}
struct scic_phy_cap {
union {
struct {
......@@ -520,61 +458,61 @@ enum scic_sds_phy_states {
(scic_sds_port_get_controller((phy)->owning_port))
void scic_sds_phy_construct(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
struct scic_sds_port *owning_port,
u8 phy_index);
struct scic_sds_port *phy_get_non_dummy_port(struct scic_sds_phy *sci_phy);
struct scic_sds_port *phy_get_non_dummy_port(struct isci_phy *iphy);
void scic_sds_phy_set_port(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
struct scic_sds_port *owning_port);
enum sci_status scic_sds_phy_initialize(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
struct scu_transport_layer_registers __iomem *transport_layer_registers,
struct scu_link_layer_registers __iomem *link_layer_registers);
enum sci_status scic_sds_phy_start(
struct scic_sds_phy *this_phy);
struct isci_phy *iphy);
enum sci_status scic_sds_phy_stop(
struct scic_sds_phy *this_phy);
struct isci_phy *iphy);
enum sci_status scic_sds_phy_reset(
struct scic_sds_phy *this_phy);
struct isci_phy *iphy);
void scic_sds_phy_resume(
struct scic_sds_phy *this_phy);
struct isci_phy *iphy);
void scic_sds_phy_setup_transport(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
u32 device_id);
enum sci_status scic_sds_phy_event_handler(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
u32 event_code);
enum sci_status scic_sds_phy_frame_handler(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
u32 frame_index);
enum sci_status scic_sds_phy_consume_power_handler(
struct scic_sds_phy *this_phy);
struct isci_phy *iphy);
void scic_sds_phy_get_sas_address(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
struct sci_sas_address *sas_address);
void scic_sds_phy_get_attached_sas_address(
struct scic_sds_phy *this_phy,
struct isci_phy *iphy,
struct sci_sas_address *sas_address);
struct scic_phy_proto;
void scic_sds_phy_get_protocols(
struct scic_sds_phy *sci_phy,
struct isci_phy *iphy,
struct scic_phy_proto *protocols);
enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy);
enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy);
struct isci_host;
void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index);
......
This diff is collapsed.
......@@ -131,7 +131,7 @@ struct scic_sds_port {
/**
* This field is the table of phys assigned to the port.
*/
struct scic_sds_phy *phy_table[SCI_MAX_PHYS];
struct isci_phy *phy_table[SCI_MAX_PHYS];
/**
* This field is a pointer back to the controller that owns this
......@@ -328,11 +328,11 @@ enum sci_status scic_sds_port_stop(struct scic_sds_port *sci_port);
enum sci_status scic_sds_port_add_phy(
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
enum sci_status scic_sds_port_remove_phy(
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
void scic_sds_port_setup_transports(
struct scic_sds_port *sci_port,
......@@ -342,17 +342,17 @@ void isci_port_bcn_enable(struct isci_host *, struct isci_port *);
void scic_sds_port_deactivate_phy(
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy,
struct isci_phy *iphy,
bool do_notify_user);
bool scic_sds_port_link_detected(
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
enum sci_status scic_sds_port_link_up(struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
enum sci_status scic_sds_port_link_down(struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
struct isci_request;
struct scic_sds_remote_device;
......@@ -371,7 +371,7 @@ enum sas_linkrate scic_sds_port_get_max_allowed_speed(
void scic_sds_port_broadcast_change_received(
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
struct isci_phy *iphy);
bool scic_sds_port_is_valid_phy_assignment(
struct scic_sds_port *sci_port,
......
This diff is collapsed.
......@@ -1389,7 +1389,7 @@ int isci_remote_device_found(struct domain_device *domain_dev)
sas_port = domain_dev->port;
sas_phy = list_first_entry(&sas_port->phy_list, struct asd_sas_phy,
port_phy_el);
isci_phy = to_isci_phy(sas_phy);
isci_phy = to_iphy(sas_phy);
isci_port = isci_phy->isci_port;
/* we are being called for a device on this port,
......
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