aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-07-01 05:25:15 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:52 -0400
commit34a991587a5cc9f78960c2c9beea217866458c41 (patch)
tree824bfb5d50705223339e2bd3369ae3194f2eece3 /drivers/scsi/isci/remote_device.h
parent89a7301f21fb00e753089671eb9e4132aab8ea08 (diff)
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/remote_device.h')
-rw-r--r--drivers/scsi/isci/remote_device.h97
1 files changed, 12 insertions, 85 deletions
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h
index fa9a0e6cc309..57ccfc3d6ad3 100644
--- a/drivers/scsi/isci/remote_device.h
+++ b/drivers/scsi/isci/remote_device.h
@@ -305,91 +305,18 @@ static inline bool dev_is_expander(struct domain_device *dev)
305 return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV; 305 return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV;
306} 306}
307 307
308/** 308static inline void sci_remote_device_decrement_request_count(struct isci_remote_device *idev)
309 * sci_remote_device_increment_request_count() - 309{
310 * 310 /* XXX delete this voodoo when converting to the top-level device
311 * This macro incrments the request count for this device 311 * reference count
312 */ 312 */
313#define sci_remote_device_increment_request_count(idev) \ 313 if (WARN_ONCE(idev->started_request_count == 0,
314 ((idev)->started_request_count++) 314 "%s: tried to decrement started_request_count past 0!?",
315 315 __func__))
316/** 316 /* pass */;
317 * sci_remote_device_decrement_request_count() - 317 else
318 * 318 idev->started_request_count--;
319 * This macro decrements the request count for this device. This count will 319}
320 * never decrment past 0.
321 */
322#define sci_remote_device_decrement_request_count(idev) \
323 ((idev)->started_request_count > 0 ? \
324 (idev)->started_request_count-- : 0)
325
326/**
327 * sci_remote_device_get_request_count() -
328 *
329 * This is a helper macro to return the current device request count.
330 */
331#define sci_remote_device_get_request_count(idev) \
332 ((idev)->started_request_count)
333
334/**
335 * sci_remote_device_get_controller() -
336 *
337 * This macro returns the controller object that contains this device object
338 */
339#define sci_remote_device_get_controller(idev) \
340 sci_port_get_controller(sci_remote_device_get_port(idev))
341
342/**
343 * sci_remote_device_get_port() -
344 *
345 * This macro returns the owning port of this device
346 */
347#define sci_remote_device_get_port(idev) \
348 ((idev)->owning_port)
349
350/**
351 * sci_remote_device_get_controller_peg() -
352 *
353 * This macro returns the controllers protocol engine group
354 */
355#define sci_remote_device_get_controller_peg(idev) \
356 (\
357 sci_controller_get_protocol_engine_group(\
358 sci_port_get_controller(\
359 sci_remote_device_get_port(idev) \
360 ) \
361 ) \
362 )
363
364/**
365 * sci_remote_device_get_index() -
366 *
367 * This macro returns the remote node index for this device object
368 */
369#define sci_remote_device_get_index(idev) \
370 ((idev)->rnc.remote_node_index)
371
372/**
373 * sci_remote_device_build_command_context() -
374 *
375 * This macro builds a remote device context for the SCU post request operation
376 */
377#define sci_remote_device_build_command_context(device, command) \
378 ((command) \
379 | (sci_remote_device_get_controller_peg((device)) << SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) \
380 | ((device)->owning_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) \
381 | (sci_remote_device_get_index((device))) \
382 )
383
384/**
385 * sci_remote_device_set_working_request() -
386 *
387 * This macro makes the working request assingment for the remote device
388 * object. To clear the working request use this macro with a NULL request
389 * object.
390 */
391#define sci_remote_device_set_working_request(device, request) \
392 ((device)->working_request = (request))
393 320
394enum sci_status sci_remote_device_frame_handler( 321enum sci_status sci_remote_device_frame_handler(
395 struct isci_remote_device *idev, 322 struct isci_remote_device *idev,