Li, Aubrey wrote:
> Rafael Vanoni wrote:
> 
>> Just noticed that 6682365 changed the kstat module 'battery' to
>> 'acpi_drv'. I'm pushing the update in a couple of minutes.
>>
> Not perfect, does this mean power usage feature in the new
> powertop will not work on the old revision of ON?
> 
> I would suggest we implement a simple probe mechanism here.
> Something like below:
> 
> char *
> battery_probe()
> {
>       ksp = kstat_lookup(kc, "battery", 0, "battery BIF0");
>       if (ksp)
>               return "battery";
>       ksp = kstat_lookup(kc, "acpi_drv", 0, "battery BIF0");
>       if (ksp)
>               return "acpi_drv";
>       return NULL;
> }
> 
> And battery_stat_snapshot() calls battery probe to do the rest job.
> I can make a patch for it if you like.

Here's a patch for it.

thanks
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kstat.diff
Type: text/x-patch
Size: 2507 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/tesla-dev/attachments/20080627/12ec80cb/attachment.bin>

Reply via email to