diff options
author | Yang, Bo <Bo.Yang@lsi.com> | 2009-10-06 16:20:59 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-29 13:03:18 -0400 |
commit | 72c4fd36dc7f755a5245ef2495fe27d5084d776d (patch) | |
tree | 91ba2c009280ab6e8a13601b94df111ba41576f7 | |
parent | c35188377f12e5e0a74f18c3dfdd67baf88db514 (diff) |
[SCSI] megaraid_sas: add sysfs for AEN polling
update the sysfs parameter to tell application driver support AEN poll
Signed-off-by Bo Yang<bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 0d44fecf367d..012141378f3b 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -92,7 +92,7 @@ static DEFINE_MUTEX(megasas_async_queue_mutex); | |||
92 | 92 | ||
93 | static int megasas_poll_wait_aen; | 93 | static int megasas_poll_wait_aen; |
94 | static DECLARE_WAIT_QUEUE_HEAD(megasas_poll_wait); | 94 | static DECLARE_WAIT_QUEUE_HEAD(megasas_poll_wait); |
95 | 95 | static u32 support_poll_for_event; | |
96 | static u32 megasas_dbg_lvl; | 96 | static u32 megasas_dbg_lvl; |
97 | 97 | ||
98 | /* define lock for aen poll */ | 98 | /* define lock for aen poll */ |
@@ -3432,6 +3432,15 @@ static DRIVER_ATTR(release_date, S_IRUGO, megasas_sysfs_show_release_date, | |||
3432 | NULL); | 3432 | NULL); |
3433 | 3433 | ||
3434 | static ssize_t | 3434 | static ssize_t |
3435 | megasas_sysfs_show_support_poll_for_event(struct device_driver *dd, char *buf) | ||
3436 | { | ||
3437 | return sprintf(buf, "%u\n", support_poll_for_event); | ||
3438 | } | ||
3439 | |||
3440 | static DRIVER_ATTR(support_poll_for_event, S_IRUGO, | ||
3441 | megasas_sysfs_show_support_poll_for_event, NULL); | ||
3442 | |||
3443 | static ssize_t | ||
3435 | megasas_sysfs_show_dbg_lvl(struct device_driver *dd, char *buf) | 3444 | megasas_sysfs_show_dbg_lvl(struct device_driver *dd, char *buf) |
3436 | { | 3445 | { |
3437 | return sprintf(buf, "%u\n", megasas_dbg_lvl); | 3446 | return sprintf(buf, "%u\n", megasas_dbg_lvl); |
@@ -3522,6 +3531,8 @@ static int __init megasas_init(void) | |||
3522 | printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, | 3531 | printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, |
3523 | MEGASAS_EXT_VERSION); | 3532 | MEGASAS_EXT_VERSION); |
3524 | 3533 | ||
3534 | support_poll_for_event = 2; | ||
3535 | |||
3525 | memset(&megasas_mgmt_info, 0, sizeof(megasas_mgmt_info)); | 3536 | memset(&megasas_mgmt_info, 0, sizeof(megasas_mgmt_info)); |
3526 | 3537 | ||
3527 | /* | 3538 | /* |
@@ -3554,6 +3565,12 @@ static int __init megasas_init(void) | |||
3554 | &driver_attr_release_date); | 3565 | &driver_attr_release_date); |
3555 | if (rval) | 3566 | if (rval) |
3556 | goto err_dcf_rel_date; | 3567 | goto err_dcf_rel_date; |
3568 | |||
3569 | rval = driver_create_file(&megasas_pci_driver.driver, | ||
3570 | &driver_attr_support_poll_for_event); | ||
3571 | if (rval) | ||
3572 | goto err_dcf_support_poll_for_event; | ||
3573 | |||
3557 | rval = driver_create_file(&megasas_pci_driver.driver, | 3574 | rval = driver_create_file(&megasas_pci_driver.driver, |
3558 | &driver_attr_dbg_lvl); | 3575 | &driver_attr_dbg_lvl); |
3559 | if (rval) | 3576 | if (rval) |
@@ -3570,7 +3587,12 @@ err_dcf_poll_mode_io: | |||
3570 | &driver_attr_dbg_lvl); | 3587 | &driver_attr_dbg_lvl); |
3571 | err_dcf_dbg_lvl: | 3588 | err_dcf_dbg_lvl: |
3572 | driver_remove_file(&megasas_pci_driver.driver, | 3589 | driver_remove_file(&megasas_pci_driver.driver, |
3590 | &driver_attr_support_poll_for_event); | ||
3591 | |||
3592 | err_dcf_support_poll_for_event: | ||
3593 | driver_remove_file(&megasas_pci_driver.driver, | ||
3573 | &driver_attr_release_date); | 3594 | &driver_attr_release_date); |
3595 | |||
3574 | err_dcf_rel_date: | 3596 | err_dcf_rel_date: |
3575 | driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version); | 3597 | driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version); |
3576 | err_dcf_attr_ver: | 3598 | err_dcf_attr_ver: |