diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2009-08-25 17:00:34 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-10 13:07:39 -0400 |
commit | ab28f1fd3b0d14c1bd693e640decd711d5e6642a (patch) | |
tree | 3d7b051d7ab8b6d7fb7d936f95e336bf25f26832 /drivers/scsi/libfc/fc_rport.c | |
parent | 090eb6c41aa74273d3f0721637cff738cfd80669 (diff) |
[SCSI] libfc: prepare to split off struct fc_rport_priv from fc_rport_libfc_priv
While the I/O and LLD interfaces use fc_rport_libfc_priv, the
disc and rport interfaces will use fc_rport_priv, which will
be separately allocated.
Change the disc and rport usage of fc_rport_libfc_priv to fc_rport_priv.
Use #define temporarily to make both names equivalent until a
subsequent patch splits them.
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 'drivers/scsi/libfc/fc_rport.c')
-rw-r--r-- | drivers/scsi/libfc/fc_rport.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 90cc90dd3b5d..5f8f437e76b3 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c | |||
@@ -96,7 +96,7 @@ static void fc_rport_rogue_destroy(struct device *dev) | |||
96 | struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *dp) | 96 | struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *dp) |
97 | { | 97 | { |
98 | struct fc_rport *rport; | 98 | struct fc_rport *rport; |
99 | struct fc_rport_libfc_priv *rdata; | 99 | struct fc_rport_priv *rdata; |
100 | rport = kzalloc(sizeof(*rport) + sizeof(*rdata), GFP_KERNEL); | 100 | rport = kzalloc(sizeof(*rport) + sizeof(*rdata), GFP_KERNEL); |
101 | 101 | ||
102 | if (!rport) | 102 | if (!rport) |
@@ -144,7 +144,7 @@ struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *dp) | |||
144 | static const char *fc_rport_state(struct fc_rport *rport) | 144 | static const char *fc_rport_state(struct fc_rport *rport) |
145 | { | 145 | { |
146 | const char *cp; | 146 | const char *cp; |
147 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 147 | struct fc_rport_priv *rdata = rport->dd_data; |
148 | 148 | ||
149 | cp = fc_rport_state_names[rdata->rp_state]; | 149 | cp = fc_rport_state_names[rdata->rp_state]; |
150 | if (!cp) | 150 | if (!cp) |
@@ -199,7 +199,7 @@ static unsigned int fc_plogi_get_maxframe(struct fc_els_flogi *flp, | |||
199 | static void fc_rport_state_enter(struct fc_rport *rport, | 199 | static void fc_rport_state_enter(struct fc_rport *rport, |
200 | enum fc_rport_state new) | 200 | enum fc_rport_state new) |
201 | { | 201 | { |
202 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 202 | struct fc_rport_priv *rdata = rport->dd_data; |
203 | if (rdata->rp_state != new) | 203 | if (rdata->rp_state != new) |
204 | rdata->retries = 0; | 204 | rdata->retries = 0; |
205 | rdata->rp_state = new; | 205 | rdata->rp_state = new; |
@@ -208,8 +208,8 @@ static void fc_rport_state_enter(struct fc_rport *rport, | |||
208 | static void fc_rport_work(struct work_struct *work) | 208 | static void fc_rport_work(struct work_struct *work) |
209 | { | 209 | { |
210 | u32 port_id; | 210 | u32 port_id; |
211 | struct fc_rport_libfc_priv *rdata = | 211 | struct fc_rport_priv *rdata = |
212 | container_of(work, struct fc_rport_libfc_priv, event_work); | 212 | container_of(work, struct fc_rport_priv, event_work); |
213 | enum fc_rport_event event; | 213 | enum fc_rport_event event; |
214 | enum fc_rport_trans_state trans_state; | 214 | enum fc_rport_trans_state trans_state; |
215 | struct fc_lport *lport = rdata->local_port; | 215 | struct fc_lport *lport = rdata->local_port; |
@@ -222,7 +222,7 @@ static void fc_rport_work(struct work_struct *work) | |||
222 | 222 | ||
223 | if (event == RPORT_EV_CREATED) { | 223 | if (event == RPORT_EV_CREATED) { |
224 | struct fc_rport *new_rport; | 224 | struct fc_rport *new_rport; |
225 | struct fc_rport_libfc_priv *new_rdata; | 225 | struct fc_rport_priv *new_rdata; |
226 | struct fc_rport_identifiers ids; | 226 | struct fc_rport_identifiers ids; |
227 | 227 | ||
228 | ids.port_id = rport->port_id; | 228 | ids.port_id = rport->port_id; |
@@ -299,7 +299,7 @@ static void fc_rport_work(struct work_struct *work) | |||
299 | */ | 299 | */ |
300 | int fc_rport_login(struct fc_rport *rport) | 300 | int fc_rport_login(struct fc_rport *rport) |
301 | { | 301 | { |
302 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 302 | struct fc_rport_priv *rdata = rport->dd_data; |
303 | 303 | ||
304 | mutex_lock(&rdata->rp_mutex); | 304 | mutex_lock(&rdata->rp_mutex); |
305 | 305 | ||
@@ -329,7 +329,7 @@ int fc_rport_login(struct fc_rport *rport) | |||
329 | static void fc_rport_enter_delete(struct fc_rport *rport, | 329 | static void fc_rport_enter_delete(struct fc_rport *rport, |
330 | enum fc_rport_event event) | 330 | enum fc_rport_event event) |
331 | { | 331 | { |
332 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 332 | struct fc_rport_priv *rdata = rport->dd_data; |
333 | 333 | ||
334 | if (rdata->rp_state == RPORT_ST_DELETE) | 334 | if (rdata->rp_state == RPORT_ST_DELETE) |
335 | return; | 335 | return; |
@@ -353,7 +353,7 @@ static void fc_rport_enter_delete(struct fc_rport *rport, | |||
353 | */ | 353 | */ |
354 | int fc_rport_logoff(struct fc_rport *rport) | 354 | int fc_rport_logoff(struct fc_rport *rport) |
355 | { | 355 | { |
356 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 356 | struct fc_rport_priv *rdata = rport->dd_data; |
357 | 357 | ||
358 | mutex_lock(&rdata->rp_mutex); | 358 | mutex_lock(&rdata->rp_mutex); |
359 | 359 | ||
@@ -387,7 +387,7 @@ out: | |||
387 | */ | 387 | */ |
388 | static void fc_rport_enter_ready(struct fc_rport *rport) | 388 | static void fc_rport_enter_ready(struct fc_rport *rport) |
389 | { | 389 | { |
390 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 390 | struct fc_rport_priv *rdata = rport->dd_data; |
391 | 391 | ||
392 | fc_rport_state_enter(rport, RPORT_ST_READY); | 392 | fc_rport_state_enter(rport, RPORT_ST_READY); |
393 | 393 | ||
@@ -400,7 +400,7 @@ static void fc_rport_enter_ready(struct fc_rport *rport) | |||
400 | 400 | ||
401 | /** | 401 | /** |
402 | * fc_rport_timeout() - Handler for the retry_work timer. | 402 | * fc_rport_timeout() - Handler for the retry_work timer. |
403 | * @work: The work struct of the fc_rport_libfc_priv | 403 | * @work: The work struct of the fc_rport_priv |
404 | * | 404 | * |
405 | * Locking Note: Called without the rport lock held. This | 405 | * Locking Note: Called without the rport lock held. This |
406 | * function will hold the rport lock, call an _enter_* | 406 | * function will hold the rport lock, call an _enter_* |
@@ -408,8 +408,8 @@ static void fc_rport_enter_ready(struct fc_rport *rport) | |||
408 | */ | 408 | */ |
409 | static void fc_rport_timeout(struct work_struct *work) | 409 | static void fc_rport_timeout(struct work_struct *work) |
410 | { | 410 | { |
411 | struct fc_rport_libfc_priv *rdata = | 411 | struct fc_rport_priv *rdata = |
412 | container_of(work, struct fc_rport_libfc_priv, retry_work.work); | 412 | container_of(work, struct fc_rport_priv, retry_work.work); |
413 | struct fc_rport *rport = PRIV_TO_RPORT(rdata); | 413 | struct fc_rport *rport = PRIV_TO_RPORT(rdata); |
414 | 414 | ||
415 | mutex_lock(&rdata->rp_mutex); | 415 | mutex_lock(&rdata->rp_mutex); |
@@ -446,7 +446,7 @@ static void fc_rport_timeout(struct work_struct *work) | |||
446 | */ | 446 | */ |
447 | static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp) | 447 | static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp) |
448 | { | 448 | { |
449 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 449 | struct fc_rport_priv *rdata = rport->dd_data; |
450 | 450 | ||
451 | FC_RPORT_DBG(rport, "Error %ld in state %s, retries %d\n", | 451 | FC_RPORT_DBG(rport, "Error %ld in state %s, retries %d\n", |
452 | PTR_ERR(fp), fc_rport_state(rport), rdata->retries); | 452 | PTR_ERR(fp), fc_rport_state(rport), rdata->retries); |
@@ -480,7 +480,7 @@ static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp) | |||
480 | */ | 480 | */ |
481 | static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp) | 481 | static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp) |
482 | { | 482 | { |
483 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 483 | struct fc_rport_priv *rdata = rport->dd_data; |
484 | unsigned long delay = FC_DEF_E_D_TOV; | 484 | unsigned long delay = FC_DEF_E_D_TOV; |
485 | 485 | ||
486 | /* make sure this isn't an FC_EX_CLOSED error, never retry those */ | 486 | /* make sure this isn't an FC_EX_CLOSED error, never retry those */ |
@@ -515,7 +515,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
515 | void *rp_arg) | 515 | void *rp_arg) |
516 | { | 516 | { |
517 | struct fc_rport *rport = rp_arg; | 517 | struct fc_rport *rport = rp_arg; |
518 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 518 | struct fc_rport_priv *rdata = rport->dd_data; |
519 | struct fc_lport *lport = rdata->local_port; | 519 | struct fc_lport *lport = rdata->local_port; |
520 | struct fc_els_flogi *plp = NULL; | 520 | struct fc_els_flogi *plp = NULL; |
521 | unsigned int tov; | 521 | unsigned int tov; |
@@ -586,7 +586,7 @@ err: | |||
586 | */ | 586 | */ |
587 | static void fc_rport_enter_plogi(struct fc_rport *rport) | 587 | static void fc_rport_enter_plogi(struct fc_rport *rport) |
588 | { | 588 | { |
589 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 589 | struct fc_rport_priv *rdata = rport->dd_data; |
590 | struct fc_lport *lport = rdata->local_port; | 590 | struct fc_lport *lport = rdata->local_port; |
591 | struct fc_frame *fp; | 591 | struct fc_frame *fp; |
592 | 592 | ||
@@ -624,7 +624,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
624 | void *rp_arg) | 624 | void *rp_arg) |
625 | { | 625 | { |
626 | struct fc_rport *rport = rp_arg; | 626 | struct fc_rport *rport = rp_arg; |
627 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 627 | struct fc_rport_priv *rdata = rport->dd_data; |
628 | struct { | 628 | struct { |
629 | struct fc_els_prli prli; | 629 | struct fc_els_prli prli; |
630 | struct fc_els_spp spp; | 630 | struct fc_els_spp spp; |
@@ -694,7 +694,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
694 | void *rp_arg) | 694 | void *rp_arg) |
695 | { | 695 | { |
696 | struct fc_rport *rport = rp_arg; | 696 | struct fc_rport *rport = rp_arg; |
697 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 697 | struct fc_rport_priv *rdata = rport->dd_data; |
698 | u8 op; | 698 | u8 op; |
699 | 699 | ||
700 | mutex_lock(&rdata->rp_mutex); | 700 | mutex_lock(&rdata->rp_mutex); |
@@ -738,7 +738,7 @@ err: | |||
738 | */ | 738 | */ |
739 | static void fc_rport_enter_prli(struct fc_rport *rport) | 739 | static void fc_rport_enter_prli(struct fc_rport *rport) |
740 | { | 740 | { |
741 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 741 | struct fc_rport_priv *rdata = rport->dd_data; |
742 | struct fc_lport *lport = rdata->local_port; | 742 | struct fc_lport *lport = rdata->local_port; |
743 | struct { | 743 | struct { |
744 | struct fc_els_prli prli; | 744 | struct fc_els_prli prli; |
@@ -780,7 +780,7 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
780 | void *rp_arg) | 780 | void *rp_arg) |
781 | { | 781 | { |
782 | struct fc_rport *rport = rp_arg; | 782 | struct fc_rport *rport = rp_arg; |
783 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 783 | struct fc_rport_priv *rdata = rport->dd_data; |
784 | u8 op; | 784 | u8 op; |
785 | 785 | ||
786 | mutex_lock(&rdata->rp_mutex); | 786 | mutex_lock(&rdata->rp_mutex); |
@@ -841,7 +841,7 @@ err: | |||
841 | static void fc_rport_enter_rtv(struct fc_rport *rport) | 841 | static void fc_rport_enter_rtv(struct fc_rport *rport) |
842 | { | 842 | { |
843 | struct fc_frame *fp; | 843 | struct fc_frame *fp; |
844 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 844 | struct fc_rport_priv *rdata = rport->dd_data; |
845 | struct fc_lport *lport = rdata->local_port; | 845 | struct fc_lport *lport = rdata->local_port; |
846 | 846 | ||
847 | FC_RPORT_DBG(rport, "Port entered RTV state from %s state\n", | 847 | FC_RPORT_DBG(rport, "Port entered RTV state from %s state\n", |
@@ -871,7 +871,7 @@ static void fc_rport_enter_rtv(struct fc_rport *rport) | |||
871 | */ | 871 | */ |
872 | static void fc_rport_enter_logo(struct fc_rport *rport) | 872 | static void fc_rport_enter_logo(struct fc_rport *rport) |
873 | { | 873 | { |
874 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 874 | struct fc_rport_priv *rdata = rport->dd_data; |
875 | struct fc_lport *lport = rdata->local_port; | 875 | struct fc_lport *lport = rdata->local_port; |
876 | struct fc_frame *fp; | 876 | struct fc_frame *fp; |
877 | 877 | ||
@@ -907,7 +907,7 @@ static void fc_rport_enter_logo(struct fc_rport *rport) | |||
907 | void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp, | 907 | void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp, |
908 | struct fc_rport *rport) | 908 | struct fc_rport *rport) |
909 | { | 909 | { |
910 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 910 | struct fc_rport_priv *rdata = rport->dd_data; |
911 | struct fc_lport *lport = rdata->local_port; | 911 | struct fc_lport *lport = rdata->local_port; |
912 | 912 | ||
913 | struct fc_frame_header *fh; | 913 | struct fc_frame_header *fh; |
@@ -967,7 +967,7 @@ void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp, | |||
967 | static void fc_rport_recv_plogi_req(struct fc_rport *rport, | 967 | static void fc_rport_recv_plogi_req(struct fc_rport *rport, |
968 | struct fc_seq *sp, struct fc_frame *rx_fp) | 968 | struct fc_seq *sp, struct fc_frame *rx_fp) |
969 | { | 969 | { |
970 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 970 | struct fc_rport_priv *rdata = rport->dd_data; |
971 | struct fc_lport *lport = rdata->local_port; | 971 | struct fc_lport *lport = rdata->local_port; |
972 | struct fc_frame *fp = rx_fp; | 972 | struct fc_frame *fp = rx_fp; |
973 | struct fc_exch *ep; | 973 | struct fc_exch *ep; |
@@ -1090,7 +1090,7 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport, | |||
1090 | static void fc_rport_recv_prli_req(struct fc_rport *rport, | 1090 | static void fc_rport_recv_prli_req(struct fc_rport *rport, |
1091 | struct fc_seq *sp, struct fc_frame *rx_fp) | 1091 | struct fc_seq *sp, struct fc_frame *rx_fp) |
1092 | { | 1092 | { |
1093 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 1093 | struct fc_rport_priv *rdata = rport->dd_data; |
1094 | struct fc_lport *lport = rdata->local_port; | 1094 | struct fc_lport *lport = rdata->local_port; |
1095 | struct fc_exch *ep; | 1095 | struct fc_exch *ep; |
1096 | struct fc_frame *fp; | 1096 | struct fc_frame *fp; |
@@ -1242,7 +1242,7 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport, | |||
1242 | static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp, | 1242 | static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp, |
1243 | struct fc_frame *fp) | 1243 | struct fc_frame *fp) |
1244 | { | 1244 | { |
1245 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 1245 | struct fc_rport_priv *rdata = rport->dd_data; |
1246 | struct fc_lport *lport = rdata->local_port; | 1246 | struct fc_lport *lport = rdata->local_port; |
1247 | 1247 | ||
1248 | struct fc_frame_header *fh; | 1248 | struct fc_frame_header *fh; |
@@ -1278,7 +1278,7 @@ static void fc_rport_recv_logo_req(struct fc_rport *rport, struct fc_seq *sp, | |||
1278 | struct fc_frame *fp) | 1278 | struct fc_frame *fp) |
1279 | { | 1279 | { |
1280 | struct fc_frame_header *fh; | 1280 | struct fc_frame_header *fh; |
1281 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 1281 | struct fc_rport_priv *rdata = rport->dd_data; |
1282 | struct fc_lport *lport = rdata->local_port; | 1282 | struct fc_lport *lport = rdata->local_port; |
1283 | 1283 | ||
1284 | fh = fc_frame_header_get(fp); | 1284 | fh = fc_frame_header_get(fp); |
@@ -1342,8 +1342,8 @@ EXPORT_SYMBOL(fc_destroy_rport); | |||
1342 | 1342 | ||
1343 | void fc_rport_terminate_io(struct fc_rport *rport) | 1343 | void fc_rport_terminate_io(struct fc_rport *rport) |
1344 | { | 1344 | { |
1345 | struct fc_rport_libfc_priv *rdata = rport->dd_data; | 1345 | struct fc_rport_libfc_priv *rp = rport->dd_data; |
1346 | struct fc_lport *lport = rdata->local_port; | 1346 | struct fc_lport *lport = rp->local_port; |
1347 | 1347 | ||
1348 | lport->tt.exch_mgr_reset(lport, 0, rport->port_id); | 1348 | lport->tt.exch_mgr_reset(lport, 0, rport->port_id); |
1349 | lport->tt.exch_mgr_reset(lport, rport->port_id, 0); | 1349 | lport->tt.exch_mgr_reset(lport, rport->port_id, 0); |