1 --- busybox-1.15.3-org/miscutils/hdparm.c 2009-12-12 22:13:28.000000000 +0100
2 +++ busybox-1.15.3/miscutils/hdparm.c 2010-02-22 21:17:06.000000000 +0100
5 smallint get_powermode;
6 smallint getset_apmmode;
7 + smallint getset_acoustic;
8 int xfermode_requested;
10 unsigned long standby_requested; /* 0..255 */
13 unsigned long doorlock;
14 unsigned long apmmode;
15 + unsigned long acoustic;
17 IF_FEATURE_HDPARM_GET_IDENTITY( smallint get_IDentity;)
18 IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( smallint getset_busstate;)
20 #define set_sleepnow (G.set_sleepnow )
21 #define get_powermode (G.get_powermode )
22 #define getset_apmmode (G.getset_apmmode )
23 +#define getset_acoustic (G.getset_acoustic )
24 #define xfermode_requested (G.xfermode_requested )
25 #define dkeep (G.dkeep )
26 #define standby_requested (G.standby_requested )
28 #define wcache (G.wcache )
29 #define doorlock (G.doorlock )
30 #define apmmode (G.apmmode )
31 +#define acoustic (G.acoustic )
32 #define get_IDentity (G.get_IDentity )
33 #define getset_busstate (G.getset_busstate )
34 #define perform_reset (G.perform_reset )
35 @@ -1680,6 +1684,14 @@
36 ioctl_or_warn(fd, HDIO_DRIVE_CMD, &args);
39 + if (getset_acoustic == IS_SET) {
40 + printf(" setting AAM level to 0x%02lX (%ld)\n", acoustic, acoustic);
41 + ioctl_or_warn(fd, HDIO_SET_ACOUSTIC, (int*)acoustic);
43 + if (getset_acoustic) {
44 + ioctl_or_warn(fd, HDIO_GET_ACOUSTIC, (unsigned long*)&parm);
45 + printf(" acoustic = %2ld (128=quiet ... 254=fast)\n", parm);
47 if (getset_wcache == IS_SET) {
49 #ifndef WIN_FLUSHCACHE
51 IF_FEATURE_HDPARM_GET_IDENTITY("iI")
52 IF_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
54 - "S:D:P:X:K:A:L:W:CyYzZ"
55 + "S:D:P:X:K:A:L:W:CyYzZM:"
57 IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:")
60 if (c == 'k') getset_keep = parse_opts_0_1(&keep);
61 if (c == 'a') getset_readahead = parse_opts_0_INTMAX(&Xreadahead);
62 if (c == 'B') getset_apmmode = parse_opts(&apmmode, 1, 255);
63 + if (c == 'M') getset_acoustic = parse_opts(&acoustic, 1, 254);
64 do_flush |= do_timings |= (c == 't');
65 do_flush |= do_ctimings |= (c == 'T');