diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be_cmds.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_cmds.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c index 1432ed5e9fc6..80d97f3d2ed9 100644 --- a/drivers/scsi/be2iscsi/be_cmds.c +++ b/drivers/scsi/be2iscsi/be_cmds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (C) 2005 - 2013 Emulex | 2 | * Copyright (C) 2005 - 2014 Emulex |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -275,6 +275,19 @@ bool is_link_state_evt(u32 trailer) | |||
275 | ASYNC_EVENT_CODE_LINK_STATE); | 275 | ASYNC_EVENT_CODE_LINK_STATE); |
276 | } | 276 | } |
277 | 277 | ||
278 | static bool is_iscsi_evt(u32 trailer) | ||
279 | { | ||
280 | return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) & | ||
281 | ASYNC_TRAILER_EVENT_CODE_MASK) == | ||
282 | ASYNC_EVENT_CODE_ISCSI; | ||
283 | } | ||
284 | |||
285 | static int iscsi_evt_type(u32 trailer) | ||
286 | { | ||
287 | return (trailer >> ASYNC_TRAILER_EVENT_TYPE_SHIFT) & | ||
288 | ASYNC_TRAILER_EVENT_TYPE_MASK; | ||
289 | } | ||
290 | |||
278 | static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl) | 291 | static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl) |
279 | { | 292 | { |
280 | if (compl->flags != 0) { | 293 | if (compl->flags != 0) { |
@@ -438,7 +451,7 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba, | |||
438 | } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) || | 451 | } else if ((evt->port_link_status & ASYNC_EVENT_LINK_UP) || |
439 | ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && | 452 | ((evt->port_link_status & ASYNC_EVENT_LOGICAL) && |
440 | (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { | 453 | (evt->port_fault == BEISCSI_PHY_LINK_FAULT_NONE))) { |
441 | phba->state = BE_ADAPTER_LINK_UP; | 454 | phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT; |
442 | 455 | ||
443 | beiscsi_log(phba, KERN_ERR, | 456 | beiscsi_log(phba, KERN_ERR, |
444 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, | 457 | BEISCSI_LOG_CONFIG | BEISCSI_LOG_INIT, |
@@ -461,7 +474,28 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba) | |||
461 | /* Interpret compl as a async link evt */ | 474 | /* Interpret compl as a async link evt */ |
462 | beiscsi_async_link_state_process(phba, | 475 | beiscsi_async_link_state_process(phba, |
463 | (struct be_async_event_link_state *) compl); | 476 | (struct be_async_event_link_state *) compl); |
464 | else | 477 | else if (is_iscsi_evt(compl->flags)) { |
478 | switch (iscsi_evt_type(compl->flags)) { | ||
479 | case ASYNC_EVENT_NEW_ISCSI_TGT_DISC: | ||
480 | case ASYNC_EVENT_NEW_ISCSI_CONN: | ||
481 | case ASYNC_EVENT_NEW_TCP_CONN: | ||
482 | phba->state |= BE_ADAPTER_CHECK_BOOT; | ||
483 | beiscsi_log(phba, KERN_ERR, | ||
484 | BEISCSI_LOG_CONFIG | | ||
485 | BEISCSI_LOG_MBOX, | ||
486 | "BC_%d : Async iscsi Event," | ||
487 | " flags handled = 0x%08x\n", | ||
488 | compl->flags); | ||
489 | break; | ||
490 | default: | ||
491 | beiscsi_log(phba, KERN_ERR, | ||
492 | BEISCSI_LOG_CONFIG | | ||
493 | BEISCSI_LOG_MBOX, | ||
494 | "BC_%d : Unsupported Async" | ||
495 | " Event, flags = 0x%08x\n", | ||
496 | compl->flags); | ||
497 | } | ||
498 | } else | ||
465 | beiscsi_log(phba, KERN_ERR, | 499 | beiscsi_log(phba, KERN_ERR, |
466 | BEISCSI_LOG_CONFIG | | 500 | BEISCSI_LOG_CONFIG | |
467 | BEISCSI_LOG_MBOX, | 501 | BEISCSI_LOG_MBOX, |