[ltp] Re: [ANN] tp_smapi - a new Linux SMAPI driver

Jiang Qian linux-thinkpad@linux-thinkpad.org
Sun, 4 Dec 2005 18:00:11 -0500


Hi Shem:
This is a T43 with ubuntu hoary 5.04 and kernel 2.6.12. I can't seem to 
get it compiled: error messages:
make[1]: Entering directory `/usr/src/linux-2.6.12.4'
  CC [M]  /home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.o
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:268: warning: 
`struct device_attribute' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:268: warning: 
its scope is only this definition or declaration, which is probably not 
what you want
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:268: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:278: warning: 
`struct device_attribute' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:278: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:290: warning: 
`struct device_attribute' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:290: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:315: warning: 
`struct device_attribute' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:315: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:344: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: In function 
`tp_probe':
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:351: warning: 
implicit declaration of function `request_region'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: At top level:
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:362: error: 
syntax error before "pm_message_t"
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:362: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:363: warning: 
function declaration isn't a prototype
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: In function 
`tp_suspend':
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:364: error: 
`level' undeclared (first use in this function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:364: error: 
(Each undeclared identifier is reported only once
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:364: error: for 
each function it appears in.)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:364: error: 
`SUSPEND_POWER_DOWN' undeclared (first use in this function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: At top level:
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:375: warning: 
`struct device' declared inside parameter list
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: In function 
`tp_resume':
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:377: error: 
`RESUME_POWER_ON' undeclared (first use in this function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: At top level:
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:386: error: 
variable `tp_driver' has initializer but incomplete type
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:387: error: 
unknown field `name' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:387: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:387: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:388: error: 
unknown field `bus' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:388: error: 
`platform_bus_type' undeclared here (not in a function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:388: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:388: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:389: error: 
unknown field `owner' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:389: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:389: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:390: error: 
unknown field `probe' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:390: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:390: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:391: error: 
unknown field `suspend' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:391: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:391: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:392: error: 
unknown field `resume' specified in initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:393: warning: 
excess elements in struct initializer
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:393: warning: 
(near initialization for `tp_driver')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:395: error: 
syntax error before numeric constant
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:395: warning: 
type defaults to `int' in declaration of `DEVICE_ATTR'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:395: warning: 
function declaration isn't a prototype
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:396: error: 
syntax error before numeric constant
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:396: warning: 
type defaults to `int' in declaration of `DEVICE_ATTR'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:396: warning: 
function declaration isn't a prototype
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:399: error: 
`dev_attr_start_charge_thresh' undeclared here (not in a function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:399: error: 
initializer element is not constant
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:399: error: 
(near initialization for `tp_attributes[0]')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:400: error: 
`dev_attr_stop_charge_thresh' undeclared here (not in a function)
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:400: error: 
initializer element is not constant
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:400: error: 
(near initialization for `tp_attributes[1]')
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: In function 
`tp_init':
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:446: warning: 
implicit declaration of function `driver_register'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:450: warning: 
implicit declaration of function `platform_device_register_simple'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:450: warning: 
assignment makes pointer from integer without a cast
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:456: error: 
dereferencing pointer to incomplete type
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:464: warning: 
implicit declaration of function `platform_device_unregister'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:466: warning: 
implicit declaration of function `driver_unregister'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:468: warning: 
implicit declaration of function `release_region'
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: In function 
`tp_exit':
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:476: error: 
dereferencing pointer to incomplete type
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c: At top level:
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:386: error: 
storage size of `tp_driver' isn't known
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:269: warning: 
`start_charge_thresh_show' defined but not used
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:279: warning: 
`stop_charge_thresh_show' defined but not used
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:290: warning: 
`start_charge_thresh_store' defined but not used
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:316: warning: 
`stop_charge_thresh_store' defined but not used
/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.c:396: warning: 
`DEVICE_ATTR' declared `static' but never defined
make[2]: *** [/home/qian2/download/ibm-acpi/tp_smapi-0.02/tp_smapi.o] 
Error 1
make[1]: *** [_module_/home/qian2/download/ibm-acpi/tp_smapi-0.02] 
Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12.4'
make: *** [tp_smapi.ko] Error 2

Any idea?
Thanks.
Jiang

On Mon, Dec 05, 2005 at 12:38:05AM +0200, Shem Multinymous wrote:
> Hi,
> 
> Peter,  Stefan, Csillag: thanks for the reports! Maybe your laptops
> (R40, T40p and G41) don't support this specific SMAPI function? Can
> you set charge threshold under Winows from IBM's Battery Maximizer?
> 
> Attached is tp_smapi 0.02, which has more informative error reporting.
> Let's see what dmesg says now on your systems.
> 
> Peter, about the DMI check, how is your R40 identified? Can you attach
> the output of
> "dmidecode  | grep -C5 Product"?
> 
>   Shem