]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] mpt fusion: make logging a global sysfs parameter
authorJames Bottomley <James.Bottomley@steeleye.com>
Sat, 28 Jul 2007 17:40:21 +0000 (13:40 -0400)
committerJames Bottomley <jejb@mulgrave.localdomain>
Tue, 31 Jul 2007 15:42:18 +0000 (10:42 -0500)
Wire up the mpt_debug_level module parameter so you can write to the
/sys/module/mptbase/parameters/mpt_debug_level and have it take effect
in every ioc.

Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/message/fusion/mptbase.c

index e866dacde7e5779b276fef36578256450a7856e0..414c109f4cf5f8ef92ac17cd56790574d760cf3d 100644 (file)
@@ -88,7 +88,9 @@ module_param(mpt_channel_mapping, int, 0);
 MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)");
 
 static int mpt_debug_level;
-module_param(mpt_debug_level, int, 0);
+static int mpt_set_debug_level(const char *val, struct kernel_param *kp);
+module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
+                 &mpt_debug_level, 0600);
 MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)");
 
 #ifdef MFCNT
@@ -220,6 +222,19 @@ pci_enable_io_access(struct pci_dev *pdev)
        pci_write_config_word(pdev, PCI_COMMAND, command_reg);
 }
 
+static int mpt_set_debug_level(const char *val, struct kernel_param *kp)
+{
+       int ret = param_set_int(val, kp);
+       MPT_ADAPTER *ioc;
+
+       if (ret)
+               return ret;
+
+       list_for_each_entry(ioc, &ioc_list, list)
+               ioc->debug_level = mpt_debug_level;
+       return 0;
+}
+
 /*
  *  Process turbo (context) reply...
  */