diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-03-31 16:10:44 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:36 -0400 |
commit | 4393aa4e6b9517a666f0ef6b774fd421a9dc4c68 (patch) | |
tree | ec5e0c222d16f2368e5589a11fc4ec191ceca365 /drivers/scsi/isci/remote_device.h | |
parent | 037afc7812e2b202fbc18218e6c0eff34dad36ed (diff) |
isci: fix fragile/conditional isci_host lookups
A domain_device can always reference back to ->lldd_ha unlike local lldd
structures. Fix up cases where the driver uses local objects to look up the
isci_host. This also changes the calling conventions of some routines to
expect a valid isci_host parameter rather than re-lookup the pointer on entry.
Incidentally cleans up some macros that are longer to type than the open-coded
equivalent:
isci_host_from_sas_ha
isci_dev_from_domain_dev
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.h | 62 |
1 files changed, 16 insertions, 46 deletions
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h index cf5302abb8b2..9925316ac55a 100644 --- a/drivers/scsi/isci/remote_device.h +++ b/drivers/scsi/isci/remote_device.h | |||
@@ -78,59 +78,29 @@ static inline struct scic_sds_remote_device *to_sci_dev(struct isci_remote_devic | |||
78 | return (struct scic_sds_remote_device *) &idev[1]; | 78 | return (struct scic_sds_remote_device *) &idev[1]; |
79 | } | 79 | } |
80 | 80 | ||
81 | #define to_isci_remote_device(p) \ | ||
82 | container_of(p, struct isci_remote_device, sci_remote_device); | ||
83 | |||
84 | #define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000 | 81 | #define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000 |
85 | 82 | ||
86 | 83 | void isci_remote_device_start_complete(struct isci_host *ihost, | |
87 | /** | 84 | struct isci_remote_device *idev, |
88 | * isci_dev_from_domain_dev() - This accessor retrieves the remote_device | 85 | enum sci_status); |
89 | * object reference from the Linux domain_device reference. | 86 | void isci_remote_device_stop_complete(struct isci_host *ihost, |
90 | * @domdev,: This parameter points to the Linux domain_device object . | 87 | struct isci_remote_device *idev, |
91 | * | 88 | enum sci_status); |
92 | * A reference to the associated isci remote device. | ||
93 | */ | ||
94 | #define isci_dev_from_domain_dev(domdev) \ | ||
95 | ((struct isci_remote_device *)(domdev)->lldd_dev) | ||
96 | |||
97 | void isci_remote_device_start_complete( | ||
98 | struct isci_host *, | ||
99 | struct isci_remote_device *, | ||
100 | enum sci_status); | ||
101 | |||
102 | void isci_remote_device_stop_complete( | ||
103 | struct isci_host *, | ||
104 | struct isci_remote_device *, | ||
105 | enum sci_status); | ||
106 | |||
107 | enum sci_status isci_remote_device_stop(struct isci_host *ihost, | 89 | enum sci_status isci_remote_device_stop(struct isci_host *ihost, |
108 | struct isci_remote_device *idev); | 90 | struct isci_remote_device *idev); |
109 | void isci_remote_device_nuke_requests( | 91 | void isci_remote_device_nuke_requests(struct isci_host *ihost, |
110 | struct isci_remote_device *isci_device); | 92 | struct isci_remote_device *idev); |
111 | |||
112 | void isci_remote_device_ready(struct isci_host *ihost, | 93 | void isci_remote_device_ready(struct isci_host *ihost, |
113 | struct isci_remote_device *idev); | 94 | struct isci_remote_device *idev); |
114 | |||
115 | void isci_remote_device_not_ready(struct isci_host *ihost, | 95 | void isci_remote_device_not_ready(struct isci_host *ihost, |
116 | struct isci_remote_device *idev, u32 reason); | 96 | struct isci_remote_device *idev, u32 reason); |
117 | 97 | void isci_remote_device_gone(struct domain_device *domain_dev); | |
118 | void isci_remote_device_gone( | 98 | int isci_remote_device_found(struct domain_device *domain_dev); |
119 | struct domain_device *domain_dev); | 99 | bool isci_device_is_reset_pending(struct isci_host *ihost, |
120 | 100 | struct isci_remote_device *idev); | |
121 | int isci_remote_device_found( | 101 | void isci_device_clear_reset_pending(struct isci_host *ihost, |
122 | struct domain_device *domain_dev); | 102 | struct isci_remote_device *idev); |
123 | 103 | void isci_remote_device_change_state(struct isci_remote_device *idev, | |
124 | bool isci_device_is_reset_pending( | 104 | enum isci_status status); |
125 | struct isci_host *isci_host, | ||
126 | struct isci_remote_device *isci_device); | ||
127 | |||
128 | void isci_device_clear_reset_pending( | ||
129 | struct isci_remote_device *isci_device); | ||
130 | |||
131 | void isci_remote_device_change_state( | ||
132 | struct isci_remote_device *isci_device, | ||
133 | enum isci_status status); | ||
134 | 105 | ||
135 | #endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */ | 106 | #endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */ |
136 | |||