aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libfc/fc_rport.c28
-rw-r--r--include/scsi/libfc.h2
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 7162385f52eb..bf7364fc16cb 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -77,13 +77,13 @@ static void fc_rport_error_retry(struct fc_rport *, struct fc_frame *);
77static void fc_rport_work(struct work_struct *); 77static void fc_rport_work(struct work_struct *);
78 78
79static const char *fc_rport_state_names[] = { 79static const char *fc_rport_state_names[] = {
80 [RPORT_ST_NONE] = "None",
81 [RPORT_ST_INIT] = "Init", 80 [RPORT_ST_INIT] = "Init",
82 [RPORT_ST_PLOGI] = "PLOGI", 81 [RPORT_ST_PLOGI] = "PLOGI",
83 [RPORT_ST_PRLI] = "PRLI", 82 [RPORT_ST_PRLI] = "PRLI",
84 [RPORT_ST_RTV] = "RTV", 83 [RPORT_ST_RTV] = "RTV",
85 [RPORT_ST_READY] = "Ready", 84 [RPORT_ST_READY] = "Ready",
86 [RPORT_ST_LOGO] = "LOGO", 85 [RPORT_ST_LOGO] = "LOGO",
86 [RPORT_ST_DELETE] = "Delete",
87}; 87};
88 88
89static void fc_rport_rogue_destroy(struct device *dev) 89static void fc_rport_rogue_destroy(struct device *dev)
@@ -326,8 +326,8 @@ int fc_rport_logoff(struct fc_rport *rport)
326 326
327 FC_RPORT_DBG(rport, "Remove port\n"); 327 FC_RPORT_DBG(rport, "Remove port\n");
328 328
329 if (rdata->rp_state == RPORT_ST_NONE) { 329 if (rdata->rp_state == RPORT_ST_DELETE) {
330 FC_RPORT_DBG(rport, "Port in NONE state, not removing\n"); 330 FC_RPORT_DBG(rport, "Port in Delete state, not removing\n");
331 mutex_unlock(&rdata->rp_mutex); 331 mutex_unlock(&rdata->rp_mutex);
332 goto out; 332 goto out;
333 } 333 }
@@ -335,10 +335,10 @@ int fc_rport_logoff(struct fc_rport *rport)
335 fc_rport_enter_logo(rport); 335 fc_rport_enter_logo(rport);
336 336
337 /* 337 /*
338 * Change the state to NONE so that we discard 338 * Change the state to Delete so that we discard
339 * the response. 339 * the response.
340 */ 340 */
341 fc_rport_state_enter(rport, RPORT_ST_NONE); 341 fc_rport_state_enter(rport, RPORT_ST_DELETE);
342 342
343 mutex_unlock(&rdata->rp_mutex); 343 mutex_unlock(&rdata->rp_mutex);
344 344
@@ -405,7 +405,7 @@ static void fc_rport_timeout(struct work_struct *work)
405 break; 405 break;
406 case RPORT_ST_READY: 406 case RPORT_ST_READY:
407 case RPORT_ST_INIT: 407 case RPORT_ST_INIT:
408 case RPORT_ST_NONE: 408 case RPORT_ST_DELETE:
409 break; 409 break;
410 } 410 }
411 411
@@ -433,14 +433,14 @@ static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp)
433 case RPORT_ST_PRLI: 433 case RPORT_ST_PRLI:
434 case RPORT_ST_LOGO: 434 case RPORT_ST_LOGO:
435 rdata->event = RPORT_EV_FAILED; 435 rdata->event = RPORT_EV_FAILED;
436 fc_rport_state_enter(rport, RPORT_ST_NONE); 436 fc_rport_state_enter(rport, RPORT_ST_DELETE);
437 queue_work(rport_event_queue, 437 queue_work(rport_event_queue,
438 &rdata->event_work); 438 &rdata->event_work);
439 break; 439 break;
440 case RPORT_ST_RTV: 440 case RPORT_ST_RTV:
441 fc_rport_enter_ready(rport); 441 fc_rport_enter_ready(rport);
442 break; 442 break;
443 case RPORT_ST_NONE: 443 case RPORT_ST_DELETE:
444 case RPORT_ST_READY: 444 case RPORT_ST_READY:
445 case RPORT_ST_INIT: 445 case RPORT_ST_INIT:
446 break; 446 break;
@@ -652,7 +652,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
652 } else { 652 } else {
653 FC_RPORT_DBG(rport, "Bad ELS response for PRLI command\n"); 653 FC_RPORT_DBG(rport, "Bad ELS response for PRLI command\n");
654 rdata->event = RPORT_EV_FAILED; 654 rdata->event = RPORT_EV_FAILED;
655 fc_rport_state_enter(rport, RPORT_ST_NONE); 655 fc_rport_state_enter(rport, RPORT_ST_DELETE);
656 queue_work(rport_event_queue, &rdata->event_work); 656 queue_work(rport_event_queue, &rdata->event_work);
657 } 657 }
658 658
@@ -703,7 +703,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
703 } else { 703 } else {
704 FC_RPORT_DBG(rport, "Bad ELS response for LOGO command\n"); 704 FC_RPORT_DBG(rport, "Bad ELS response for LOGO command\n");
705 rdata->event = RPORT_EV_LOGO; 705 rdata->event = RPORT_EV_LOGO;
706 fc_rport_state_enter(rport, RPORT_ST_NONE); 706 fc_rport_state_enter(rport, RPORT_ST_DELETE);
707 queue_work(rport_event_queue, &rdata->event_work); 707 queue_work(rport_event_queue, &rdata->event_work);
708 } 708 }
709 709
@@ -1012,7 +1012,7 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
1012 "- ignored for now\n", rdata->rp_state); 1012 "- ignored for now\n", rdata->rp_state);
1013 /* XXX TBD - should reset */ 1013 /* XXX TBD - should reset */
1014 break; 1014 break;
1015 case RPORT_ST_NONE: 1015 case RPORT_ST_DELETE:
1016 default: 1016 default:
1017 FC_RPORT_DBG(rport, "Received PLOGI in unexpected " 1017 FC_RPORT_DBG(rport, "Received PLOGI in unexpected "
1018 "state %d\n", rdata->rp_state); 1018 "state %d\n", rdata->rp_state);
@@ -1238,7 +1238,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp,
1238 FC_RPORT_DBG(rport, "Received PRLO request while in state %s\n", 1238 FC_RPORT_DBG(rport, "Received PRLO request while in state %s\n",
1239 fc_rport_state(rport)); 1239 fc_rport_state(rport));
1240 1240
1241 if (rdata->rp_state == RPORT_ST_NONE) { 1241 if (rdata->rp_state == RPORT_ST_DELETE) {
1242 fc_frame_free(fp); 1242 fc_frame_free(fp);
1243 return; 1243 return;
1244 } 1244 }
@@ -1271,13 +1271,13 @@ static void fc_rport_recv_logo_req(struct fc_rport *rport, struct fc_seq *sp,
1271 FC_RPORT_DBG(rport, "Received LOGO request while in state %s\n", 1271 FC_RPORT_DBG(rport, "Received LOGO request while in state %s\n",
1272 fc_rport_state(rport)); 1272 fc_rport_state(rport));
1273 1273
1274 if (rdata->rp_state == RPORT_ST_NONE) { 1274 if (rdata->rp_state == RPORT_ST_DELETE) {
1275 fc_frame_free(fp); 1275 fc_frame_free(fp);
1276 return; 1276 return;
1277 } 1277 }
1278 1278
1279 rdata->event = RPORT_EV_LOGO; 1279 rdata->event = RPORT_EV_LOGO;
1280 fc_rport_state_enter(rport, RPORT_ST_NONE); 1280 fc_rport_state_enter(rport, RPORT_ST_DELETE);
1281 queue_work(rport_event_queue, &rdata->event_work); 1281 queue_work(rport_event_queue, &rdata->event_work);
1282 1282
1283 lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); 1283 lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index b5c9b285b462..04db7a9e631b 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -147,13 +147,13 @@ enum fc_disc_event {
147}; 147};
148 148
149enum fc_rport_state { 149enum fc_rport_state {
150 RPORT_ST_NONE = 0,
151 RPORT_ST_INIT, /* initialized */ 150 RPORT_ST_INIT, /* initialized */
152 RPORT_ST_PLOGI, /* waiting for PLOGI completion */ 151 RPORT_ST_PLOGI, /* waiting for PLOGI completion */
153 RPORT_ST_PRLI, /* waiting for PRLI completion */ 152 RPORT_ST_PRLI, /* waiting for PRLI completion */
154 RPORT_ST_RTV, /* waiting for RTV completion */ 153 RPORT_ST_RTV, /* waiting for RTV completion */
155 RPORT_ST_READY, /* ready for use */ 154 RPORT_ST_READY, /* ready for use */
156 RPORT_ST_LOGO, /* port logout sent */ 155 RPORT_ST_LOGO, /* port logout sent */
156 RPORT_ST_DELETE, /* port being deleted */
157}; 157};
158 158
159enum fc_rport_trans_state { 159enum fc_rport_trans_state {