# thinkpad active protection support

## gEry

hi im looking for a way to get my harddrive protection running. 

I know this website: http://hdaps.sourceforge.net/

I tried to install the source, but the compiling hdaps-20050825-02/kernel by typing make, i get this error:

 *Quote:*   

> error: `platform_bus_type' undeclared here (not in a function)
> 
> hdaps-20050825-02/kernel/hdaps.c:319: error: initializer element is not constant
> 
> hdaps-20050825-02/kernel/hdaps.c:319: error: (near initialization for `hdaps_driver.bus')
> ...

 

Does someone know, what i miss?

Or else a way to get that running?

----------

## Philantrop

hdaps basically seems to be unmaintained. I took a look at that error (which I could reproduce) and found a solution to get it compiled but I can't guarantee, of course, it will work as expected. I don't own a ThinkPad so you'll have to try yourself.

Below you'll find a patch to hdaps.c in the "kernel" directory. Basically, you just have to add the line prefixed by the plus ("+") sign. Then try compiling it again. 

```
--- hdaps.c~    2005-08-26 03:22:43.000000000 +0200

+++ hdaps.c     2006-06-16 09:14:44.000000000 +0200

@@ -34,6 +34,7 @@

 #include <linux/module.h>

 #include <linux/timer.h>

 #include <linux/spinlock.h>

+#include <linux/platform_device.h>

 #include <asm/io.h>

 #define HDAPS_LOW_PORT         0x1600  /* first port used by accelerometer */

```

----------

## gEry

hi.

yeah, that helped - i got it compiled. i loaded the driver and installed the gkrellm plugin, which gave me some data. but i guess there were totaly wrong. something there didn't work correctly. After rebooting and testing all again i had the problem, that the system was not able to take any inputs. No mouse, no keyboard... :S

Any idea? I guess that happened because this got never finished... - why??

Btw how did you found out, which library wasnt included?

----------

## Philantrop

 *gEry wrote:*   

> yeah, that helped - i got it compiled. i loaded the driver and installed the gkrellm plugin, which gave me some data. but i guess there were totaly wrong. something there didn't work correctly.

 

Well, hdaps hasn't been updated for almost a year and until someone comes along to work on it you should not expect to get it to work.

 *gEry wrote:*   

> After rebooting and testing all again i had the problem, that the system was not able to take any inputs. No mouse, no keyboard... :S
> 
> Any idea? I guess that happened because this got never finished... - why??

 

No, sorry, no idea. You might check the sf.net project, its forums, etc. Maybe you'll find some information there. I don't have access to any ThinkPad so I can help you get this stuff compiled but running it is something completely different. 

 *gEry wrote:*   

> Btw how did you found out, which library wasnt included?

 

Actually, it's just a header file. I simply examined the kernel sources and found out in which header file "platform_bus_type" is declared. Including it let the compiler find it and thus the kernel module could be compiled.

----------

## gEry

 *Quote:*   

> compiled but running it is something completely different.

 

Yeah true...

 *Quote:*   

> Actually, it's just a header file. I simply examined the kernel sources and found out in which header file "platform_bus_type" is declared. Including it let the compiler find it and thus the kernel module could be compiled.

 

Heh, lol, i thought you took this way... i was to tired yesterday :S...

Anyway.. thanks for your help!

cheers

gery

----------

## Specialized

The hdaps-driver for thinkpads is in the kernel. I don't know, when the support started, but it is supported in gentoo-sources-2.6.16.

```
 Device-drivers->Hardware Monitoring Support->IBM Hard Drive Active Protection System (hdaps) 
```

But the patch for the 2.6.16-Kernel, which activates the disk-protection does not work for me.

[/code]

----------

