Dang, I can believe I missed doing this. Patch is attached. I never tied in the standard ioctls when they came into the kernel. Can you try this out and tell me if it fixes the problem for you?

-corey

Benoit Guillon wrote:
Hello,

Sorry if I'm on wrong list but I haven't seen a user mailing list(?) I'm currently trying to use the IPMI watchdog through the /dev/watchdog device. It works fine, but I must be able to configure/change the pre-timeout value from one time to another.

I insert the module as follow:

modprobe ipmi_watchdog timeout=60 pretimeout=20 \
         preaction=pre_int \
         preop=preop_give_data start_now=0


To change the timeout I use (and it works):

  rc = ioctl(watchdog, WDIOC_SETTIMEOUT, &timeout);
  if (rc != 0) {
    perror("ioctl(WDIOC_SETTIMEOUT)");
  } else {
    printf("The new timeout is %d seconds\n", timeout);
  }

To change the pre-timeout I tried (and it fails):

  if (pre_timeout != 0) {
    rc = ioctl(watchdog, WDIOC_SETPRETIMEOUT, &pre_timeout);
    if (rc != 0) {
      perror("ioctl(WDIOC_SETPRETIMEOUT)");
    } else {
      printf("The pre-timeout is %d seconds\n", pre_timeout);
    }
  }

Is there a way to change the pre-timeout value? BTW, is there a way to change the timeout action (reset, etc.)?

Thanks,


Add the standard IOCTLs to the IPMI driver for setting and getting
the pretimeout.

Corey Minyard <[EMAIL PROTECTED]>

Index: linux-2.6.23/drivers/char/ipmi/ipmi_watchdog.c
===================================================================
--- linux-2.6.23.orig/drivers/char/ipmi/ipmi_watchdog.c
+++ linux-2.6.23/drivers/char/ipmi/ipmi_watchdog.c
@@ -683,6 +683,7 @@ static int ipmi_ioctl(struct inode *inod
 		return 0;
 
 	case WDIOC_SET_PRETIMEOUT:
+	case WDIOC_SETPRETIMEOUT:
 		i = copy_from_user(&val, argp, sizeof(int));
 		if (i)
 			return -EFAULT;
@@ -690,6 +691,7 @@ static int ipmi_ioctl(struct inode *inod
 		return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
 	case WDIOC_GET_PRETIMEOUT:
+	case WDIOC_GETPRETIMEOUT:
 		i = copy_to_user(argp, &pretimeout, sizeof(pretimeout));
 		if (i)
 			return -EFAULT;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to