Merge commit 'opendreambox/opendreambox-1.6' into vuplus-1.6
[vuplus_openembedded] / recipes / busybox / busybox-1.15.3 / vuplus / hdparm_M.patch
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
3 @@ -288,6 +288,7 @@
4         smallint set_sleepnow;
5         smallint get_powermode;
6         smallint getset_apmmode;
7 +       smallint getset_acoustic;
8         int xfermode_requested;
9         unsigned long dkeep;
10         unsigned long standby_requested; /* 0..255 */
11 @@ -297,6 +298,7 @@
12         unsigned long wcache;
13         unsigned long doorlock;
14         unsigned long apmmode;
15 +       unsigned long acoustic;
16  #endif
17         IF_FEATURE_HDPARM_GET_IDENTITY(        smallint get_IDentity;)
18         IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(  smallint getset_busstate;)
19 @@ -361,6 +363,7 @@
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      )
27 @@ -370,6 +373,7 @@
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);
37                 args[1] = 0;
38         }
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);
42 +       }
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);
46 +       }
47         if (getset_wcache == IS_SET) {
48  #ifdef DO_FLUSHCACHE
49  #ifndef WIN_FLUSHCACHE
50 @@ -1986,7 +1998,7 @@
51         IF_FEATURE_HDPARM_GET_IDENTITY("iI")
52         IF_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
53  #ifdef HDIO_DRIVE_CMD
54 -       "S:D:P:X:K:A:L:W:CyYzZ"
55 +       "S:D:P:X:K:A:L:W:CyYzZM:"
56  #endif
57         IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:")
58  #ifdef HDIO_GET_QDMA
59 @@ -2026,6 +2038,7 @@
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');
66  #ifdef HDIO_DRIVE_CMD