<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- linux-2.6.18.i686/drivers/char/ipmi/ipmi_kcs_sm.c.orig	2010-05-25 14:13:22.173381000 -0700
+++ linux-2.6.18.i686/drivers/char/ipmi/ipmi_kcs_sm.c	2010-05-25 14:31:16.723127000 -0700
@@ -54,10 +54,29 @@
 #define KCS_DEBUG_MSG		2
 #define	KCS_DEBUG_ENABLE	1
 
+/* Timeouts in microseconds. */
+#define IBF_RETRY_TIMEOUT 1000000
+#define OBF_RETRY_TIMEOUT 1000000
+#define MAX_ERROR_RETRIES 10
+#define ERROR0_OBF_WAIT_JIFFIES (2*HZ)
+
 static int kcs_debug;
+static uint kcs_obf_timeout = OBF_RETRY_TIMEOUT;
+static uint kcs_ibf_timeout = IBF_RETRY_TIMEOUT;
+static ushort kcs_err_retries = MAX_ERROR_RETRIES; 
+
 module_param(kcs_debug, int, 0644);
 MODULE_PARM_DESC(kcs_debug, "debug bitmask, 1=enable, 2=messages, 4=states");
 
+module_param(kcs_obf_timeout, uint, S_IRUGO|S_IWUSR); 
+MODULE_PARM_DESC(kcs_obf_timeout, "OBF timeout value in microseconds. Default is 1000000.");
+
+module_param(kcs_ibf_timeout, uint, S_IRUGO|S_IWUSR); 
+MODULE_PARM_DESC(kcs_ibf_timeout, "IBF timeout value in microseconds. Default is 1000000.");
+
+module_param(kcs_err_retries, ushort, S_IRUGO|S_IWUSR); 
+MODULE_PARM_DESC(kcs_err_retries, "Number of error retries for kcs device. Default is 10.");
+
 /* The states the KCS driver may be in. */
 enum kcs_states {
 	KCS_IDLE,		/* The KCS interface is currently
@@ -96,12 +115,6 @@ enum kcs_states {
 #define MAX_KCS_READ_SIZE IPMI_MAX_MSG_LENGTH
 #define MAX_KCS_WRITE_SIZE IPMI_MAX_MSG_LENGTH
 
-/* Timeouts in microseconds. */
-#define IBF_RETRY_TIMEOUT 1000000
-#define OBF_RETRY_TIMEOUT 1000000
-#define MAX_ERROR_RETRIES 10
-#define ERROR0_OBF_WAIT_JIFFIES (2*HZ)
-
 struct si_sm_data
 {
 	enum kcs_states  state;
@@ -131,8 +144,8 @@ static unsigned int init_kcs_data(struct
 	kcs-&gt;read_pos = 0;
 	kcs-&gt;error_retries = 0;
 	kcs-&gt;truncated = 0;
-	kcs-&gt;ibf_timeout = IBF_RETRY_TIMEOUT;
-	kcs-&gt;obf_timeout = OBF_RETRY_TIMEOUT;
+	kcs-&gt;ibf_timeout = kcs_ibf_timeout;
+	kcs-&gt;obf_timeout = kcs_obf_timeout;
 
 	/* Reserve 2 I/O bytes. */
 	return 2;
@@ -185,7 +198,7 @@ static inline void write_next_byte(struc
 static inline void start_error_recovery(struct si_sm_data *kcs, char *reason)
 {
 	(kcs-&gt;error_retries)++;
-	if (kcs-&gt;error_retries &gt; MAX_ERROR_RETRIES) {
+	if (kcs-&gt;error_retries &gt; kcs_err_retries) {
 		if (kcs_debug &amp; KCS_DEBUG_ENABLE)
 			printk(KERN_DEBUG "ipmi_kcs_sm: kcs hosed: %s\n", reason);
 		kcs-&gt;state = KCS_HOSED;
@@ -215,12 +228,12 @@ static inline int check_ibf(struct si_sm
 		kcs-&gt;ibf_timeout -= time;
 		if (kcs-&gt;ibf_timeout &lt; 0) {
 			start_error_recovery(kcs, "IBF not ready in time");
-			kcs-&gt;ibf_timeout = IBF_RETRY_TIMEOUT;
+			kcs-&gt;ibf_timeout = kcs_ibf_timeout;
 			return 1;
 		}
 		return 0;
 	}
-	kcs-&gt;ibf_timeout = IBF_RETRY_TIMEOUT;
+	kcs-&gt;ibf_timeout = kcs_ibf_timeout;
 	return 1;
 }
 
@@ -235,7 +248,7 @@ static inline int check_obf(struct si_sm
 		}
 		return 0;
 	}
-	kcs-&gt;obf_timeout = OBF_RETRY_TIMEOUT;
+	kcs-&gt;obf_timeout = kcs_obf_timeout;
 	return 1;
 }
 
@@ -251,8 +264,8 @@ static void restart_kcs_transaction(stru
 	kcs-&gt;write_pos = 0;
 	kcs-&gt;read_pos = 0;
 	kcs-&gt;state = KCS_WAIT_WRITE_START;
-	kcs-&gt;ibf_timeout = IBF_RETRY_TIMEOUT;
-	kcs-&gt;obf_timeout = OBF_RETRY_TIMEOUT;
+	kcs-&gt;ibf_timeout = kcs_ibf_timeout;
+	kcs-&gt;obf_timeout = kcs_obf_timeout;
 	write_cmd(kcs, KCS_WRITE_START);
 }
 
@@ -283,8 +296,9 @@ static int start_kcs_transaction(struct 
 	kcs-&gt;write_pos = 0;
 	kcs-&gt;read_pos = 0;
 	kcs-&gt;state = KCS_START_OP;
-	kcs-&gt;ibf_timeout = IBF_RETRY_TIMEOUT;
-	kcs-&gt;obf_timeout = OBF_RETRY_TIMEOUT;
+	kcs-&gt;ibf_timeout = kcs_ibf_timeout;
+	kcs-&gt;obf_timeout = kcs_obf_timeout;
+
 	return 0;
 }
 
</pre></body></html>