diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index f2bf81265ae..01312381639 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -656,6 +656,31 @@ bfad_im_port_clean(struct bfad_im_port_s *im_port) | |||
656 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 656 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
657 | } | 657 | } |
658 | 658 | ||
659 | static void bfad_aen_im_notify_handler(struct work_struct *work) | ||
660 | { | ||
661 | struct bfad_im_s *im = | ||
662 | container_of(work, struct bfad_im_s, aen_im_notify_work); | ||
663 | struct bfa_aen_entry_s *aen_entry; | ||
664 | struct bfad_s *bfad = im->bfad; | ||
665 | struct Scsi_Host *shost = bfad->pport.im_port->shost; | ||
666 | void *event_data; | ||
667 | unsigned long flags; | ||
668 | |||
669 | while (!list_empty(&bfad->active_aen_q)) { | ||
670 | spin_lock_irqsave(&bfad->bfad_aen_spinlock, flags); | ||
671 | bfa_q_deq(&bfad->active_aen_q, &aen_entry); | ||
672 | spin_unlock_irqrestore(&bfad->bfad_aen_spinlock, flags); | ||
673 | event_data = (char *)aen_entry + sizeof(struct list_head); | ||
674 | fc_host_post_vendor_event(shost, fc_get_event_number(), | ||
675 | sizeof(struct bfa_aen_entry_s) - | ||
676 | sizeof(struct list_head), | ||
677 | (char *)event_data, BFAD_NL_VENDOR_ID); | ||
678 | spin_lock_irqsave(&bfad->bfad_aen_spinlock, flags); | ||
679 | list_add_tail(&aen_entry->qe, &bfad->free_aen_q); | ||
680 | spin_unlock_irqrestore(&bfad->bfad_aen_spinlock, flags); | ||
681 | } | ||
682 | } | ||
683 | |||
659 | bfa_status_t | 684 | bfa_status_t |
660 | bfad_im_probe(struct bfad_s *bfad) | 685 | bfad_im_probe(struct bfad_s *bfad) |
661 | { | 686 | { |
@@ -676,6 +701,7 @@ bfad_im_probe(struct bfad_s *bfad) | |||
676 | rc = BFA_STATUS_FAILED; | 701 | rc = BFA_STATUS_FAILED; |
677 | } | 702 | } |
678 | 703 | ||
704 | INIT_WORK(&im->aen_im_notify_work, bfad_aen_im_notify_handler); | ||
679 | ext: | 705 | ext: |
680 | return rc; | 706 | return rc; |
681 | } | 707 | } |