/* This is only called to handle FC worker events. Since this a rare occurance, we allocate a struct lpfc_work_evt structure here instead of embedding it in the IOCB.  */
int lpfc_workq_post_event(struct lpfc_hba *phba, void *arg1, void *arg2, uint32_t evt)
/* This is only called to handle FC worker events. Since this a rare occurance, we allocate a struct lpfc_work_evt structure here instead of embedding it in the IOCB.  */
int lpfc_workq_post_event(struct lpfc_hba *phba, void *arg1, void *arg2, uint32_t evt)
{
	struct lpfc_work_evt  *evtp;
	unsigned long flags;
	evtp = kmalloc(sizeof(struct lpfc_work_evt), GFP_ATOMIC);
	if (!evtp)
		return 0;
	evtp->evt_arg1  = arg1;
	evtp->evt_arg2  = arg2;
	evtp->evt       = evt;
	spin_lock_irqsave(&phba->hbalock, flags);
	list_add_tail(&evtp->evt_listp, &phba->work_list);
	spin_unlock_irqrestore(&phba->hbalock, flags);
	lpfc_worker_wake_up(phba);
	return 1;
}