aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/remote_device.h')
-rw-r--r--drivers/scsi/isci/remote_device.h90
1 files changed, 43 insertions, 47 deletions
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h
index bc4da20a13f..fa9a0e6cc30 100644
--- a/drivers/scsi/isci/remote_device.h
+++ b/drivers/scsi/isci/remote_device.h
@@ -61,7 +61,7 @@
61#include "remote_node_context.h" 61#include "remote_node_context.h"
62#include "port.h" 62#include "port.h"
63 63
64enum scic_remote_device_not_ready_reason_code { 64enum sci_remote_device_not_ready_reason_code {
65 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED, 65 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED,
66 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED, 66 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED,
67 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED, 67 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED,
@@ -97,7 +97,7 @@ struct isci_remote_device {
97 enum sas_linkrate connection_rate; 97 enum sas_linkrate connection_rate;
98 bool is_direct_attached; 98 bool is_direct_attached;
99 struct isci_port *owning_port; 99 struct isci_port *owning_port;
100 struct scic_sds_remote_node_context rnc; 100 struct sci_remote_node_context rnc;
101 /* XXX unify with device reference counting and delete */ 101 /* XXX unify with device reference counting and delete */
102 u32 started_request_count; 102 u32 started_request_count;
103 struct isci_request *working_request; 103 struct isci_request *working_request;
@@ -106,7 +106,7 @@ struct isci_remote_device {
106 106
107#define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000 107#define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000
108 108
109/* device reference routines must be called under scic_lock */ 109/* device reference routines must be called under sci_lock */
110static inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev) 110static inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev)
111{ 111{
112 struct isci_remote_device *idev = dev->lldd_dev; 112 struct isci_remote_device *idev = dev->lldd_dev;
@@ -137,7 +137,7 @@ bool isci_device_is_reset_pending(struct isci_host *ihost,
137void isci_device_clear_reset_pending(struct isci_host *ihost, 137void isci_device_clear_reset_pending(struct isci_host *ihost,
138 struct isci_remote_device *idev); 138 struct isci_remote_device *idev);
139/** 139/**
140 * scic_remote_device_stop() - This method will stop both transmission and 140 * sci_remote_device_stop() - This method will stop both transmission and
141 * reception of link activity for the supplied remote device. This method 141 * reception of link activity for the supplied remote device. This method
142 * disables normal IO requests from flowing through to the remote device. 142 * disables normal IO requests from flowing through to the remote device.
143 * @remote_device: This parameter specifies the device to be stopped. 143 * @remote_device: This parameter specifies the device to be stopped.
@@ -148,12 +148,12 @@ void isci_device_clear_reset_pending(struct isci_host *ihost,
148 * This value is returned if the transmission and reception for the device was 148 * This value is returned if the transmission and reception for the device was
149 * successfully stopped. 149 * successfully stopped.
150 */ 150 */
151enum sci_status scic_remote_device_stop( 151enum sci_status sci_remote_device_stop(
152 struct isci_remote_device *idev, 152 struct isci_remote_device *idev,
153 u32 timeout); 153 u32 timeout);
154 154
155/** 155/**
156 * scic_remote_device_reset() - This method will reset the device making it 156 * sci_remote_device_reset() - This method will reset the device making it
157 * ready for operation. This method must be called anytime the device is 157 * ready for operation. This method must be called anytime the device is
158 * reset either through a SMP phy control or a port hard reset request. 158 * reset either through a SMP phy control or a port hard reset request.
159 * @remote_device: This parameter specifies the device to be reset. 159 * @remote_device: This parameter specifies the device to be reset.
@@ -164,11 +164,11 @@ enum sci_status scic_remote_device_stop(
164 * was accepted. SCI_SUCCESS This value is returned if the device reset is 164 * was accepted. SCI_SUCCESS This value is returned if the device reset is
165 * started. 165 * started.
166 */ 166 */
167enum sci_status scic_remote_device_reset( 167enum sci_status sci_remote_device_reset(
168 struct isci_remote_device *idev); 168 struct isci_remote_device *idev);
169 169
170/** 170/**
171 * scic_remote_device_reset_complete() - This method informs the device object 171 * sci_remote_device_reset_complete() - This method informs the device object
172 * that the reset operation is complete and the device can resume operation 172 * that the reset operation is complete and the device can resume operation
173 * again. 173 * again.
174 * @remote_device: This parameter specifies the device which is to be informed 174 * @remote_device: This parameter specifies the device which is to be informed
@@ -177,18 +177,16 @@ enum sci_status scic_remote_device_reset(
177 * An indication that the device is resuming operation. SCI_SUCCESS the device 177 * An indication that the device is resuming operation. SCI_SUCCESS the device
178 * is resuming operation. 178 * is resuming operation.
179 */ 179 */
180enum sci_status scic_remote_device_reset_complete( 180enum sci_status sci_remote_device_reset_complete(
181 struct isci_remote_device *idev); 181 struct isci_remote_device *idev);
182 182
183#define scic_remote_device_is_atapi(device_handle) false
184
185/** 183/**
186 * enum scic_sds_remote_device_states - This enumeration depicts all the states 184 * enum sci_remote_device_states - This enumeration depicts all the states
187 * for the common remote device state machine. 185 * for the common remote device state machine.
188 * 186 *
189 * 187 *
190 */ 188 */
191enum scic_sds_remote_device_states { 189enum sci_remote_device_states {
192 /** 190 /**
193 * Simply the initial state for the base remote device state machine. 191 * Simply the initial state for the base remote device state machine.
194 */ 192 */
@@ -293,7 +291,7 @@ enum scic_sds_remote_device_states {
293 SCI_DEV_FINAL, 291 SCI_DEV_FINAL,
294}; 292};
295 293
296static inline struct isci_remote_device *rnc_to_dev(struct scic_sds_remote_node_context *rnc) 294static inline struct isci_remote_device *rnc_to_dev(struct sci_remote_node_context *rnc)
297{ 295{
298 struct isci_remote_device *idev; 296 struct isci_remote_device *idev;
299 297
@@ -308,122 +306,120 @@ static inline bool dev_is_expander(struct domain_device *dev)
308} 306}
309 307
310/** 308/**
311 * scic_sds_remote_device_increment_request_count() - 309 * sci_remote_device_increment_request_count() -
312 * 310 *
313 * This macro incrments the request count for this device 311 * This macro incrments the request count for this device
314 */ 312 */
315#define scic_sds_remote_device_increment_request_count(idev) \ 313#define sci_remote_device_increment_request_count(idev) \
316 ((idev)->started_request_count++) 314 ((idev)->started_request_count++)
317 315
318/** 316/**
319 * scic_sds_remote_device_decrement_request_count() - 317 * sci_remote_device_decrement_request_count() -
320 * 318 *
321 * This macro decrements the request count for this device. This count will 319 * This macro decrements the request count for this device. This count will
322 * never decrment past 0. 320 * never decrment past 0.
323 */ 321 */
324#define scic_sds_remote_device_decrement_request_count(idev) \ 322#define sci_remote_device_decrement_request_count(idev) \
325 ((idev)->started_request_count > 0 ? \ 323 ((idev)->started_request_count > 0 ? \
326 (idev)->started_request_count-- : 0) 324 (idev)->started_request_count-- : 0)
327 325
328/** 326/**
329 * scic_sds_remote_device_get_request_count() - 327 * sci_remote_device_get_request_count() -
330 * 328 *
331 * This is a helper macro to return the current device request count. 329 * This is a helper macro to return the current device request count.
332 */ 330 */
333#define scic_sds_remote_device_get_request_count(idev) \ 331#define sci_remote_device_get_request_count(idev) \
334 ((idev)->started_request_count) 332 ((idev)->started_request_count)
335 333
336/** 334/**
337 * scic_sds_remote_device_get_controller() - 335 * sci_remote_device_get_controller() -
338 * 336 *
339 * This macro returns the controller object that contains this device object 337 * This macro returns the controller object that contains this device object
340 */ 338 */
341#define scic_sds_remote_device_get_controller(idev) \ 339#define sci_remote_device_get_controller(idev) \
342 scic_sds_port_get_controller(scic_sds_remote_device_get_port(idev)) 340 sci_port_get_controller(sci_remote_device_get_port(idev))
343 341
344/** 342/**
345 * scic_sds_remote_device_get_port() - 343 * sci_remote_device_get_port() -
346 * 344 *
347 * This macro returns the owning port of this device 345 * This macro returns the owning port of this device
348 */ 346 */
349#define scic_sds_remote_device_get_port(idev) \ 347#define sci_remote_device_get_port(idev) \
350 ((idev)->owning_port) 348 ((idev)->owning_port)
351 349
352/** 350/**
353 * scic_sds_remote_device_get_controller_peg() - 351 * sci_remote_device_get_controller_peg() -
354 * 352 *
355 * This macro returns the controllers protocol engine group 353 * This macro returns the controllers protocol engine group
356 */ 354 */
357#define scic_sds_remote_device_get_controller_peg(idev) \ 355#define sci_remote_device_get_controller_peg(idev) \
358 (\ 356 (\
359 scic_sds_controller_get_protocol_engine_group(\ 357 sci_controller_get_protocol_engine_group(\
360 scic_sds_port_get_controller(\ 358 sci_port_get_controller(\
361 scic_sds_remote_device_get_port(idev) \ 359 sci_remote_device_get_port(idev) \
362 ) \ 360 ) \
363 ) \ 361 ) \
364 ) 362 )
365 363
366/** 364/**
367 * scic_sds_remote_device_get_index() - 365 * sci_remote_device_get_index() -
368 * 366 *
369 * This macro returns the remote node index for this device object 367 * This macro returns the remote node index for this device object
370 */ 368 */
371#define scic_sds_remote_device_get_index(idev) \ 369#define sci_remote_device_get_index(idev) \
372 ((idev)->rnc.remote_node_index) 370 ((idev)->rnc.remote_node_index)
373 371
374/** 372/**
375 * scic_sds_remote_device_build_command_context() - 373 * sci_remote_device_build_command_context() -
376 * 374 *
377 * This macro builds a remote device context for the SCU post request operation 375 * This macro builds a remote device context for the SCU post request operation
378 */ 376 */
379#define scic_sds_remote_device_build_command_context(device, command) \ 377#define sci_remote_device_build_command_context(device, command) \
380 ((command) \ 378 ((command) \
381 | (scic_sds_remote_device_get_controller_peg((device)) << SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) \ 379 | (sci_remote_device_get_controller_peg((device)) << SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) \
382 | ((device)->owning_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) \ 380 | ((device)->owning_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) \
383 | (scic_sds_remote_device_get_index((device))) \ 381 | (sci_remote_device_get_index((device))) \
384 ) 382 )
385 383
386/** 384/**
387 * scic_sds_remote_device_set_working_request() - 385 * sci_remote_device_set_working_request() -
388 * 386 *
389 * This macro makes the working request assingment for the remote device 387 * This macro makes the working request assingment for the remote device
390 * object. To clear the working request use this macro with a NULL request 388 * object. To clear the working request use this macro with a NULL request
391 * object. 389 * object.
392 */ 390 */
393#define scic_sds_remote_device_set_working_request(device, request) \ 391#define sci_remote_device_set_working_request(device, request) \
394 ((device)->working_request = (request)) 392 ((device)->working_request = (request))
395 393
396enum sci_status scic_sds_remote_device_frame_handler( 394enum sci_status sci_remote_device_frame_handler(
397 struct isci_remote_device *idev, 395 struct isci_remote_device *idev,
398 u32 frame_index); 396 u32 frame_index);
399 397
400enum sci_status scic_sds_remote_device_event_handler( 398enum sci_status sci_remote_device_event_handler(
401 struct isci_remote_device *idev, 399 struct isci_remote_device *idev,
402 u32 event_code); 400 u32 event_code);
403 401
404enum sci_status scic_sds_remote_device_start_io( 402enum sci_status sci_remote_device_start_io(
405 struct isci_host *ihost, 403 struct isci_host *ihost,
406 struct isci_remote_device *idev, 404 struct isci_remote_device *idev,
407 struct isci_request *ireq); 405 struct isci_request *ireq);
408 406
409enum sci_status scic_sds_remote_device_start_task( 407enum sci_status sci_remote_device_start_task(
410 struct isci_host *ihost, 408 struct isci_host *ihost,
411 struct isci_remote_device *idev, 409 struct isci_remote_device *idev,
412 struct isci_request *ireq); 410 struct isci_request *ireq);
413 411
414enum sci_status scic_sds_remote_device_complete_io( 412enum sci_status sci_remote_device_complete_io(
415 struct isci_host *ihost, 413 struct isci_host *ihost,
416 struct isci_remote_device *idev, 414 struct isci_remote_device *idev,
417 struct isci_request *ireq); 415 struct isci_request *ireq);
418 416
419enum sci_status scic_sds_remote_device_suspend( 417enum sci_status sci_remote_device_suspend(
420 struct isci_remote_device *idev, 418 struct isci_remote_device *idev,
421 u32 suspend_type); 419 u32 suspend_type);
422 420
423void scic_sds_remote_device_post_request( 421void sci_remote_device_post_request(
424 struct isci_remote_device *idev, 422 struct isci_remote_device *idev,
425 u32 request); 423 u32 request);
426 424
427#define scic_sds_remote_device_is_atapi(idev) false
428
429#endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */ 425#endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */