isci: replace this_* and the_* variables with more meaningful names

Removed any instances of the_* and this_* to variable names that are more
meaningful and tell us what they actually are.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dave Jiang
2011-04-21 05:34:49 +00:00
committed by Dan Williams
parent 2d70de5a0f
commit e2023b8735
21 changed files with 1479 additions and 1475 deletions
+30 -30
View File
@@ -73,8 +73,8 @@
*
* Private operation for the pool
*/
#define SCI_POOL_INCREMENT(this_pool, index) \
(((index) + 1) == (this_pool).size ? 0 : (index) + 1)
#define SCI_POOL_INCREMENT(pool, index) \
(((index) + 1) == (pool).size ? 0 : (index) + 1)
/**
* SCI_POOL_CREATE() -
@@ -98,8 +98,8 @@
* This macro evaluates the pool and returns true if the pool is empty. If the
* pool is empty the user should not perform any get operation on the pool.
*/
#define sci_pool_empty(this_pool) \
((this_pool).get == (this_pool).put)
#define sci_pool_empty(pool) \
((pool).get == (pool).put)
/**
* sci_pool_full() -
@@ -107,8 +107,8 @@
* This macro evaluates the pool and returns true if the pool is full. If the
* pool is full the user should not perform any put operation.
*/
#define sci_pool_full(this_pool) \
(SCI_POOL_INCREMENT(this_pool, (this_pool).put) == (this_pool).get)
#define sci_pool_full(pool) \
(SCI_POOL_INCREMENT(pool, (pool).put) == (pool).get)
/**
* sci_pool_size() -
@@ -118,25 +118,25 @@
* pointers can be written simultaneously by different users. As a result,
* this macro subtracts 1 from the internal size
*/
#define sci_pool_size(this_pool) \
((this_pool).size - 1)
#define sci_pool_size(pool) \
((pool).size - 1)
/**
* sci_pool_count() -
*
* This macro indicates the number of elements currently contained in the pool.
*/
#define sci_pool_count(this_pool) \
#define sci_pool_count(pool) \
(\
sci_pool_empty((this_pool)) \
sci_pool_empty((pool)) \
? 0 \
: (\
sci_pool_full((this_pool)) \
? sci_pool_size((this_pool)) \
sci_pool_full((pool)) \
? sci_pool_size((pool)) \
: (\
(this_pool).get > (this_pool).put \
? ((this_pool).size - (this_pool).get + (this_pool).put) \
: ((this_pool).put - (this_pool).get) \
(pool).get > (pool).put \
? ((pool).size - (pool).get + (pool).put) \
: ((pool).put - (pool).get) \
) \
) \
)
@@ -146,11 +146,11 @@
*
* This macro initializes the pool to an empty condition.
*/
#define sci_pool_initialize(this_pool) \
#define sci_pool_initialize(pool) \
{ \
(this_pool).size = (sizeof((this_pool).array) / sizeof((this_pool).array[0])); \
(this_pool).get = 0; \
(this_pool).put = 0; \
(pool).size = (sizeof((pool).array) / sizeof((pool).array[0])); \
(pool).get = 0; \
(pool).put = 0; \
}
/**
@@ -159,10 +159,10 @@
* This macro will get the next free element from the pool. This should only be
* called if the pool is not empty.
*/
#define sci_pool_get(this_pool, my_value) \
#define sci_pool_get(pool, my_value) \
{ \
(my_value) = (this_pool).array[(this_pool).get]; \
(this_pool).get = SCI_POOL_INCREMENT((this_pool), (this_pool).get); \
(my_value) = (pool).array[(pool).get]; \
(pool).get = SCI_POOL_INCREMENT((pool), (pool).get); \
}
/**
@@ -171,10 +171,10 @@
* This macro will put the value into the pool. This should only be called if
* the pool is not full.
*/
#define sci_pool_put(this_pool, the_value) \
#define sci_pool_put(pool, value) \
{ \
(this_pool).array[(this_pool).put] = (the_value); \
(this_pool).put = SCI_POOL_INCREMENT((this_pool), (this_pool).put); \
(pool).array[(pool).put] = (value); \
(pool).put = SCI_POOL_INCREMENT((pool), (pool).put); \
}
/**
@@ -183,16 +183,16 @@
* This macro will search the pool and remove any elements in the pool matching
* the supplied value. This method can only be utilized on pools
*/
#define sci_pool_erase(this_pool, type, the_value) \
#define sci_pool_erase(pool, type, value) \
{ \
type tmp_value; \
u32 index; \
u32 element_count = sci_pool_count((this_pool)); \
u32 element_count = sci_pool_count((pool)); \
\
for (index = 0; index < element_count; index++) { \
sci_pool_get((this_pool), tmp_value); \
if (tmp_value != (the_value)) \
sci_pool_put((this_pool), tmp_value); \
sci_pool_get((pool), tmp_value); \
if (tmp_value != (value)) \
sci_pool_put((pool), tmp_value); \
} \
}
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -542,12 +542,12 @@ void scic_sds_controller_copy_sata_response(
enum sci_status scic_sds_controller_allocate_remote_node_context(
struct scic_sds_controller *this_controller,
struct scic_sds_remote_device *the_device,
struct scic_sds_remote_device *sci_dev,
u16 *node_id);
void scic_sds_controller_free_remote_node_context(
struct scic_sds_controller *this_controller,
struct scic_sds_remote_device *the_device,
struct scic_sds_remote_device *sci_dev,
u16 node_id);
union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
@@ -565,25 +565,25 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer(
void scic_sds_controller_power_control_queue_insert(
struct scic_sds_controller *this_controller,
struct scic_sds_phy *the_phy);
struct scic_sds_phy *sci_phy);
void scic_sds_controller_power_control_queue_remove(
struct scic_sds_controller *this_controller,
struct scic_sds_phy *the_phy);
struct scic_sds_phy *sci_phy);
void scic_sds_controller_link_up(
struct scic_sds_controller *this_controller,
struct scic_sds_port *the_port,
struct scic_sds_phy *the_phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
void scic_sds_controller_link_down(
struct scic_sds_controller *this_controller,
struct scic_sds_port *the_port,
struct scic_sds_phy *the_phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
void scic_sds_controller_remote_device_stopped(
struct scic_sds_controller *this_controller,
struct scic_sds_remote_device *the_device);
struct scic_sds_remote_device *sci_dev);
void scic_sds_controller_copy_task_context(
struct scic_sds_controller *this_controller,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+29 -29
View File
@@ -378,77 +378,77 @@ static inline void scic_sds_port_decrement_request_count(struct scic_sds_port *s
(((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0)
void scic_sds_port_construct(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
u8 port_index,
struct scic_sds_controller *owning_controller);
struct scic_sds_controller *scic);
enum sci_status scic_sds_port_initialize(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
void __iomem *port_task_scheduler_registers,
void __iomem *port_configuration_regsiter,
void __iomem *viit_registers);
enum sci_status scic_sds_port_add_phy(
struct scic_sds_port *this_port,
struct scic_sds_phy *the_phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
enum sci_status scic_sds_port_remove_phy(
struct scic_sds_port *this_port,
struct scic_sds_phy *the_phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
void scic_sds_port_setup_transports(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
u32 device_id);
void scic_sds_port_deactivate_phy(
struct scic_sds_port *this_port,
struct scic_sds_phy *phy,
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy,
bool do_notify_user);
bool scic_sds_port_link_detected(
struct scic_sds_port *this_port,
struct scic_sds_phy *phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
void scic_sds_port_link_up(
struct scic_sds_port *this_port,
struct scic_sds_phy *phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
void scic_sds_port_link_down(
struct scic_sds_port *this_port,
struct scic_sds_phy *phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
enum sci_status scic_sds_port_start_io(
struct scic_sds_port *this_port,
struct scic_sds_remote_device *the_device,
struct scic_sds_request *the_io_request);
struct scic_sds_port *sci_port,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *sci_req);
enum sci_status scic_sds_port_complete_io(
struct scic_sds_port *this_port,
struct scic_sds_remote_device *the_device,
struct scic_sds_request *the_io_request);
struct scic_sds_port *sci_port,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *sci_req);
enum sas_linkrate scic_sds_port_get_max_allowed_speed(
struct scic_sds_port *this_port);
struct scic_sds_port *sci_port);
void scic_sds_port_broadcast_change_received(
struct scic_sds_port *this_port,
struct scic_sds_phy *this_phy);
struct scic_sds_port *sci_port,
struct scic_sds_phy *sci_phy);
bool scic_sds_port_is_valid_phy_assignment(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
u32 phy_index);
void scic_sds_port_get_sas_address(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
struct sci_sas_address *sas_address);
void scic_sds_port_get_attached_sas_address(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
struct sci_sas_address *sas_address);
void scic_sds_port_get_attached_protocols(
struct scic_sds_port *this_port,
struct scic_sds_port *sci_port,
struct sci_sas_identify_address_frame_protocols *protocols);
#endif /* _SCIC_SDS_PORT_H_ */
File diff suppressed because it is too large Load Diff
+51 -51
View File
@@ -350,25 +350,25 @@ typedef enum sci_status (*scic_sds_remote_device_high_priority_request_complete_
enum sci_io_status);
typedef enum sci_status (*scic_sds_remote_device_handler_t)(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
typedef enum sci_status (*scic_sds_remote_device_suspend_handler_t)(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 suspend_type);
typedef enum sci_status (*scic_sds_remote_device_resume_handler_t)(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
typedef enum sci_status (*scic_sds_remote_device_frame_handler_t)(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index);
typedef enum sci_status (*scic_sds_remote_device_event_handler_t)(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 event_code);
typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
/**
* struct scic_sds_remote_device_state_handler - This structure conains the
@@ -461,8 +461,8 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
*
* This macro incrments the request count for this device
*/
#define scic_sds_remote_device_increment_request_count(this_device) \
((this_device)->started_request_count++)
#define scic_sds_remote_device_increment_request_count(sci_dev) \
((sci_dev)->started_request_count++)
/**
* scic_sds_remote_device_decrement_request_count() -
@@ -470,33 +470,33 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
* This macro decrements the request count for this device. This count will
* never decrment past 0.
*/
#define scic_sds_remote_device_decrement_request_count(this_device) \
((this_device)->started_request_count > 0 ? \
(this_device)->started_request_count-- : 0)
#define scic_sds_remote_device_decrement_request_count(sci_dev) \
((sci_dev)->started_request_count > 0 ? \
(sci_dev)->started_request_count-- : 0)
/**
* scic_sds_remote_device_get_request_count() -
*
* This is a helper macro to return the current device request count.
*/
#define scic_sds_remote_device_get_request_count(this_device) \
((this_device)->started_request_count)
#define scic_sds_remote_device_get_request_count(sci_dev) \
((sci_dev)->started_request_count)
/**
* scic_sds_remote_device_get_port() -
*
* This macro returns the owning port of this remote device obejct.
*/
#define scic_sds_remote_device_get_port(this_device) \
((this_device)->owning_port)
#define scic_sds_remote_device_get_port(sci_dev) \
((sci_dev)->owning_port)
/**
* scic_sds_remote_device_get_controller() -
*
* This macro returns the controller object that contains this device object
*/
#define scic_sds_remote_device_get_controller(this_device) \
scic_sds_port_get_controller(scic_sds_remote_device_get_port(this_device))
#define scic_sds_remote_device_get_controller(sci_dev) \
scic_sds_port_get_controller(scic_sds_remote_device_get_port(sci_dev))
/**
* scic_sds_remote_device_set_state_handlers() -
@@ -504,26 +504,26 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
* This macro sets the remote device state handlers pointer and is set on entry
* to each device state.
*/
#define scic_sds_remote_device_set_state_handlers(this_device, handlers) \
((this_device)->state_handlers = (handlers))
#define scic_sds_remote_device_set_state_handlers(sci_dev, handlers) \
((sci_dev)->state_handlers = (handlers))
/**
* scic_sds_remote_device_get_port() -
*
* This macro returns the owning port of this device
*/
#define scic_sds_remote_device_get_port(this_device) \
((this_device)->owning_port)
#define scic_sds_remote_device_get_port(sci_dev) \
((sci_dev)->owning_port)
/**
* scic_sds_remote_device_get_sequence() -
*
* This macro returns the remote device sequence value
*/
#define scic_sds_remote_device_get_sequence(this_device) \
#define scic_sds_remote_device_get_sequence(sci_dev) \
(\
scic_sds_remote_device_get_controller(this_device)-> \
remote_device_sequence[(this_device)->rnc->remote_node_index] \
scic_sds_remote_device_get_controller(sci_dev)-> \
remote_device_sequence[(sci_dev)->rnc->remote_node_index] \
)
/**
@@ -531,11 +531,11 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
*
* This macro returns the controllers protocol engine group
*/
#define scic_sds_remote_device_get_controller_peg(this_device) \
#define scic_sds_remote_device_get_controller_peg(sci_dev) \
(\
scic_sds_controller_get_protocol_engine_group(\
scic_sds_port_get_controller(\
scic_sds_remote_device_get_port(this_device) \
scic_sds_remote_device_get_port(sci_dev) \
) \
) \
)
@@ -545,16 +545,16 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
*
* This macro returns the port index for the devices owning port
*/
#define scic_sds_remote_device_get_port_index(this_device) \
(scic_sds_port_get_index(scic_sds_remote_device_get_port(this_device)))
#define scic_sds_remote_device_get_port_index(sci_dev) \
(scic_sds_port_get_index(scic_sds_remote_device_get_port(sci_dev)))
/**
* scic_sds_remote_device_get_index() -
*
* This macro returns the remote node index for this device object
*/
#define scic_sds_remote_device_get_index(this_device) \
((this_device)->rnc->remote_node_index)
#define scic_sds_remote_device_get_index(sci_dev) \
((sci_dev)->rnc->remote_node_index)
/**
* scic_sds_remote_device_build_command_context() -
@@ -579,61 +579,61 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
((device)->working_request = (request))
enum sci_status scic_sds_remote_device_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index);
enum sci_status scic_sds_remote_device_event_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 event_code);
enum sci_status scic_sds_remote_device_start_io(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *io_request);
enum sci_status scic_sds_remote_device_complete_io(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *io_request);
enum sci_status scic_sds_remote_device_resume(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
enum sci_status scic_sds_remote_device_suspend(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 suspend_type);
enum sci_status scic_sds_remote_device_start_task(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *io_request);
void scic_sds_remote_device_post_request(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 request);
#if !defined(DISABLE_ATAPI)
bool scic_sds_remote_device_is_atapi(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
#else /* !defined(DISABLE_ATAPI) */
#define scic_sds_remote_device_is_atapi(this_device) false
#define scic_sds_remote_device_is_atapi(sci_dev) false
#endif /* !defined(DISABLE_ATAPI) */
void scic_sds_remote_device_start_request(
struct scic_sds_remote_device *this_device,
struct scic_sds_request *the_request,
struct scic_sds_remote_device *sci_dev,
struct scic_sds_request *sci_req,
enum sci_status status);
void scic_sds_remote_device_continue_request(void *sci_dev);
enum sci_status scic_sds_remote_device_default_start_handler(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
enum sci_status scic_sds_remote_device_default_fail_handler(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
enum sci_status scic_sds_remote_device_default_destruct_handler(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
enum sci_status scic_sds_remote_device_default_reset_handler(
struct scic_sds_remote_device *device);
@@ -654,15 +654,15 @@ enum sci_status scic_sds_remote_device_default_continue_request_handler(
struct scic_sds_request *request);
enum sci_status scic_sds_remote_device_default_suspend_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 suspend_type);
enum sci_status scic_sds_remote_device_default_resume_handler(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
enum sci_status scic_sds_remote_device_default_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index);
enum sci_status scic_sds_remote_device_ready_state_stop_handler(
@@ -672,14 +672,14 @@ enum sci_status scic_sds_remote_device_ready_state_reset_handler(
struct scic_sds_remote_device *device);
enum sci_status scic_sds_remote_device_general_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index);
enum sci_status scic_sds_remote_device_general_event_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 event_code);
enum sci_status scic_sds_ssp_remote_device_ready_suspended_substate_resume_handler(
struct scic_sds_remote_device *this_device);
struct scic_sds_remote_device *sci_dev);
#endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */
File diff suppressed because it is too large Load Diff
@@ -86,25 +86,25 @@ struct scic_sds_remote_node_context;
typedef void (*scics_sds_remote_node_context_callback)(void *);
typedef enum sci_status (*scic_sds_remote_node_context_operation)(
struct scic_sds_remote_node_context *this_rnc,
scics_sds_remote_node_context_callback the_callback,
struct scic_sds_remote_node_context *sci_rnc,
scics_sds_remote_node_context_callback callback,
void *callback_parameter
);
typedef enum sci_status (*scic_sds_remote_node_context_suspend_operation)(
struct scic_sds_remote_node_context *this_rnc,
struct scic_sds_remote_node_context *sci_rnc,
u32 suspension_type,
scics_sds_remote_node_context_callback the_callback,
scics_sds_remote_node_context_callback callback,
void *callback_parameter
);
typedef enum sci_status (*scic_sds_remote_node_context_io_request)(
struct scic_sds_remote_node_context *this_rnc,
struct scic_sds_request *the_request
struct scic_sds_remote_node_context *sci_rnc,
struct scic_sds_request *sci_req
);
typedef enum sci_status (*scic_sds_remote_node_context_event_handler)(
struct scic_sds_remote_node_context *this_rnc,
struct scic_sds_remote_node_context *sci_rnc,
u32 event_code
);
@@ -286,7 +286,7 @@ void scic_sds_remote_node_context_construct(
bool scic_sds_remote_node_context_is_ready(
struct scic_sds_remote_node_context *this_rnc);
struct scic_sds_remote_node_context *sci_rnc);
#define scic_sds_remote_node_context_get_remote_node_index(rcn) \
((rnc)->remote_node_index)
File diff suppressed because it is too large Load Diff
+20 -20
View File
@@ -336,32 +336,32 @@ extern const struct sci_base_state scic_sds_io_request_started_task_mgmt_substat
*
* This macro will return the controller for this io request object
*/
#define scic_sds_request_get_controller(this_request) \
((this_request)->owning_controller)
#define scic_sds_request_get_controller(sci_req) \
((sci_req)->owning_controller)
/**
* scic_sds_request_get_device() -
*
* This macro will return the device for this io request object
*/
#define scic_sds_request_get_device(this_request) \
((this_request)->target_device)
#define scic_sds_request_get_device(sci_req) \
((sci_req)->target_device)
/**
* scic_sds_request_get_port() -
*
* This macro will return the port for this io request object
*/
#define scic_sds_request_get_port(this_request) \
scic_sds_remote_device_get_port(scic_sds_request_get_device(this_request))
#define scic_sds_request_get_port(sci_req) \
scic_sds_remote_device_get_port(scic_sds_request_get_device(sci_req))
/**
* scic_sds_request_get_post_context() -
*
* This macro returns the constructed post context result for the io request.
*/
#define scic_sds_request_get_post_context(this_request) \
((this_request)->post_context)
#define scic_sds_request_get_post_context(sci_req) \
((sci_req)->post_context)
/**
* scic_sds_request_get_task_context() -
@@ -433,41 +433,41 @@ scic_sds_io_request_tc_completion(struct scic_sds_request *request, u32 completi
* ***************************************************************************** */
void scic_sds_request_build_sgl(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
void scic_sds_stp_request_assign_buffers(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
void scic_sds_smp_request_assign_buffers(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
/* --------------------------------------------------------------------------- */
enum sci_status scic_sds_request_start(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
enum sci_status scic_sds_io_request_terminate(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
enum sci_status scic_sds_io_request_complete(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
void scic_sds_io_request_copy_response(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
enum sci_status scic_sds_io_request_event_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 event_code);
enum sci_status scic_sds_io_request_frame_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 frame_index);
enum sci_status scic_sds_task_request_terminate(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
/*
* *****************************************************************************
@@ -475,10 +475,10 @@ enum sci_status scic_sds_task_request_terminate(
* ***************************************************************************** */
enum sci_status scic_sds_request_started_state_abort_handler(
struct scic_sds_request *request);
struct scic_sds_request *sci_req);
enum sci_status scic_sds_request_started_state_tc_completion_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 completion_code);
#endif /* _SCIC_SDS_IO_REQUEST_H_ */
@@ -142,15 +142,15 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
struct scic_sds_request *request)
{
enum sci_status status;
struct scic_sds_request *the_request;
struct scic_sds_request *sci_req;
the_request = (struct scic_sds_request *)request;
sci_req = (struct scic_sds_request *)request;
status = scic_sds_io_request_complete(the_request);
status = scic_sds_io_request_complete(sci_req);
if (status == SCI_SUCCESS) {
status = scic_sds_port_complete_io(
device->owning_port, device, the_request);
device->owning_port, device, sci_req);
if (status == SCI_SUCCESS) {
scic_sds_remote_device_decrement_request_count(device);
@@ -165,7 +165,7 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
"failed with status %d.\n",
__func__,
device,
the_request,
sci_req,
device->owning_port,
status);
}
@@ -175,13 +175,13 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
/**
* This is frame handler for smp device ready cmd substate.
* @this_device: This is the device object that is receiving the frame.
* @sci_dev: This is the device object that is receiving the frame.
* @frame_index: The index for the frame received.
*
* enum sci_status
*/
static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index)
{
enum sci_status status;
@@ -191,7 +191,7 @@ static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handl
* / in this state. All unsolicited frames are forwarded to the io request
* / object. */
status = scic_sds_io_request_frame_handler(
this_device->working_request,
sci_dev->working_request,
frame_index
);
+57 -57
View File
@@ -67,7 +67,7 @@
#include "scu_task_context.h"
static void scu_smp_request_construct_task_context(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
struct smp_request *smp_request);
/**
@@ -118,27 +118,27 @@ u32 scic_sds_smp_request_get_object_size(void)
/**
* This method build the remainder of the IO request object.
* @this_request: This parameter specifies the request object being constructed.
* @sci_req: This parameter specifies the request object being constructed.
*
* The scic_sds_general_request_construct() must be called before this call is
* valid. none
*/
void scic_sds_smp_request_assign_buffers(
struct scic_sds_request *this_request)
struct scic_sds_request *sci_req)
{
/* Assign all of the buffer pointers */
this_request->command_buffer =
scic_sds_smp_request_get_command_buffer(this_request);
this_request->response_buffer =
scic_sds_smp_request_get_response_buffer(this_request);
this_request->sgl_element_pair_buffer = NULL;
sci_req->command_buffer =
scic_sds_smp_request_get_command_buffer(sci_req);
sci_req->response_buffer =
scic_sds_smp_request_get_response_buffer(sci_req);
sci_req->sgl_element_pair_buffer = NULL;
if (this_request->was_tag_assigned_by_user == false) {
this_request->task_context_buffer =
scic_sds_smp_request_get_task_context_buffer(this_request);
this_request->task_context_buffer =
PTR_ALIGN(this_request->task_context_buffer, SMP_CACHE_BYTES);
if (sci_req->was_tag_assigned_by_user == false) {
sci_req->task_context_buffer =
scic_sds_smp_request_get_task_context_buffer(sci_req);
sci_req->task_context_buffer =
PTR_ALIGN(sci_req->task_context_buffer, SMP_CACHE_BYTES);
}
}
@@ -163,7 +163,7 @@ void scic_sds_smp_request_assign_buffers(
* (i.e. non-raw frame) is being utilized to perform task management. -#
* control_frame == 1. This ensures that the proper endianess is set so
* that the bytes are transmitted in the right order for a smp request frame.
* @this_request: This parameter specifies the smp request object being
* @sci_req: This parameter specifies the smp request object being
* constructed.
*
*/
@@ -295,7 +295,7 @@ static void scu_smp_request_construct_task_context(
* for a response frame. It will copy the response data, release the
* unsolicited frame, and transition the request to the
* SCI_BASE_REQUEST_STATE_COMPLETED state.
* @this_request: This parameter specifies the request for which the
* @sci_req: This parameter specifies the request for which the
* unsolicited frame was received.
* @frame_index: This parameter indicates the unsolicited frame index that
* should contain the response.
@@ -305,16 +305,16 @@ static void scu_smp_request_construct_task_context(
* indicates successful processing of the TC response.
*/
static enum sci_status scic_sds_smp_request_await_response_frame_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 frame_index)
{
enum sci_status status;
void *frame_header;
struct smp_response_header *this_frame_header;
u8 *user_smp_buffer = this_request->response_buffer;
struct smp_response_header *rsp_hdr;
u8 *user_smp_buffer = sci_req->response_buffer;
status = scic_sds_unsolicited_frame_control_get_header(
&(scic_sds_request_get_controller(this_request)->uf_control),
&(scic_sds_request_get_controller(sci_req)->uf_control),
frame_index,
&frame_header
);
@@ -325,13 +325,13 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
frame_header,
sizeof(struct smp_response_header) / sizeof(u32)
);
this_frame_header = (struct smp_response_header *)user_smp_buffer;
rsp_hdr = (struct smp_response_header *)user_smp_buffer;
if (this_frame_header->smp_frame_type == SMP_FRAME_TYPE_RESPONSE) {
if (rsp_hdr->smp_frame_type == SMP_FRAME_TYPE_RESPONSE) {
void *smp_response_buffer;
status = scic_sds_unsolicited_frame_control_get_buffer(
&(scic_sds_request_get_controller(this_request)->uf_control),
&(scic_sds_request_get_controller(sci_req)->uf_control),
frame_index,
&smp_response_buffer
);
@@ -341,23 +341,23 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
smp_response_buffer,
sizeof(union smp_response_body) / sizeof(u32)
);
if (this_frame_header->function == SMP_FUNCTION_DISCOVER) {
struct smp_response *this_smp_response;
if (rsp_hdr->function == SMP_FUNCTION_DISCOVER) {
struct smp_response *smp_resp;
this_smp_response = (struct smp_response *)user_smp_buffer;
smp_resp = (struct smp_response *)user_smp_buffer;
/*
* Some expanders only report an attached SATA device, and
* not an STP target. Since the core depends on the STP
* target attribute to correctly build I/O, set the bit now
* if necessary. */
if (this_smp_response->response.discover.protocols.u.bits.attached_sata_device
&& !this_smp_response->response.discover.protocols.u.bits.attached_stp_target) {
this_smp_response->response.discover.protocols.u.bits.attached_stp_target = 1;
if (smp_resp->response.discover.protocols.u.bits.attached_sata_device
&& !smp_resp->response.discover.protocols.u.bits.attached_stp_target) {
smp_resp->response.discover.protocols.u.bits.attached_stp_target = 1;
dev_dbg(scic_to_dev(this_request->owning_controller),
dev_dbg(scic_to_dev(sci_req->owning_controller),
"%s: scic_sds_smp_request_await_response_frame_handler(0x%p) Found SATA dev, setting STP bit.\n",
__func__, this_request);
__func__, sci_req);
}
}
@@ -367,40 +367,40 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
/*
* copy the smp response to framework smp request's response buffer.
* scic_sds_smp_request_copy_response(this_request); */
* scic_sds_smp_request_copy_response(sci_req); */
scic_sds_request_set_status(
this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
);
sci_base_state_machine_change_state(
&this_request->started_substate_machine,
&sci_req->started_substate_machine,
SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION
);
} else {
/* This was not a response frame why did it get forwarded? */
dev_err(scic_to_dev(this_request->owning_controller),
dev_err(scic_to_dev(sci_req->owning_controller),
"%s: SCIC SMP Request 0x%p received unexpected frame "
"%d type 0x%02x\n",
__func__,
this_request,
sci_req,
frame_index,
this_frame_header->smp_frame_type);
rsp_hdr->smp_frame_type);
scic_sds_request_set_status(
this_request,
sci_req,
SCU_TASK_DONE_SMP_FRM_TYPE_ERR,
SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED
);
}
scic_sds_controller_release_frame(
this_request->owning_controller, frame_index
sci_req->owning_controller, frame_index
);
return SCI_SUCCESS;
@@ -411,7 +411,7 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
* This method processes an abnormal TC completion while the SMP request is
* waiting for a response frame. It decides what happened to the IO based
* on TC completion status.
* @this_request: This parameter specifies the request for which the TC
* @sci_req: This parameter specifies the request for which the TC
* completion was received.
* @completion_code: This parameter indicates the completion status information
* for the TC.
@@ -420,7 +420,7 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
* this method always returns success.
*/
static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 completion_code)
{
switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
@@ -429,11 +429,11 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
* In the AWAIT RESPONSE state, any TC completion is unexpected.
* but if the TC has success status, we complete the IO anyway. */
scic_sds_request_set_status(
this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
@@ -447,11 +447,11 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
* break the connection and set TC completion with one of these SMP_XXX_XX_ERR
* status. For these type of error, we ask scic user to retry the request. */
scic_sds_request_set_status(
this_request, SCU_TASK_DONE_SMP_RESP_TO_ERR, SCI_FAILURE_RETRY_REQUIRED
sci_req, SCU_TASK_DONE_SMP_RESP_TO_ERR, SCI_FAILURE_RETRY_REQUIRED
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
@@ -460,13 +460,13 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
* All other completion status cause the IO to be complete. If a NAK
* was received, then it is up to the user to retry the request. */
scic_sds_request_set_status(
this_request,
sci_req,
SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
}
@@ -480,7 +480,7 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
* determine if the SMP request was sent successfully. If the SMP request
* was sent successfully, then the state for the SMP request transits to
* waiting for a response frame.
* @this_request: This parameter specifies the request for which the TC
* @sci_req: This parameter specifies the request for which the TC
* completion was received.
* @completion_code: This parameter indicates the completion status information
* for the TC.
@@ -489,17 +489,17 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
* this method always returns success.
*/
static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 completion_code)
{
switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
scic_sds_request_set_status(
this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
@@ -508,13 +508,13 @@ static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_ha
* All other completion status cause the IO to be complete. If a NAK
* was received, then it is up to the user to retry the request. */
scic_sds_request_set_status(
this_request,
sci_req,
SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
);
sci_base_state_machine_change_state(
&this_request->state_machine,
&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
}
@@ -547,10 +547,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_smp_request_start
static void scic_sds_smp_request_started_await_response_substate_enter(
struct sci_base_object *object)
{
struct scic_sds_request *this_request = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
SET_STATE_HANDLER(
this_request,
sci_req,
scic_sds_smp_request_started_substate_handler_table,
SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE
);
@@ -568,10 +568,10 @@ static void scic_sds_smp_request_started_await_response_substate_enter(
static void scic_sds_smp_request_started_await_tc_completion_substate_enter(
struct sci_base_object *object)
{
struct scic_sds_request *this_request = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
SET_STATE_HANDLER(
this_request,
sci_req,
scic_sds_smp_request_started_substate_handler_table,
SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION
);
@@ -62,8 +62,7 @@
u32 scic_sds_smp_request_get_object_size(void);
void scic_sds_smp_request_copy_response(
struct scic_sds_request *this_request);
void scic_sds_smp_request_copy_response(struct scic_sds_request *sci_req);
#endif /* _SCIC_SDS_SMP_REQUEST_T_ */
+15 -15
View File
@@ -67,7 +67,7 @@
* determine if the RAW task management frame was sent successfully. If the
* raw frame was sent successfully, then the state for the task request
* transitions to waiting for a response frame.
* @this_request: This parameter specifies the request for which the TC
* @sci_req: This parameter specifies the request for which the TC
* completion was received.
* @completion_code: This parameter indicates the completion status information
* for the TC.
@@ -76,17 +76,17 @@
* this method always returns success.
*/
static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
u32 completion_code)
{
switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
scic_sds_request_set_status(
this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
);
sci_base_state_machine_change_state(
&this_request->started_substate_machine,
&sci_req->started_substate_machine,
SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
);
break;
@@ -97,15 +97,15 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
* timeout if the task IU wasn't received successfully.
* There is a potential for receiving multiple task responses if we
* decide to send the task IU again. */
dev_warn(scic_to_dev(this_request->owning_controller),
dev_warn(scic_to_dev(sci_req->owning_controller),
"%s: TaskRequest:0x%p CompletionCode:%x - "
"ACK/NAK timeout\n",
__func__,
this_request,
sci_req,
completion_code);
sci_base_state_machine_change_state(
&this_request->started_substate_machine,
&sci_req->started_substate_machine,
SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
);
break;
@@ -115,12 +115,12 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
* All other completion status cause the IO to be complete. If a NAK
* was received, then it is up to the user to retry the request. */
scic_sds_request_set_status(
this_request,
sci_req,
SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
);
sci_base_state_machine_change_state(&this_request->state_machine,
sci_base_state_machine_change_state(&sci_req->state_machine,
SCI_BASE_REQUEST_STATE_COMPLETED);
break;
}
@@ -132,7 +132,7 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
* This method is responsible for processing a terminate/abort request for this
* TC while the request is waiting for the task management response
* unsolicited frame.
* @this_request: This parameter specifies the request for which the
* @sci_req: This parameter specifies the request for which the
* termination was requested.
*
* This method returns an indication as to whether the abort request was
@@ -155,7 +155,7 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_response_abort_handler
* waiting for a response frame. It will copy the response data, release
* the unsolicited frame, and transition the request to the
* SCI_BASE_REQUEST_STATE_COMPLETED state.
* @this_request: This parameter specifies the request for which the
* @sci_req: This parameter specifies the request for which the
* unsolicited frame was received.
* @frame_index: This parameter indicates the unsolicited frame index that
* should contain the response.
@@ -202,10 +202,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_ssp_task_request_
static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_enter(
struct sci_base_object *object)
{
struct scic_sds_request *this_request = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
SET_STATE_HANDLER(
this_request,
sci_req,
scic_sds_ssp_task_request_started_substate_handler_table,
SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION
);
@@ -223,10 +223,10 @@ static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_e
static void scic_sds_io_request_started_task_mgmt_await_task_response_substate_enter(
struct sci_base_object *object)
{
struct scic_sds_request *this_request = (struct scic_sds_request *)object;
struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
SET_STATE_HANDLER(
this_request,
sci_req,
scic_sds_ssp_task_request_started_substate_handler_table,
SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
);
File diff suppressed because it is too large Load Diff
@@ -113,14 +113,14 @@ extern const struct scic_sds_io_request_state_handler scic_sds_stp_packet_reques
#if !defined(DISABLE_ATAPI)
enum sci_status scic_sds_stp_packet_request_construct(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
#else /* !defined(DISABLE_ATAPI) */
#define scic_sds_stp_packet_request_construct(request) SCI_FAILURE
#endif /* !defined(DISABLE_ATAPI) */
#if !defined(DISABLE_ATAPI)
void scu_stp_packet_request_command_phase_construct_task_context(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
struct scu_task_context *task_context);
#else /* !defined(DISABLE_ATAPI) */
#define scu_stp_packet_request_command_phase_construct_task_context(reqeust, tc)
@@ -128,7 +128,7 @@ void scu_stp_packet_request_command_phase_construct_task_context(
#if !defined(DISABLE_ATAPI)
void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
struct scu_task_context *task_context);
#else /* !defined(DISABLE_ATAPI) */
#define scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(reqeust, tc)
@@ -136,7 +136,7 @@ void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
#if !defined(DISABLE_ATAPI)
enum sci_status scic_sds_stp_packet_request_process_status_fis(
struct scic_sds_request *this_request,
struct scic_sds_request *sci_req,
struct sata_fis_reg_d2h *status_fis);
#else /* !defined(DISABLE_ATAPI) */
#define scic_sds_stp_packet_request_process_status_fis(reqeust, fis) SCI_FAILURE
@@ -144,7 +144,7 @@ enum sci_status scic_sds_stp_packet_request_process_status_fis(
#if !defined(DISABLE_ATAPI)
void scic_sds_stp_packet_internal_request_sense_build_sgl(
struct scic_sds_request *this_request);
struct scic_sds_request *sci_req);
#else /* !defined(DISABLE_ATAPI) */
#define scic_sds_stp_packet_internal_request_sense_build_sgl(request)
#endif /* !defined(DISABLE_ATAPI) */
@@ -252,18 +252,18 @@ out:
* resume the RNC right away. enum sci_status
*/
static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 event_code)
{
enum sci_status status;
status = scic_sds_remote_device_general_event_handler(this_device, event_code);
status = scic_sds_remote_device_general_event_handler(sci_dev, event_code);
if (status == SCI_SUCCESS) {
if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
|| scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) {
status = scic_sds_remote_node_context_resume(
this_device->rnc, NULL, NULL);
sci_dev->rnc, NULL, NULL);
}
}
@@ -312,21 +312,21 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_start_io_ha
/**
* This method will handle events received while the STP device is in the ready
* command substate.
* @this_device: This is the device object that is receiving the event.
* @sci_dev: This is the device object that is receiving the event.
* @event_code: The event code to process.
*
* enum sci_status
*/
static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index)
{
enum sci_status status;
struct sata_fis_header *frame_header;
status = scic_sds_unsolicited_frame_control_get_header(
&(scic_sds_remote_device_get_controller(this_device)->uf_control),
&(scic_sds_remote_device_get_controller(sci_dev)->uf_control),
frame_index,
(void **)&frame_header
);
@@ -334,7 +334,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
if (status == SCI_SUCCESS) {
if (frame_header->fis_type == SATA_FIS_TYPE_SETDEVBITS &&
(frame_header->status & ATA_STATUS_REG_ERROR_BIT)) {
this_device->not_ready_reason =
sci_dev->not_ready_reason =
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
/*
@@ -343,7 +343,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
*/
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
&sci_dev->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
} else if (frame_header->fis_type == SATA_FIS_TYPE_REGD2H &&
@@ -353,11 +353,11 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
* Some devices return D2H FIS when an NCQ error is detected.
* Treat this like an SDB error FIS ready reason.
*/
this_device->not_ready_reason =
sci_dev->not_ready_reason =
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
&sci_dev->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
} else {
@@ -365,7 +365,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
}
scic_sds_controller_release_frame(
scic_sds_remote_device_get_controller(this_device), frame_index
scic_sds_remote_device_get_controller(sci_dev), frame_index
);
}
@@ -393,20 +393,20 @@ static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_start_io_ha
}
static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 suspend_type)
{
enum sci_status status;
status = scic_sds_remote_node_context_suspend(
this_device->rnc, suspend_type, NULL, NULL
sci_dev->rnc, suspend_type, NULL, NULL
);
return status;
}
static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 frame_index)
{
enum sci_status status;
@@ -416,7 +416,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handl
* / in this state. All unsolicited frames are forwarded to the io request
* / object. */
status = scic_sds_io_request_frame_handler(
this_device->working_request,
sci_dev->working_request,
frame_index
);
@@ -461,14 +461,14 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
struct scic_sds_remote_device *device,
struct scic_sds_request *request)
{
struct scic_sds_request *the_request = (struct scic_sds_request *)request;
struct scic_sds_request *sci_req = (struct scic_sds_request *)request;
enum sci_status status;
status = scic_sds_io_request_complete(the_request);
status = scic_sds_io_request_complete(sci_req);
if (status == SCI_SUCCESS) {
status = scic_sds_port_complete_io(
device->owning_port, device, the_request
device->owning_port, device, sci_req
);
if (status == SCI_SUCCESS)
@@ -482,7 +482,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
__func__,
device->owning_port,
device,
the_request,
sci_req,
status);
return status;
@@ -505,20 +505,20 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
* this device. enum sci_status
*/
enum sci_status scic_sds_stp_remote_device_ready_atapi_error_substate_event_handler(
struct scic_sds_remote_device *this_device,
struct scic_sds_remote_device *sci_dev,
u32 event_code)
{
enum sci_status status;
status = scic_sds_remote_device_general_event_handler(this_device, event_code);
status = scic_sds_remote_device_general_event_handler(sci_dev, event_code);
if (status == SCI_SUCCESS) {
if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
|| scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) {
status = scic_sds_remote_node_context_resume(
this_device->rnc,
this_device->working_request->state_handlers->parent.complete_handler,
(void *)this_device->working_request
sci_dev->rnc,
sci_dev->working_request->state_handlers->parent.complete_handler,
(void *)sci_dev->working_request
);
}
}
@@ -673,30 +673,30 @@ scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *use
static void scic_sds_stp_remote_device_ready_idle_substate_enter(
struct sci_base_object *device)
{
struct scic_sds_remote_device *this_device;
struct scic_sds_remote_device *sci_dev;
this_device = (struct scic_sds_remote_device *)device;
sci_dev = (struct scic_sds_remote_device *)device;
SET_STATE_HANDLER(
this_device,
sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE
);
this_device->working_request = NULL;
sci_dev->working_request = NULL;
if (scic_sds_remote_node_context_is_ready(this_device->rnc)) {
if (scic_sds_remote_node_context_is_ready(sci_dev->rnc)) {
/*
* Since the RNC is ready, it's alright to finish completion
* processing (e.g. signal the remote device is ready). */
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
this_device
sci_dev
);
} else {
scic_sds_remote_node_context_resume(
this_device->rnc,
sci_dev->rnc,
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler,
this_device
sci_dev
);
}
}
@@ -759,12 +759,12 @@ static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci
static void scic_sds_stp_remote_device_ready_await_reset_substate_enter(
struct sci_base_object *device)
{
struct scic_sds_remote_device *this_device;
struct scic_sds_remote_device *sci_dev;
this_device = (struct scic_sds_remote_device *)device;
sci_dev = (struct scic_sds_remote_device *)device;
SET_STATE_HANDLER(
this_device,
sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET
);
@@ -785,12 +785,12 @@ static void scic_sds_stp_remote_device_ready_await_reset_substate_enter(
void scic_sds_stp_remote_device_ready_atapi_error_substate_enter(
struct sci_base_object *device)
{
struct scic_sds_remote_device *this_device;
struct scic_sds_remote_device *sci_dev;
this_device = (struct scic_sds_remote_device *)device;
sci_dev = (struct scic_sds_remote_device *)device;
SET_STATE_HANDLER(
this_device,
sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR
);
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More