aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/libfc.h
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 17:01:18 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 13:07:43 -0400
commit9e9d0452fe12115b1c1883c0d4d2ee509079791b (patch)
tree7cf8bb38e28e562274dcd7eeb2adfdf394876d14 /include/scsi/libfc.h
parent4c0f62b5679321b2e5572cf541ffb9f7b344d47c (diff)
[SCSI] libfc: don't create dummy (rogue) remote ports
Don't create a "dummy" remote port to go with fc_rport_priv. Make the rport truly optional by allocating fc_rport_priv separately and not requiring a dummy rport to be there if we haven't yet done fc_remote_port_add(). The fc_rport_libfc_priv remains as a structure attached to the rport for I/O purposes. Be sure to hold references on rdata when the lock is dropped in fc_rport_work(). Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi/libfc.h')
-rw-r--r--include/scsi/libfc.h40
1 files changed, 19 insertions, 21 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index d324df8c36e6..bf4b1c2ec600 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -146,11 +146,6 @@ enum fc_rport_state {
146 RPORT_ST_DELETE, /* port being deleted */ 146 RPORT_ST_DELETE, /* port being deleted */
147}; 147};
148 148
149enum fc_rport_trans_state {
150 FC_PORTSTATE_ROGUE,
151 FC_PORTSTATE_REAL,
152};
153
154/** 149/**
155 * struct fc_disc_port - temporary discovery port to hold rport identifiers 150 * struct fc_disc_port - temporary discovery port to hold rport identifiers
156 * @lp: Fibre Channel host port instance 151 * @lp: Fibre Channel host port instance
@@ -173,14 +168,6 @@ enum fc_rport_event {
173 RPORT_EV_LOGO 168 RPORT_EV_LOGO
174}; 169};
175 170
176/*
177 * Temporary definition to prepare for split off from fc_rport_libfc_priv
178 * of a separately-allocated structure called fc_rport_priv. This will
179 * be the primary object for the discovery and rport state machines.
180 * This definition is just to make this patch series easier to review.
181 */
182#define fc_rport_priv fc_rport_libfc_priv
183
184struct fc_rport_priv; 171struct fc_rport_priv;
185 172
186struct fc_rport_operations { 173struct fc_rport_operations {
@@ -191,6 +178,24 @@ struct fc_rport_operations {
191/** 178/**
192 * struct fc_rport_libfc_priv - libfc internal information about a remote port 179 * struct fc_rport_libfc_priv - libfc internal information about a remote port
193 * @local_port: Fibre Channel host port instance 180 * @local_port: Fibre Channel host port instance
181 * @rp_state: indicates READY for I/O or DELETE when blocked.
182 * @flags: REC and RETRY supported flags
183 * @e_d_tov: error detect timeout value (in msec)
184 * @r_a_tov: resource allocation timeout value (in msec)
185 */
186struct fc_rport_libfc_priv {
187 struct fc_lport *local_port;
188 enum fc_rport_state rp_state;
189 u16 flags;
190 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0)
191 #define FC_RP_FLAGS_RETRY (1 << 1)
192 unsigned int e_d_tov;
193 unsigned int r_a_tov;
194};
195
196/**
197 * struct fc_rport_priv - libfc rport and discovery info about a remote port
198 * @local_port: Fibre Channel host port instance
194 * @rport: transport remote port 199 * @rport: transport remote port
195 * @kref: reference counter 200 * @kref: reference counter
196 * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges 201 * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges
@@ -205,21 +210,18 @@ struct fc_rport_operations {
205 * @retry_work: 210 * @retry_work:
206 * @event_callback: Callback for rport READY, FAILED or LOGO 211 * @event_callback: Callback for rport READY, FAILED or LOGO
207 */ 212 */
208struct fc_rport_libfc_priv { 213struct fc_rport_priv {
209 struct fc_lport *local_port; 214 struct fc_lport *local_port;
210 struct fc_rport *rport; 215 struct fc_rport *rport;
211 struct kref kref; 216 struct kref kref;
212 enum fc_rport_state rp_state; 217 enum fc_rport_state rp_state;
213 struct fc_rport_identifiers ids; 218 struct fc_rport_identifiers ids;
214 u16 flags; 219 u16 flags;
215 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0)
216 #define FC_RP_FLAGS_RETRY (1 << 1)
217 u16 max_seq; 220 u16 max_seq;
218 u16 maxframe_size; 221 u16 maxframe_size;
219 unsigned int retries; 222 unsigned int retries;
220 unsigned int e_d_tov; 223 unsigned int e_d_tov;
221 unsigned int r_a_tov; 224 unsigned int r_a_tov;
222 enum fc_rport_trans_state trans_state;
223 struct mutex rp_mutex; 225 struct mutex rp_mutex;
224 struct delayed_work retry_work; 226 struct delayed_work retry_work;
225 enum fc_rport_event event; 227 enum fc_rport_event event;
@@ -229,9 +231,6 @@ struct fc_rport_libfc_priv {
229 u32 supported_classes; 231 u32 supported_classes;
230}; 232};
231 233
232#define RPORT_TO_PRIV(x) \
233 ((struct fc_rport_libfc_priv *)((void *)(x) + sizeof(struct fc_rport)))
234
235/* 234/*
236 * fcoe stats structure 235 * fcoe stats structure
237 */ 236 */
@@ -686,7 +685,6 @@ struct fc_disc {
686 enum fc_disc_event); 685 enum fc_disc_event);
687 686
688 struct list_head rports; 687 struct list_head rports;
689 struct list_head rogue_rports;
690 struct fc_lport *lport; 688 struct fc_lport *lport;
691 struct mutex disc_mutex; 689 struct mutex disc_mutex;
692 struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ 690 struct fc_gpn_ft_resp partial_buf; /* partial name buffer */