Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758279AbZJFUVs (ORCPT ); Tue, 6 Oct 2009 16:21:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757704AbZJFUVr (ORCPT ); Tue, 6 Oct 2009 16:21:47 -0400 Received: from na3sys009aog105.obsmtp.com ([74.125.149.75]:42169 "EHLO na3sys009aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757692AbZJFUVq convert rfc822-to-8bit (ORCPT ); Tue, 6 Oct 2009 16:21:46 -0400 From: "Yang, Bo" To: "Yang, Bo" , "linux-scsi@vger.kernel.org" , "akpm@osdl.org" , "linux-kernel@vger.kernel.org" , "James.Bottomley@HansenPartnership.com" , "James.Bottomley@suse.de" CC: "Austria, Winston" Date: Tue, 6 Oct 2009 14:20:59 -0600 Subject: [PATCH 3/12] scsi: megaraid_sas - Add poll mechanism to megaraid sas driver (part II) Thread-Topic: [PATCH 3/12] scsi: megaraid_sas - Add poll mechanism to megaraid sas driver (part II) Thread-Index: Aco284muq21jjlUCRvWfDnAhnowdBQAABfzAANwH1OADF5nF0A== Message-ID: <4B6A08C587958942AA3002690DD4F8C35C6861B3@cosmail02.lsi.com> References: <4B6A08C587958942AA3002690DD4F8C35C51195F@cosmail02.lsi.com> <4B6A08C587958942AA3002690DD4F8C35C5123FD@cosmail02.lsi.com> In-Reply-To: <4B6A08C587958942AA3002690DD4F8C35C5123FD@cosmail02.lsi.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2605 Lines: 79 RESUBMIT: Add poll support part II -- update the sysfs parameter to tell application driver support AEN poll Signed-off-by Bo Yang --- drivers/scsi/megaraid/megaraid_sas.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c --- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c 2009-09-13 09:49:11.000000000 -0400 +++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c 2009-09-13 10:11:50.000000000 -0400 @@ -92,7 +92,7 @@ static DEFINE_MUTEX(megasas_async_queue_ static int megasas_poll_wait_aen; static DECLARE_WAIT_QUEUE_HEAD(megasas_poll_wait); - +static u32 support_poll_for_event; static u32 megasas_dbg_lvl; /* define lock for aen poll */ @@ -3432,6 +3432,15 @@ static DRIVER_ATTR(release_date, S_IRUGO NULL); static ssize_t +megasas_sysfs_show_support_poll_for_event(struct device_driver *dd, char *buf) +{ + return sprintf(buf, "%u\n", support_poll_for_event); +} + +static DRIVER_ATTR(support_poll_for_event, S_IRUGO, + megasas_sysfs_show_support_poll_for_event, NULL); + +static ssize_t megasas_sysfs_show_dbg_lvl(struct device_driver *dd, char *buf) { return sprintf(buf, "%u\n", megasas_dbg_lvl); @@ -3522,6 +3531,8 @@ static int __init megasas_init(void) printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, MEGASAS_EXT_VERSION); + support_poll_for_event = 2; + memset(&megasas_mgmt_info, 0, sizeof(megasas_mgmt_info)); /* @@ -3554,6 +3565,12 @@ static int __init megasas_init(void) &driver_attr_release_date); if (rval) goto err_dcf_rel_date; + + rval = driver_create_file(&megasas_pci_driver.driver, + &driver_attr_support_poll_for_event); + if (rval) + goto err_dcf_support_poll_for_event; + rval = driver_create_file(&megasas_pci_driver.driver, &driver_attr_dbg_lvl); if (rval) @@ -3570,7 +3587,12 @@ err_dcf_poll_mode_io: &driver_attr_dbg_lvl); err_dcf_dbg_lvl: driver_remove_file(&megasas_pci_driver.driver, + &driver_attr_support_poll_for_event); + +err_dcf_support_poll_for_event: + driver_remove_file(&megasas_pci_driver.driver, &driver_attr_release_date); + err_dcf_rel_date: driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version); err_dcf_attr_ver: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/