Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / char / ipmi / ipmi_smic_sm.c
index ae18747..39d7e5e 100644 (file)
 
 #include <linux/kernel.h> /* For printk. */
 #include <linux/string.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/ipmi_msgdefs.h>                /* for completion codes */
 #include "ipmi_si_sm.h"
 
-#define IPMI_SMIC_VERSION "v33"
-
 /* smic_debug is a bit-field
  *     SMIC_DEBUG_ENABLE -     turned on for now
  *     SMIC_DEBUG_MSG -        commands and their responses
@@ -58,6 +58,8 @@
 #define        SMIC_DEBUG_ENABLE       1
 
 static int smic_debug = 1;
+module_param(smic_debug, int, 0644);
+MODULE_PARM_DESC(smic_debug, "debug bitmask, 1=enable, 2=messages, 4=states");
 
 enum smic_states {
        SMIC_IDLE,
@@ -78,11 +80,17 @@ enum smic_states {
 #define SMIC_MAX_ERROR_RETRIES 3
 
 /* Timeouts in microseconds. */
-#define SMIC_RETRY_TIMEOUT 100000
+#define SMIC_RETRY_TIMEOUT 2000000
 
 /* SMIC Flags Register Bits */
 #define SMIC_RX_DATA_READY     0x80
 #define SMIC_TX_DATA_READY     0x40
+/*
+ * SMIC_SMI and SMIC_EVM_DATA_AVAIL are only used by
+ * a few systems, and then only by Systems Management
+ * Interrupts, not by the OS.  Always ignore these bits.
+ *
+ */
 #define SMIC_SMI               0x10
 #define SMIC_EVM_DATA_AVAIL    0x08
 #define SMIC_SMS_DATA_AVAIL    0x04
@@ -366,8 +374,7 @@ static enum si_sm_result smic_event (struct si_sm_data *smic, long time)
        switch (smic->state) {
        case SMIC_IDLE:
                /* in IDLE we check for available messages */
-               if (flags & (SMIC_SMI |
-                            SMIC_EVM_DATA_AVAIL | SMIC_SMS_DATA_AVAIL))
+               if (flags & SMIC_SMS_DATA_AVAIL)
                {
                        return SI_SM_ATTN;
                }
@@ -588,7 +595,6 @@ static int smic_size(void)
 
 struct si_sm_handlers smic_smi_handlers =
 {
-       .version           = IPMI_SMIC_VERSION,
        .init_data         = init_smic_data,
        .start_transaction = start_smic_transaction,
        .get_result        = smic_get_result,