[BusyBox-cvs] busybox/miscutils hdparm.c,1.2,1.3 Config.in,1.6,1.7

Erik Andersen andersen at busybox.net
Wed Aug 6 08:57:37 UTC 2003


Update of /var/cvs/busybox/miscutils
In directory winder:/tmp/cvs-serv18291/miscutils

Modified Files:
	hdparm.c Config.in 
Log Message:
Patch from Steven Scholz:

should we rename the define into CONFIG_FEATURE_HDPARM_HDIO_DMA and
use it for "set" and "get" ???

Since although CONFIG_FEATURE_HDPARM_HDIO_GET_DMA is _not_ set I still
can use "hdparm -d 1 /dev/hda" to switch the DMA on.
Is this desireable or meant to be like that?

So how about the applied patch?


Index: hdparm.c
===================================================================
RCS file: /var/cvs/busybox/miscutils/hdparm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hdparm.c	6 Aug 2003 08:47:59 -0000	1.2
+++ hdparm.c	6 Aug 2003 08:57:34 -0000	1.3
@@ -1820,6 +1820,7 @@
 		if (ioctl(fd, HDIO_SET_UNMASKINTR, unmask))
 			bb_perror_msg(" HDIO_SET_UNMASKINTR failed");
 	}
+#ifdef CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA
 	if (set_dma) {
 		no_scsi();
 		if (get_dma) {
@@ -1829,6 +1830,7 @@
 		if (ioctl(fd, HDIO_SET_DMA, dma))
 			bb_perror_msg(" HDIO_SET_DMA failed");
 	}
+#endif /* CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA */
 	if (set_dma_q) {
 		no_scsi();
 		if (get_dma_q) {
@@ -2080,7 +2082,7 @@
 		}
 	}
 
-#ifdef CONFIG_FEATURE_HDPARM_HDIO_GET_DMA
+#ifdef CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA
 	if ((verbose && !is_scsi_hd) || get_dma) {
 		no_scsi();
 		if (ioctl(fd, HDIO_GET_DMA, &parm))
@@ -2382,6 +2384,7 @@
 							unmask = *p++ - '0';
 						}
 						break;
+#ifdef CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA
 					case 'd':
 						get_dma = noisy;
 						noisy = 1;
@@ -2392,6 +2395,7 @@
 							dma = *p++ - '0';
 						}
 						break;
+#endif /* CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA */
 					case 'n':
 						get_nowerr = noisy;
 						noisy = 1;

Index: Config.in
===================================================================
RCS file: /var/cvs/busybox/miscutils/Config.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Config.in	28 Jul 2003 07:40:36 -0000	1.6
+++ Config.in	6 Aug 2003 08:57:34 -0000	1.7
@@ -100,6 +100,14 @@
 	  and the '-b' option to get/set bus state.  This is dangerous
 	  stuff, so you should probably say N.
 
+config CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA
+	bool "  get/set using_dma flag (DANGEROUS)"
+	default n
+	depends on CONFIG_HDPARM
+	help
+	  Enables the 'hdparm -d' option to get/set using_dma flag.
+	  This is dangerous stuff, so you should probably say N.
+
 config CONFIG_MAKEDEVS
 	bool "makedevs"
 	default n




More information about the busybox-cvs mailing list