Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34a99158 authored by Dan Williams's avatar Dan Williams
Browse files

isci: kill 'get/set' macros



Most of these simple dereference macros are longer than their open coded
equivalent.  Deleting enum sci_controller_mode is thrown in for good
measure.

Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 89a7301f
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -2627,7 +2627,7 @@ enum sci_status sci_controller_start_io(struct isci_host *ihost,
		return status;
		return status;


	set_bit(IREQ_ACTIVE, &ireq->flags);
	set_bit(IREQ_ACTIVE, &ireq->flags);
	sci_controller_post_request(ihost, sci_request_get_post_context(ireq));
	sci_controller_post_request(ihost, ireq->post_context);
	return SCI_SUCCESS;
	return SCI_SUCCESS;
}
}


@@ -2707,7 +2707,7 @@ enum sci_status sci_controller_continue_io(struct isci_request *ireq)
	}
	}


	set_bit(IREQ_ACTIVE, &ireq->flags);
	set_bit(IREQ_ACTIVE, &ireq->flags);
	sci_controller_post_request(ihost, sci_request_get_post_context(ireq));
	sci_controller_post_request(ihost, ireq->post_context);
	return SCI_SUCCESS;
	return SCI_SUCCESS;
}
}


@@ -2747,9 +2747,7 @@ enum sci_task_status sci_controller_start_task(struct isci_host *ihost,
		return SCI_SUCCESS;
		return SCI_SUCCESS;
	case SCI_SUCCESS:
	case SCI_SUCCESS:
		set_bit(IREQ_ACTIVE, &ireq->flags);
		set_bit(IREQ_ACTIVE, &ireq->flags);

		sci_controller_post_request(ihost, ireq->post_context);
		sci_controller_post_request(ihost,
			sci_request_get_post_context(ireq));
		break;
		break;
	default:
	default:
		break;
		break;
+3 −17
Original line number Original line Diff line number Diff line
@@ -172,6 +172,7 @@ struct isci_host {
	/* XXX kill */
	/* XXX kill */
	bool phy_startup_timer_pending;
	bool phy_startup_timer_pending;
	u32 next_phy_to_start;
	u32 next_phy_to_start;
	/* XXX convert to unsigned long and use bitops */
	u8 invalid_phy_mask;
	u8 invalid_phy_mask;


	/* TODO attempt dynamic interrupt coalescing scheme */
	/* TODO attempt dynamic interrupt coalescing scheme */
@@ -359,13 +360,8 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev)
	return dev->port->ha->lldd_ha;
	return dev->port->ha->lldd_ha;
}
}


/**
/* we always use protocol engine group zero */
 * sci_controller_get_protocol_engine_group() -
#define ISCI_PEG 0
 *
 * This macro returns the protocol engine group for this controller object.
 * Presently we only support protocol engine group 0 so just return that
 */
#define sci_controller_get_protocol_engine_group(controller) 0


/* see sci_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)
@@ -385,16 +381,6 @@ static inline int sci_remote_device_node_count(struct isci_remote_device *idev)
	return SCU_SSP_REMOTE_NODE_COUNT;
	return SCU_SSP_REMOTE_NODE_COUNT;
}
}


/**
 * sci_controller_set_invalid_phy() -
 *
 * 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
 * notifications.
 */
#define sci_controller_set_invalid_phy(controller, phy) \
	((controller)->invalid_phy_mask |= (1 << (phy)->phy_index))

/**
/**
 * sci_controller_clear_invalid_phy() -
 * sci_controller_clear_invalid_phy() -
 *
 *
+0 −5
Original line number Original line Diff line number Diff line
@@ -73,11 +73,6 @@


#define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF
#define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF


enum sci_controller_mode {
	SCI_MODE_SPEED,
	SCI_MODE_SIZE /* deprecated */
};

#define SCI_MAX_PHYS  (4UL)
#define SCI_MAX_PHYS  (4UL)
#define SCI_MAX_PORTS SCI_MAX_PHYS
#define SCI_MAX_PORTS SCI_MAX_PHYS
#define SCI_MAX_SMP_PHYS  (384) /* not silicon constrained */
#define SCI_MAX_SMP_PHYS  (384) /* not silicon constrained */
+16 −17
Original line number Original line Diff line number Diff line
@@ -265,10 +265,11 @@ done:
 * port (i.e. it's contained in the dummy port). !NULL All other
 * port (i.e. it's contained in the dummy port). !NULL All other
 * values indicate a handle/pointer to the port containing the phy.
 * values indicate a handle/pointer to the port containing the phy.
 */
 */
struct isci_port *phy_get_non_dummy_port(
struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy)
	struct isci_phy *iphy)
{
{
	if (sci_port_get_index(iphy->owning_port) == SCIC_SDS_DUMMY_PORT)
	struct isci_port *iport = iphy->owning_port;

	if (iport->physical_port_index == SCIC_SDS_DUMMY_PORT)
		return NULL;
		return NULL;


	return iphy->owning_port;
	return iphy->owning_port;
@@ -858,8 +859,7 @@ enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index)
		struct dev_to_host_fis *frame_header;
		struct dev_to_host_fis *frame_header;
		u32 *fis_frame_data;
		u32 *fis_frame_data;


		result = sci_unsolicited_frame_control_get_header(
		result = sci_unsolicited_frame_control_get_header(&ihost->uf_control,
			&(sci_phy_get_controller(iphy)->uf_control),
								  frame_index,
								  frame_index,
								  (void **)&frame_header);
								  (void **)&frame_header);


@@ -1090,6 +1090,8 @@ static void scu_link_layer_tx_hard_reset(
static void sci_phy_stopped_state_enter(struct sci_base_state_machine *sm)
static void sci_phy_stopped_state_enter(struct sci_base_state_machine *sm)
{
{
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_port *iport = iphy->owning_port;
	struct isci_host *ihost = iport->owning_controller;


	/*
	/*
	 * @todo We need to get to the controller to place this PE in a
	 * @todo We need to get to the controller to place this PE in a
@@ -1100,14 +1102,14 @@ static void sci_phy_stopped_state_enter(struct sci_base_state_machine *sm)
	scu_link_layer_stop_protocol_engine(iphy);
	scu_link_layer_stop_protocol_engine(iphy);


	if (iphy->sm.previous_state_id != SCI_PHY_INITIAL)
	if (iphy->sm.previous_state_id != SCI_PHY_INITIAL)
		sci_controller_link_down(sci_phy_get_controller(iphy),
		sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy);
					      phy_get_non_dummy_port(iphy),
					      iphy);
}
}


static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
{
{
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_port *iport = iphy->owning_port;
	struct isci_host *ihost = iport->owning_controller;


	scu_link_layer_stop_protocol_engine(iphy);
	scu_link_layer_stop_protocol_engine(iphy);
	scu_link_layer_start_oob(iphy);
	scu_link_layer_start_oob(iphy);
@@ -1117,9 +1119,7 @@ static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
	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)
		sci_controller_link_down(sci_phy_get_controller(iphy),
		sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy);
					      phy_get_non_dummy_port(iphy),
					      iphy);


	sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL);
	sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL);
}
}
@@ -1127,11 +1127,10 @@ static void sci_phy_starting_state_enter(struct sci_base_state_machine *sm)
static void sci_phy_ready_state_enter(struct sci_base_state_machine *sm)
static void sci_phy_ready_state_enter(struct sci_base_state_machine *sm)
{
{
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm);
	struct isci_port *iport = iphy->owning_port;
	struct isci_host *ihost = iport->owning_controller;


	sci_controller_link_up(sci_phy_get_controller(iphy),
	sci_controller_link_up(ihost, phy_get_non_dummy_port(iphy), iphy);
				    phy_get_non_dummy_port(iphy),
				    iphy);

}
}


static void sci_phy_ready_state_exit(struct sci_base_state_machine *sm)
static void sci_phy_ready_state_exit(struct sci_base_state_machine *sm)
+0 −17
Original line number Original line Diff line number Diff line
@@ -440,23 +440,6 @@ enum sci_phy_states {
	SCI_PHY_FINAL,
	SCI_PHY_FINAL,
};
};


/**
 * sci_phy_get_index() -
 *
 * This macro returns the phy index for the specified phy
 */
#define sci_phy_get_index(phy) \
	((phy)->phy_index)

/**
 * sci_phy_get_controller() - This macro returns the controller for this
 *    phy
 *
 *
 */
#define sci_phy_get_controller(phy) \
	(sci_port_get_controller((phy)->owning_port))

void sci_phy_construct(
void sci_phy_construct(
	struct isci_phy *iphy,
	struct isci_phy *iphy,
	struct isci_port *iport,
	struct isci_port *iport,
Loading