diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b79fca7d461b..ecf2a40d70be 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <linux/kthread.h> | 12 | #include <linux/kthread.h> |
13 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
14 | #include <linux/kobject.h> | ||
14 | 15 | ||
15 | #include <scsi/scsi_tcq.h> | 16 | #include <scsi/scsi_tcq.h> |
16 | #include <scsi/scsicam.h> | 17 | #include <scsi/scsicam.h> |
@@ -2653,6 +2654,37 @@ qla2x00_post_async_work(login_done, QLA_EVT_ASYNC_LOGIN_DONE); | |||
2653 | qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); | 2654 | qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT); |
2654 | qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); | 2655 | qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE); |
2655 | 2656 | ||
2657 | int | ||
2658 | qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code) | ||
2659 | { | ||
2660 | struct qla_work_evt *e; | ||
2661 | |||
2662 | e = qla2x00_alloc_work(vha, QLA_EVT_UEVENT); | ||
2663 | if (!e) | ||
2664 | return QLA_FUNCTION_FAILED; | ||
2665 | |||
2666 | e->u.uevent.code = code; | ||
2667 | return qla2x00_post_work(vha, e); | ||
2668 | } | ||
2669 | |||
2670 | static void | ||
2671 | qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code) | ||
2672 | { | ||
2673 | char event_string[40]; | ||
2674 | char *envp[] = { event_string, NULL }; | ||
2675 | |||
2676 | switch (code) { | ||
2677 | case QLA_UEVENT_CODE_FW_DUMP: | ||
2678 | snprintf(event_string, sizeof(event_string), "FW_DUMP=%ld", | ||
2679 | vha->host_no); | ||
2680 | break; | ||
2681 | default: | ||
2682 | /* do nothing */ | ||
2683 | break; | ||
2684 | } | ||
2685 | kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp); | ||
2686 | } | ||
2687 | |||
2656 | void | 2688 | void |
2657 | qla2x00_do_work(struct scsi_qla_host *vha) | 2689 | qla2x00_do_work(struct scsi_qla_host *vha) |
2658 | { | 2690 | { |
@@ -2690,6 +2722,9 @@ qla2x00_do_work(struct scsi_qla_host *vha) | |||
2690 | qla2x00_async_logout_done(vha, e->u.logio.fcport, | 2722 | qla2x00_async_logout_done(vha, e->u.logio.fcport, |
2691 | e->u.logio.data); | 2723 | e->u.logio.data); |
2692 | break; | 2724 | break; |
2725 | case QLA_EVT_UEVENT: | ||
2726 | qla2x00_uevent_emit(vha, e->u.uevent.code); | ||
2727 | break; | ||
2693 | } | 2728 | } |
2694 | if (e->flags & QLA_EVT_FLAG_FREE) | 2729 | if (e->flags & QLA_EVT_FLAG_FREE) |
2695 | kfree(e); | 2730 | kfree(e); |