diff -Naur busybox-1.2.1/miscutils/hdparm.c busybox-1.2.1-hdparm_M/miscutils/hdparm.c --- busybox-1.2.1/miscutils/hdparm.c 2006-07-01 00:42:09.000000000 +0200 +++ busybox-1.2.1-hdparm_M/miscutils/hdparm.c 2006-09-22 05:55:29.000000000 +0200 @@ -1134,6 +1134,7 @@ static unsigned long set_sleepnow, get_sleepnow; static unsigned long get_powermode; static unsigned long set_apmmode, get_apmmode, apmmode; +static unsigned long set_acoustic = 0, get_acoustic = 0, acoustic = 0; #endif #ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY static int get_IDentity; @@ -1765,6 +1766,17 @@ bb_ioctl(fd, HDIO_DRIVE_CMD, &args,"HDIO_DRIVE_CMD"); args[1] = 0; } + if (set_acoustic) + { + if (get_acoustic) + printf(" setting AAM level to 0x%02lX (%ld)\n", acoustic, acoustic); + bb_ioctl(fd, HDIO_SET_ACOUSTIC, (int*)acoustic,"HDIO_SET_ACOUSTIC"); + } + if (get_acoustic) + { + bb_ioctl(fd, HDIO_GET_ACOUSTIC, (unsigned long*)&parm,"HDIO_GET_ACOUSTIC"); + printf(" acoustic = %2ld (128=quiet ... 254=fast)\n", parm); + } if (set_wcache) { #ifdef DO_FLUSHCACHE @@ -2134,6 +2146,7 @@ if (c == 'c') parse_opts(&get_io32bit, &set_io32bit, &io32bit, 0, INT_MAX /*8*/); if (c == 'k') parse_opts(&get_keep, &set_keep, &keep, 0, 1); if (c == 'a') parse_opts(&get_readahead, &set_readahead, &Xreadahead, 0, INT_MAX); + if (c == 'M') parse_opts(&get_acoustic, &set_acoustic, &acoustic, 1, 254); if (c == 'B') parse_opts(&get_apmmode, &set_apmmode, &apmmode, 1, 255); do_flush |= do_timings |= (c == 't'); do_flush |= do_ctimings |= (c == 'T');